texts: I've downloaded a shapefile that should show counties in UK, but it has a marker as a symbol?

texts:
I've downloaded this file: http://geoportal.statistics.gov.uk/datasets/0b09996863af4b5db78058225bac5d1b_3

Yet I cannot get the shapes of counties, the symbol given by default is a marker. Can anyone help? I just want a layer showing counties.


texts: How do I install the r.inund.fluv script in GRASS? https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.inund.fluv/


texts: creating GIS data directly on camera images

texts: If I'm taking few photos with superimposition and enabling a stereo system for images pairs, Is there a software for 3D or 2D calibrating that will enable then creating GIS vector data  directly on regular camera images after anchoring the data ?


texts: OpenLayers using exceed len on vector styles

texts:
I have a text inside a style which fits inside a vector polygon.

On small polygons the text disappears (map is zoomed in max) so  I am trying to set exceed len to true based on this example.

How can I use this within my style?

let style_selected = function (feature, resolution) {
let getParcel2 = feature.get("parcel_nbr")+"";
return new ol.style.Style({
  fill: new ol.style.Fill({
  color: '#5fba6a38'
}),
 stroke: new ol.style.Stroke({
    color: 'red',
    width: 3
  }),
  text: new ol.style.Text({
    text: getParcel2,
    font: '4em Calibri,sans-serif',
    fill: new ol.style.Fill({
    color: 'white'
    }),
    stroke: new ol.style.Stroke({
      color: 'green',
      width: 5
    })
  })
});
}


texts:
I'm trying to export a DXF file from QGIS 1.8.0 Lisboa and can not have a 3D file in AutoCAD or Microstation. It results always in 2D file.

How can I export height data from a shapefile in QGIS?


texts: How to delete raster dataset from sde base programmatically

texts:
I use sde database, registered with ArcGis Server 10.1. Sde connection is direct. Database container is postgres.

There is a raster dataset in this sde base. I can open this sde database

    private IWorkspace ArcSdeWorkspaceFromFile(String connectionFile)
    {
        Type factoryType = Type.GetTypeFromProgID(
            "esriDataSourcesGDB.SdeWorkspaceFactory");
        IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance
            (factoryType);
        return workspaceFactory.OpenFromFile(connectionFile, 0);
    }

and raster dataset.
I can also add some data to this registered raster dataset.

    private void OpenRasterDataset()
    {
        IRasterWorkspaceEx temp = (IRasterWorkspaceEx)fgdbWorkspace;
        rasterDataset = temp.OpenRasterDataset(SdeParameters.rdName);
    }

But I don't know how to delete (or clear - it is the best way) this raster dataset.


texts: Data gets skewed when re-adding it into the table of contents

texts: some of my data gets re-align every time i re-add it in within the QGIS Table of contents ( like a good 5-10 feet off). I have no idea what could be the cause, I may have the given layer in a different projection compared to the basemap  but i don't think that is the case. suggestions?


texts: Split a polygon based on point groups (QGIS)

texts:
I have a project with two layers:

A work area as a single polygon
A set of points all contained in the previous area

I would like to divide the original area into 5 polygons/features that all contain the same amount of points from the second layer.

So far the closest thing I found was the answer to How to group points in QGIS? which suggests using the Concave Hull plugin but I haven't found a way to specify how many groups I want with that tool.

So, what I would like to end up with is 5 polygons that contain 116 or 117 points each and which ideally cover only the pink area.

If you would like to try with my data, it can be accessed here.


texts: read and write geotiffs bigger than memory?

texts:
The geotiff format is a versatile and easy to understand file format. The only limitation is when I try to do raster calculations I prefer to use GDAL (over ArcPy) which comes with the limitation that you read the data in the computer's memory.

My objective is to do raster calculations such as setting all values below a threshold to a NoData value.

Somebody shared a python library called DASK with me. Can somebody explain how to open, calculate and write geotiff files bigger than your memory?

The problem is how GDAL stores the array in the computer memory

try:
    from osgeo import ogr, osr, gdal
except:
    sys.exit('ERROR: cannot find GDAL/OGR modules')
# Enable GDAL/OGR exceptions
gdal.UseExceptions()
import os
import numpy as np
import dask.array as da

INPUTPATH = os.path.join('Path to store the geotiffs')

OUTPUTPATH = os.path.join('Path to store the output geotiffs')

def readFile(filename):
    filehandle = gdal.Open(filename)
    band1 = filehandle.GetRasterBand(1)
    geotransform = filehandle.GetGeoTransform()
    geoproj = filehandle.GetProjection()
    Z = band1.ReadAsArray() # Can this be avoided?
    xsize = filehandle.RasterXSize
    ysize = filehandle.RasterYSize
    filehandle = None
    return xsize,ysize,geotransform,geoproj,Z

def writeFile(filename,geotransform,geoprojection,data):
    (x,y) = data.shape
    format = "GTiff"
    driver = gdal.GetDriverByName(format)
    # you can change the dataformat but be sure to be able to store negative values including -9999
    dst_datatype = gdal.GDT_Float32
    dst_ds = driver.Create(filename,y,x,1,dst_datatype, [ 'COMPRESS=LZW' ])
    dst_ds.GetRasterBand(1).SetNoDataValue(-9999)
    dst_ds.GetRasterBand(1).WriteArray(data)
    dst_ds.SetGeoTransform(geotransform)
    dst_ds.SetProjection(geoprojection)
    dst_ds = None
    return 1

files = os.listdir(INPUTPATH)

for oneFile in files:
    print oneFile
    InputBaseName = oneFile.split('.')[0]
    [xsize, ysize, geotransform, geoproj, Z] = readFile(os.path.join(INPUTPATH, oneFile))
    Z[Z<-9000] = -9999
    writefilename = os.path.join(OUTPUTPATH,(InputBaseName+".tif"))
    writeFile(writefilename, geotransform, geoproj, Z)

print "Done"

This link is useful but I can't seem to find a way to read the array from the geotiff in dask. Any tips/tricks?


texts: How to do Spatial Tools Projections between different projection types

texts:
I am working with the SQL Spatial Tools from http://sqlspatialtools.codeplex.com/

And a variety of data sets, primarily from LINZ and Google.

These involve working with projections for
4326 (WGS84?)
3785 / 3857  (WGS84 Mercator / Web Projection?)
4167 (NZGD2000?)
2193 (NZGD Transverse Mercator?)

After looking at what's available, I'm wanting primarily to map 2193 <-> 4167 <-> 4326
And I'm going to store 2193 and 4326 to work with.

But I'm unclear on how to go about converting between the different projections.

I'm guessing that one of the following is correct for going from 2193 to 4326

Either
1.  Generate a Transverse Mercator Projection with appropriate settings
2.  Call Unproject on it to get a 4167 projection
3.  Generate a "Something" Projection with the 4167 settings
4.  Call Unproject to get to a unit sphere co-ordinate set
5.  Generate a "Something" projection with the 4326 settings
6.  Call "Project" with the unit sphere co-ordinate set to get the 4326 co-ordinate set

Or
1.  Generate a "Something" projection to get directly from 2193 to the unit sphere
2.  Generate a "Something" projection to get from the unit sphere to 4326


texts:
I've implemented the getFeature function in my OL4 as in the example:
https://openlayers.org/en/latest/examples/getfeatureinfo-tile.html

  map.on('singleclick', function(evt) {
    document.getElementById('info').innerHTML = '';
    var viewResolution = /** @type {number} */ (view.getResolution());
    var url = wmsSource.getGetFeatureInfoUrl(
        evt.coordinate, viewResolution, 'EPSG:3857',
        {'INFO_FORMAT': 'text/html'});
    if (url) {
      document.getElementById('info').innerHTML =
          '<iframe seamless src="' + url + '"></iframe>';
    }
  });

How can I handle the result in order to create a tooltip? I don't want to use the <iframe>

If I console.log the var URL, I have back the URL itself and not the XML page, how can I have back the XML page?

I also tried with var xmlDoc = parser.parseFromString(url,"text/xml"); but what I get back is not the XML.


texts: Creating square buffer around point feature using ArcGIS for Desktop?

texts:
I would like to create a square buffer from a point feature but I do not understand the code that goes into it.

Similar questions have been asked on the forums.esri website but that was over 10 years ago, and it did not work when I tried the code.

How do I create a square buffer from a point feature?


texts: errors occur while adding features with openlayers3

texts:
I'm using openlayers v3.17.1 along with OSM Server as tile server.

I got errors when I called vectorSource.addFeatures with the parameter Array containing more than about 10 features.

Error Info:  TypeError: Cannot read property '0' of null with the following code:

zoom_level = 10;
var FEATURE_URI = {
  1: '/marker/blue.png',
  2: '/marker/yellow.png',
  3: '/marker/red.png',
  4: '/marker/blue.png',
}

// feature alert
function Alert(f_lon, f_lat, o_alert) {
  var feature = new ol.Feature({
    geometry: new ol.geom.Point(ol.proj.fromLonLat([f_lon, f_lat])),
    name: o_alert.name,
    msg: o_alert.msg,
  });

  feature.setStyle(new ol.style.Style({
    image: new ol.style.Icon({
      opacity: .6,
      src: FEATURE_URI[o_alert.level],
      scale: 1 / 16,    // 32px
    })
  }));

  return feature;
}

var vectorSource = new ol.source.Vector({
  features: []
});

var vectorLayer = new ol.layer.Vector({
  source: vectorSource
});

var map = new ol.Map({
  target: document.getElementById('map'),
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM({
        url: host + '/osm_tiles/{z}/{x}/{y}.png',
        crossOrigin: null,
      })
    }),
    vectorLayer
  ],
  view: new ol.View({
    center: ol.proj.fromLonLat([lon, lat]),
    zoom: zoom_level
  })
});

var element = $('#popup')[0];
var popup = new ol.Overlay({
  element: element,
  positioning: 'bottom-center',
  stopEvent: false,
  offset: [0, -30]
})

map.addOverlay(popup);

map.on('click', function (evt) {
  var feature = map.forEachFeatureAtPixel(evt.pixel,
    function (feature) {
      return feature;
    });
  if (feature) {
    var coordinates = feature.getGeometry().getCoordinates();
    popup.setPosition(coordinates);
    $(element).popover({
      'placement': 'top',
      'html': true,
      'title': feature.get('name'),
      'content': feature.get('msg')
    });
    $(element).popover('show');
  } else {
    $(element).popover('destroy');
  }
});

// change mouse cursor when over marker
map.on('pointermove', function (e) {
  if (e.dragging) {
    $(element).popover('destroy');
    return;
  }
  var pixel = map.getEventPixel(e.originalEvent);
  var hit = map.hasFeatureAtPixel(pixel);
  map.getTarget().style.cursor = hit ? 'pointer' : '';
});

var features = [];
// points is the Array returned from server.
points.forEach(function(val, idx) {
  if(idx > 32) return;
  var loc = val.Location.split(',');
  features[idx] = new Alert(
    +loc[0] + idx / 45,
    +loc[1],
    val
  )
});
vectorSource.addFeatures(features);


texts: Checking to see if postGIS is enabled in Ruby on Rails

texts: How can you check if postGIS is enabled in a ruby on rails app? rails seems to do a lot of the backend for you so this is confusing for me. Normally, i would set it up and set up the extension myself.  How can I check that it is enabled?


texts:
I am looking for a way to use GMaps API to download the displayed polygon of a building in Google maps using the maps view (2D geometries of buildings) for a specific address. I have not actually found a way how to download these shaps directly from Google. There are a lot of possibilities to convert the satellite images using semantic segmentation to building geometries, which is not what I am looking for.
So far I have found the possibility to extract the bounding box in lat lon of a building using its address, see https://developers.google.com/maps/documentation/gaming/reference/unity/class/google/maps/feature/shape/map-feature-shape. Is there any better way to use GMaps Static API to extract the detailed building outline geometry?
If this is not possible, I would go over to use OSM or Bing Maps to do so. Any other suggestions for free or cheap services in that field?
Thanks so much!


texts: Colour balancing SPOT5 ArcGIS Mosaic Dataset?

texts:
I'm working on a project using satellite imagery of a large braided river. I've been provide lots of SPOT5 images (that overlap). I've created a geodatabase, created a mosaic dataset, added the rasters to it, set the no data and set display order to max. A screen shot is shown below.

As you can see it has that patchy look to it. As I understand you resolve this by colour balancing.  I've spent much of this afternoon tinkering around with just about every combination of parameters. The overall mosaic dataset can change slightly or terribly depending upon my choice but I always still have that patchy look to it, just in a different intensity of colours.

Does colour balancing only work under some set of near perfect conditions (that is rarely obtained) and that generally most people end up with a patchy mosaic look as I have and that's about as good as it gets?

I have to admit this is my first dabbling into correcting satellite images so may be I have missed some step. I had a good look at the ESRI help and their walk-through and I can't see I'm doing anything wrong.


texts: Excluding matching records from Tabular Join?

texts:
This may be slightly esoteric and I suspect it just can't be done but I have found myself in the following situation.

I have a roads layer with a routeid (short integer) field. This field has been used for state route numbers as well as county route numbers. Unfortunately the numbers overlap so there can be a state route 40 and a county route 40. I have a joined table that is only relevant to county roads. The problem is that the information (including incorrect road names) shows up when this table is joined to the roads layer based on that routeid field (in records for state routes). I have ways (other fields) to determine whether it is a state or county route but I don't see any way to exclude table records from the join based on other fields. Am I wrong? Wouldn't it be nice to be able to join based on an "AND" expression instead of a single field?

I'd like to avoid a schema change where I have to add a new field and use that for the state route numbers. Currently that or separating County roads with a definition query and only joining those seem to be my only realistic choices.

The table and the feature class are both in a SQL Server Database.


texts: Drawing a GeoJSON with D3js on OpenLayers 4

texts:
The goal is to interact with the DOM based on users input using JavaScript. I have now considered using D3js (v5) to draw the points. Without the base vector layers (loaded as a geojson) and OpenLayers, the data gets drawn with D3js but when put together I do not see it on. Below is my code.

For JavaScript files

    var width = 800,
    height = 800;
var svg = d3.select("#map")
    .append("svg")
    .attr("width", width)
    .attr("height", height);

var files = ['../data/mines.geojson', "../data/mines_centroid.geojson"];

var promises = [];

files.forEach(function (url) {
    promises.push(d3.json(url))
});

Promise.all(promises).then(function (val) {
    drawMap(val[0], val[1])
});

var projection = d3.geoMercator();

var geoPath = d3.geoPath()
    .projection(projection);

var radius = d3.scaleLog();

function drawMap(mines, centroid) {
    projection.center([22.9696994071445, 40.8135651828386]);
    projection.fitSize([width, height], mines);
    svg.append("g")
        .selectAll("path")
        .data(mines.features)
        .enter()
        .append("path")
        .attr("d", geoPath)
        .attr("stroke", "blue")
        .attr("fill", "white")
        .attr("class", "mines");
    addCentroid(centroid)
}

function addCentroid(centroid) {
    console.log(centroid)

    var points = svg.selectAll("circle")
        .data(centroid.features, function (d) {
            return d;
        })
        .enter().append("circle")
        .attr('r', function (d) {
            return radius(d.properties.Scale) * 1.5
        })
        .attr('cx', function (d) {
            return projection(d.geometry.coordinates)[0]
        })
        .attr('cy', function (d) {
            return projection(d.geometry.coordinates)[1]
        })
        .attr("class", "centroid")
        .attr("id", function (d) {
            return d.properties.ID
        })

}

My GeoJSON looks like this.

{
  "type": "FeatureCollection",
  "crs": {
    "type": "name",
    "properties": {
      "name": "EPSG:4326"
    }
  },
  "features": [
    {
      "type": "Feature",
      "id": 1,
      "geometry": {
        "type": "Point",
        "coordinates": [
          22.9696994071445,
          40.8135651828386
        ]
      },
      "properties": {
        "FID": 1,
        "OBJECTID": 119,
        "ID": "GR-4291",
        "Code_12": "131",
        "Remark": " ",
        "Scale": 10,
        "Area_ha": 95.6086248776,
        "Shape_Leng": 6533.9468799,
        "code00": 13,
        "Shape_Le_1": 6533.9468799,
        "Shape_Area": 956086.248776,
        "ORIG_FID": 0
      }
    }
]
}


texts: How to generate image tiles from custom geo data for use with Leaflet

texts:
Migrating a webapp from Google Maps API V3 to OSM + Leaflet, which displays custom data that consists of lots of lines and points, on a background map.

When this custom data is drawn by Leaflet on the fly from geoJson files, the map tends to become less responsive on slow machines (zoom and pan take forever).

The custom data is pretty static (it doesn't change often), so it would make sense to pre-render it as transparent image tiles that would be displayed on top of the map. This is how KML files are rendered on Google Maps and it works very well.

So the question is this: how to generate transparent tiles from geoJson files and reference them in Leaflet (instead of displaying geoJson data on the fly)?


texts:
I have a query in overpass turbo, which searches for all buildings in the current bounding box (http://overpass-turbo.eu/s/Dgv). I would like to exclude buildings with certain id's from the output - e.g. the house no. 14 in the center with OSM id=93778916.

Any ideas how to do that?

After reading some other posts I understand, that the Overpass QL "if:" statement might work. But I really have to clue how to use it.


texts: Converting raster stack to RGB GeoTIFF for use as a background image in maps using R?

texts:
I've been trying to use R to download google maps images as rasters, then convert them into GeoTIFF files which can be imported as a geo-referenced background layer in GIS programs.

I've been searching for hours now, but I can't seem to figure out how to save a colored geotiff file.  I can make Geotiff files which contain only the raster data with no saved color maps, but I've been unable to figure out how to add color maps to the GeoTIFFs.

Here's my code so far:

## Install and load required packages
install.packages('openmap')
require(ggmap)
require(raster)
require(dismo)

## Get region of interest
region <- c(11.03,12,-1.1,-0.04)
e = extent(region)

## Download google maps image of region
map <- gmap(e,rgb = T)

## Plot map
plotRGB(map)

## Write a geotiff raster (does not contain RGB info!)
writeRaster(x = map,
            filename = 'GoogleMap.tif',
            format = 'GTiff',
            overwrite = T
            )

The resulting raster can by imported by other programs as a raster layer, but the colormap is undefined.

And ideas on how to add RGB info to the resulting geoTIFF?

Heres a link to an example GeoTIFF which works in the GIS software I'm using

Perhaps I am misunderstanding what a geotiff is.  I assumed a geotiff was just a TIFF file with georeferencing metadata... but perhaps is there a difference between geotiffs and just normal tiff with georeferenced metadata?

I'm thinking this because the dismo::gmap function outputs georeferenced gif files which do exactly what I need, as they can be read by normal image viewers and they also can be plotted correctly in GIS software, unlike the geotiffs which I made, which cannot be read by image viewers.


texts: Export raster with one band only using gdalwarp in extracting raster using shapefile via python script? QGIS 2.18

texts:
This code of mine is written to extract raster using a particular shapefile in PyQGIS:

import subprocess, os, glob, gdal
result_path = "/data/brent/bukidnon_hansen_data/result_path//"
os.chdir("/data/brent/bukidnon_hansen_data/bukidnon_forest_cover_hansen")
mask_layer = ("/data/brent/bukidnon_hansen_data/shp_files/AD_Kalatunganrange.shp")

for fname in glob.glob("*.tif"):
    input = os.path.join("/data/brent/bukidnon_hansen_data/bukidnon_forest_cover_hansen", fname)
    (pathshp, shpname) = os.path.split(mask_layer)
    (newName, ext) = os.path.splitext(shpname)
    warp = 'gdalwarp -cutline \'%s\' -crop_to_cutline -dstalpha \'%s\' \'%s\'' % (mask_layer, input, result_path+newName+fname)
    os.system(warp)

The output rasters had two bands, what I want are single band rasters.
I checked the gdalwarp documentation http://www.gdal.org/gdalwarp.html but I can't find the arguments that should make the output raster as single band.

Perhaps I missed something?

The input tiffs are single band rasters.


texts:
I have a raster whose pixel values are 0 or 1 (b/w areas in the image below) and data type is Float32.
I made a point layer from each individual pixel's center. Then I made some calculation for all points and added it as new field.

How can I make a new raster, which has the same properties (resolution, pixel size, data type, etc.)  with the first raster, from those point values?


texts:
I selected the layer I want to zoom in and I can actually zoom in using the python console that Qgis provides using

  iface.zoomToActiveLayer()

but if I do the same in my code, is like that line is being ignored.

code here:

def openFileNameDialog(self):

    options = QFileDialog.Options()
    options |= QFileDialog.DontUseNativeDialog
    fileName, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","All Files (*);;Shapefile's (*.shp)", options=options)
    if fileName:
        shape_name = fileName

    shapelayer = QgsVectorLayer(fileName, "project's shapefile", "ogr")
    if not shapelayer:
      self.statusBar().showMessage('shapefile is invalid')

    else:

        urlWithParams = 'url.to.map'

        rlayer = QgsRasterLayer(urlWithParams, 'BaseMap', 'wms')

        if not rlayer.isValid():
            self.statusBar().showMessage('Layer failed to load!')

        QgsProject.instance().addMapLayer(rlayer)
        QgsProject.instance().addMapLayer(shapelayer)

        self.iface.setActiveLayer(shapelayer)

        #self.boxlayer = self.iface.activeLayer()
        #self.canvastry = self.iface.mapCanvas()
        #extent = self.boxlayer.extent()
        #self.canvastry.setExtent(extent)
        #self.box = self.boxlayer.boundingBoxOfSelected()
        #self.iface.mapCanvas().setExtent(self.box)
        #self.iface.mapCanvas().refresh()

        self.iface.zoomToActiveLayer()

commented lines between setActiveLayer() and zoomToActiveLayer() are other tries i've done and haven't worked from what I've read in the forums.

EDIT:

I've realized that iface.zoomToActiveLayer() is working but it's also being called before layers are loaded into Qgis and that's the bug preventing that line to execute correctly.


texts: Error when trying to export PostGIS table to FGDB in QGIS

texts:
I'm trying to export a layer of about 180,000ish points into a file geodatabase.  I have tried it numerous times and continually get this error.

Sometimes, it pushes 30,000 points into the feature class before it fails, sometimes 90,000 and other times 0.  As far as I can tell, the FID (OBJECT ID field) is auto generated, so I'm not sure what to do.  I've made sure that the Libs are all up to-date.


texts: Using Affine Transformation to expand polygons in QGIS

texts:
I have a shape file, and I'd like to grow each feature by 13.7% or 14%. The program crashes every-time I try to use affine transformation.

Any recommendations? I don't have a license for ARCgis.

Link to the shapefile is here
https://www.dropbox.com/sh/frys1pur7g1mts1/ZlfKXM-Go6


texts: Getting attributes for list of coordinates using ArcGIS Desktop?

texts:
I am a beginner with GIS, looking to achieve a relatively simple goal. I have two things:

1) A map with a layer on it as in the following picture:

2) A list of coordinates.

For each pair of coordinates, I wish to get the variable STAT11 for the polygon in which the coordinate pair is located.

Is there a straightforward way to achieve this?


texts:
I wish to clean lines with some attibutes like

order1 (red), order2(green)...

I use v.clean in QGIS for snapping. Is there a way (QGIS, GRASS, Postgis, Spatialite) that snaps the green line on the red line?


texts: Creating Custom Expresion for Field Calculations and the Model Builder

texts:
I am currently exploring Model Builder and I have some trouble setting a custom expression up for certain vector fields of a layer feature collection (points, line and polygons). This is the kind of expression I have in mind:
CASE
  WHEN "COLUMN" is NOT NULL THEN string_to_array(string_to_array( "COLUMN" ,'"')[7]
  ELSE NULL
END

"Column" is of-course all the name of the Column(s) that is (are) selected and are supposed to go through this expression process. So how do I do this?


texts: Arcpy - Apply symbology to Feature and add to data frame

texts:
I need to create a shapefile from a csv, apply symbology from a saved layer, and export the result into an PNG.

My code works up through the shapefile creation part, but it is not applying the symbology and not adding the layer to the active mxd so that I can export into an PNG.

Similar code works within the python window (see second code block) but does not as a standalone script in a custom toolbox.

Any thoughts on how to apply the symbology and add to current data frame?

Standalone Script that does not work:

import os
import arcpy
from arcpy import env

path   = 'O:\\xyz\\abc\\Development\\'
inDir  = path + 'data\\'

try:

#set variables
    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = path
    in_Table = "weekly.csv"
    x_coords = "X_LON"
    y_coords = "Y_LAT"
    out_Layer = "test_points"
    saved_Layer = "data_template.lyr"
    mxd = "template.mxd"
    spRef = "WGS_1984.prj"

#delete old layer so new layer can be called same
    arcpy.Delete_management(out_Layer + ".shp")

#create feature class from csv
    arcpy.MakeXYEventLayer_management(in_Table, x_coords, y_coords,
    out_Layer, spRef)

#convert feature class to shapefile
    arcpy.FeatureClassToShapefile_conversion(out_Layer, path)

#apply symbology to shapefile
    arcpy.ApplySymbologyFromLayer_management(out_Layer, saved_Layer)

#get the data frame
    df = mxd.activeDataFrame

#add the layer to the map at the top
    arcpy.mapping.AddLayer(df, out_Layer, "TOP")

except Exception:
    print(arcpy.GetMessages())

Python Window code that works as expected:

>>> import arcpy
... arcpy.env.overwriteOutput = True
... arcpy.env.workspace = "O:\xyz\abc\Development\data"
... arcpy.MakeXYEventLayer_management("weekly.csv", "X_LON", "Y_LAT",
"test_points", "O:\xyz\abc\Development\WGS_1984.prj")
... arcpy.ApplySymbologyFromLayer_management("test_points",
"O:\xyz\abc\Development\data\data_template.lyr")
... mxd = arcpy.mapping.MapDocument("CURRENT")
... for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
...     if elm.text == "Old Map Title":
...         elm.text = "New Map Title"
... mxd = arcpy.mapping.MapDocument("CURRENT")
... out_png = (r"O:\xyz\abc\Development\exports\weekly.png")
... arcpy.mapping.ExportToPNG(mxd, out_png)
... del mxd

I was able to add the output of the xy event to the dataframe, but I still cant get any symbology.

I need to import symbology from another layer file using the value field. But I am getting an error

symbologyFields = ["VALUE_FIELD", "PCP_WKLY", "PCP_WKLY"]
arcpy.ApplySymbologyFromLayer_management(temp_Shape,
"O:\\XYZ\\ABC\\Development\\data_template.lyr", symbologyFields)
ApplySymbologyFromLayer() takes at most 2 arguments (3 given)


texts: Controlling rule-based labelling using PyQGIS?

texts:
Following on from this question: How to turn on/off all labels of all layers in QGIS, OP mentioned in his comment that he uses rule-based labels. I tried searching online as to how these types of labels could be read and modified but only managed to find this post from lutraconsulting:

  In order to facilitate addition of rule-based labelling, some internal changes were made to the QGIS labelling engine interface. The labelling is now driven by the new class QgsLabelingEngineV2 which may have several label providers associated with it.

Sounds great. However, when reading through the QgsLabelingEngineV2 class, it mentions:

  this class is not a part of public API yet.

Is it currently possible to control rule-based labelling using python?


texts: Adding attribute based on Function in GRASS GIS

texts:
I would like to create a new attribute based on another attribute using a formula in GRASS GIS.

I would like to do multiple 'if' functions embedded example:

if attribute x = 1.2: 1e-6
if attribute x = 2: 5e-6
if attribute x = 3: 1e-5

there would be as many embedded if functions as different values in my vector table. I can do this in MS Access or Excel, but I would like to do this directly in GRASS GIS.


texts: Splitting multiband raster layers using PyQGIS?

texts:
I'm brand new in python.

I'm using QGIS 2.18.3.
I wrote this script that should read all the dual band raster layers in the canvas and should save each band in a separate way, but it doesn't work.
I presume it will be full of errors.

import sys
reload(sys)
sys.setdefaultencoding("utf-8")

# where to save bands
outputDir = "D:\prova"

import os
lddLrs = qgis.utils.iface.legendInterface().layers()

for lyr in lddLrs:
    if (lyr.type()==QgsMapLayer.RasterLayer):
    os.system("gdal_translate -b 1 "+ str(lyr.source()) + " " + outputDir + " / " + str(lyr.name()) + " _VV.tif"))
    qgis.utils.iface.addRasterLayer(str(outputDir + "/" + lyr.name() + ".tif"), str(lyr.name() + "_VV.tif"))
    os.system("gdal_translate -b 2 "+ str(lyr.source()) + " " + outputDir + " / " + str(lyr.name()) + " _VH.tif"))
    qgis.utils.iface.addRasterLayer(str(outputDir + "/" + lyr.name() + ".tif"), str(lyr.name() + "_VH.tif"))


texts:
Possible Duplicate:
  Labeling Geoserver SLD

I have a geoserver 2.1.x installation with SLD stylization. I have used a property to label the polygons which forms a map.

But the issues is the labels are getting repeated as in the figure

Is there any way to prevent this from happening??

What I have done so far ---

I have tried to use the geoserver Vendor option for grouping of polygons with perticular label

  <VendorOption name="group">yes</VendorOption>

but this doesn't help.

I have used a custom solution suggested by someone from the mailing list ..

 <Geometry>
  <ogc:Function name="centroid">
    <ogc:PropertyName>the_geom</ogc:PropertyName>
  </ogc:Function>
 </Geometry>

but removes the multiple labels, but adds some unwanted artifacts into the map, and I want to avoid using that...

I also tried the metatiling functionality by doing this -

tiling:true,
tileorigin: [map.maxExtent.left,map.maxExtent.bottom],

This removes certain multiple labels but not all...

Any other solutions??


texts: Add a certain number of days for a date field

texts:
I have one field for a permit decision date, and then I have another field for 180 days from that permit date. The permit date field has data entered, but the 180 day field I would like to calculate by adding 180 days. It is a feature class in a file GDB, and both fields are in date format (mm/dd/yyyy).

Example: Permit Field date is 7/1/2009, I would like the 180 days field to be 12/28/2009.

I am using ArcGIS 10.2.2 for Desktop.


texts: ESRI ArcMap Topology rules on multi story buildings

texts:
I would like to run some topology rules to find snapping errors in our polygons but I am running in to the problem where we are working on multi story buildings with every polygon regardless of floor is stored in one feature class...

We separate the floors out by adding layers with definition queries...

From what I can see I can only create topology rules (like "boundaries must be covered by") for a feature class and not a queried layer...

In the screen shot provided the grey polygon is not snapped correctly to the North West most corner of the only polygon completely in frame of the screenshot... Running a boundary covered by will easily spot this error but only if I disassemble the feature class so that each floor is on its own feature class... Needless to say the more floors involved the more tedious this becomes...

Not to mention that I must then reassemble the separated feature classes back into one as this is how the deliverable is required to be...

There is one feature class for the room polygons and one for the CAD line work...

There must be an easier way to find gaps like this without separating the feature classes to run the topology then putting the separated classes back together to produce the deliverable...

Any help would be greatly appreciated...

Please ask if you need further clarification...


texts: How to avoid 'join features by location' for polygon to polygon creating extra areas

texts: I am trying to work out which large polygons contain smaller ones within them in QGIS. I have a set of smaller features already defined (dark green below). However, for those smaller areas which sit on the border, using the 'join features by location' tool results in neighbouring geographies also being selected (light green). I have ensured all layers are in the same projection. Can anyone help? AM I using the right tool, or should I look at dissolve or some other tool to help?


texts: Why filtering in SLD file doesn't work when applied to shapefiles?

texts:
I have downloaded shapefiles from OpenStreetMap and I want to give styling using SLD files so that the map looks like OpenStreetMap.  The GIS tool I use is MapServer. I got some SLDs from the following link:

https://github.com/mitchelljj/openstreetmap-sld

But the problem is that when filtering is applied to give different styles to motorway, trunk roads, streets etc. (in case of roads), it doesn't work. Without filtering it will work, but it will give same styling to all kinds of roads (and obviously the map won't look like OpenStreetMap). The below is an example of filter that doesn't work:

 <ogc:Filter>
    <ogc:Or>
      <ogc:PropertyIsEqualTo>
    <ogc:PropertyName>highway</ogc:PropertyName>
    <ogc:Literal>motorway</ogc:Literal>
      </ogc:PropertyIsEqualTo>
      <ogc:PropertyIsEqualTo>
    <ogc:PropertyName>highway</ogc:PropertyName>
    <ogc:Literal>trunk</ogc:Literal>
      </ogc:PropertyIsEqualTo>
    </ogc:Or>
  </ogc:Filter>

Can anybody throw some light on this?


texts: Align one polygon boundary to another boundary

texts:
As visualized in the picture as an example, two polygons should be aligned to each other. The boundaries of the green polygon should not be changed. The blue polygon may therefore only be adapted to the boundary of the green polygon.
The aim is to eliminate the gaps and overlaps.

I already tried Align under ArcMap. Unfortunately, not all overlaps and gaps are removed, because the adjustment is probably made on the basis of the vertices.
The manual search for errors via topology tools would be too time-consuming, since there are many boundary problems.


texts: ArcGIS Field Calculator Python numbering rows of fishnet

texts:
I have a grid of 100*100 cells. I want to add to each cell a number representing the row it is in (like in excel). I added a field and want try to solve that with field calculator:

The code is something like this:

def test( OBJECTID ):

 if OBJECTID > 0 and OBJECTID < 101:
     return 1

 elif OBJECTID > 100 and OBJECTID < 201:
     return 2

 elif OBJECTID > 200 and OBJECTID < 301:
     return 3

 elif OBJECTID > 300 and OBJECTID < 401:
     return 4

 elif OBJECTID > 400 and OBJECTID < 501:
     return 5

 elif  OBJECTID > 500 and OBJECTID < 601:
     return 6

 elif  OBJECTID > 600 and OBJECTID < 701:
     return 7

This works good, however I want to automate it a little bit. The return value shall automatically be counted to the next number.

I tried to solve this with autoincrement. Though it adds a number per cell and not per row. Any ideas how to solve that?

Meanwhile I figured, that the cells of each row have obviously the same coordinates and with the help of another guy I have now this code. However I receive only NULL values for the fields. Any ideas what is wrong

def test( X_KORD_ED ):
    var = 0
    old_i = object()

    for i in X_KORD_ED:
        if i != old_i:
            var += 1
            old_i = i
        yield i, var


texts: Intermediate data not deleted properly after running model in ModelBuilder after Windows 10 update?

texts:
yesterday my Windows 10 got update and finally, the Active X warning that has occurred for more than a year now vanished. Instead, I ran into another problem that never happened to me before and that might be due to the update I am guessing.

In ModelBuilder I built a model that generates a shapefile from some input data, runs through a number of analyses, and appends the fields of this shapefile to a master shapefile. Now, this tool works fine on its own. However, at the very end, it should delete the intermediate datasets that are created (namely the main shapefile that is later appended to the master). Every time the tool ends, the name of the file still shows up in ArcCatalog but it cannot be added to the TOC - it is broken. It is as if it was deleted "half" but not properly. In fact the file cannot be seen in The Windows File Explorer - and when I refresh the TOC view the file normally goes away.

This is not a huge problem until I iterate through the tool with different input data. The first run through always works fine, but once the second run starts, I get the error:

  000871 : : Unable to delete the output .

As I said, I never had this before the latest Win10 update - so I am just wondering if anyone else ran into this (and found a solution to this?). I have not tried rolling back the Win10 update (in fact, I would not know how to do this either).


texts: How to specify the polygon in which to generate points when using the Kenv.csr() function in R?

texts:
I would like to use the Kenv.csr() function, out of the splancs package, which  computes envelope of Khat from simulations of complete spatial randomness. My main issue is with one of the parameters: poly. It sets the polygon in which to generate the points.

I do not understand which format is accepted by that parameter. When I ran the code example which comes with the help documentation, the polygon is actually an area defined by a number of adjacent points. I would like to use a polygon shapefile (SpatialPolygonDataFrame) that I have at my disposal.

Is there a way to convert/reshape the polygon I have to a format that can be fed into the Kenv.csr() function?


texts:
For geocoding we are using the Nominatim

from the below URL
    http://nominatim.openstreetmap.org/
But i need to implement suggestion on the address, do OSM has this service like Google and ESRI

is their any other method to implement?


texts: How to access .shp file from local computer or some other server

texts:
Below is the code in which we can access a feature layer from ArcGIS sample server.

queryTask = new esri.arcgis.gmaps.QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3");

But I want to access my own .shp file residing on my local computer or on another server, e.g this..

queryTask = new esri.arcgis.gmaps.QueryTask("http://172.20.100.12/Demo/Resources/ABC.shp");

In this case, queryTask does not return featureSet and so .shp file could not display on Map.

Where is the problem and how can I fix it?


texts:
I work with Sentinel-2 images (Level-1C products (top-of-atmosphere reflectances)). I would like to know why some of the images do have this blue(?) undertone/color cast. I think those images are from the winter months.

Is there another explanation than different light conditions?

I would like to know the possible reasons for this effect.

Image as expected:

Color cast:


texts: How to use the transformer KMLRegionSetter ? (Python/FME)

texts:
I use Python and FME.
I would like to use a transformer "KMLRegionSetter_2" for KML file.
I use a fmi file for the transformation.

reader=FMEReader("OGCKML",{'USER_PIPELINE':"C:\\arcfactory.fmi"})
                    reader.open("repertoryofkml","") ***Is it correct ?***
                    log.log("Reader opened")

                    writer=FMEWriter("OGCKML")
                    writer.open(repertoryofkml+"_region.kml")
                    schemaFeature=FMEFeature()
                    log.log("Copying schema features")
                    while reader.readSchema(schemaFeature):
                        log.logFeature(schemaFeature)
                        writer.addSchema(schemaFeature)
                    feature=FMEFeature()
                    while reader.read(feature):
                        log.logFeature(feature)
                        writer.write(feature)
                    reader.close()
                    writer.close()
                    log.log("Translation completed.")

The arcfactory is

    DEFAULT_MACRO WB_CURRENT_CONTEXT
# -------------------------------------------------------------------------
# The region extent is set to be
# calculated based on the extent
#  of incoming features.
Tcl2 proc KMLRegionSetter_2_bounding_box_setter { minx maxx miny maxy} { \
    if { [string compare {Yes} {Yes}]==0 } {                           \
      global FME_CoordSys;                                             \
      if { [string length $FME_CoordSys]>0 } {                         \
         FME_Execute Bounds kml_latlonaltbox_west kml_latlonaltbox_east kml_latlonaltbox_south kml_latlonaltbox_north; \
          FME_Execute Reproject \"$FME_CoordSys\" LL84 kml_latlonaltbox_west kml_latlonaltbox_south; \
          FME_Execute Reproject \"$FME_CoordSys\" LL84 kml_latlonaltbox_east kml_latlonaltbox_north; \
       } else {                                                        \
          FME_LogMessage fme_warn \"KMLRegionSetter: A valid coordinate system is required for calculating the region\'s bounding box\"; \
       }                                                               \
    } else {                                                           \
       FME_SetAttribute kml_latlonaltbox_west \"$minx\";               \
       FME_SetAttribute kml_latlonaltbox_east \"$maxx\";               \
       FME_SetAttribute kml_latlonaltbox_south \"$miny\";              \
       FME_SetAttribute kml_latlonaltbox_north \"$maxy\";              \
    }                                                                  \
}

FACTORY_DEF * TeeFactory                                               \
   FACTORY_NAME KMLRegionSetter_2                                      \
   INPUT  FEATURE_TYPE BoundingBoxAccumulator_BOUNDING_BOX             \
   OUTPUT FEATURE_TYPE KMLRegionSetter_2_OUTPUT                        \
           kml_lod_min_lod_pixels "1500"                               \
            kml_lod_max_lod_pixels "-1"                                \
            kml_lod_min_fade_extent  "0"                               \
            kml_lod_max_fade_extent "0"                                \
            @Log("Before")                                             \
        @Tcl2("KMLRegionSetter_2_bounding_box_setter {<Unused>} {<Unused>} {<Unused>} {<Unused>} ")
        @Log("After")                                              \

Is there a way I can find out if the product is correct?


texts: I 'm working on GDAL C++. But I have some trouble to change GDALDataset property. I have converted "jpg" to "bmp" an image. But I want to do read an image(jpg) to gdaldataset then change dataset properties(gdaldataset) to "bmp". But I don't want to create a ".bmp" file any pc storage. Only change Gdaldataset properties to ("bmp").


texts: QGIS 3.4.4 edit rendering styles for outputs - styles not loading

texts:
I have created a processing model in version 3.4.4 and I want the shapefile outputs from the model to load in a chosen style. I have saved the style files and used the  'edit rendering styles for outputs' to point to the relevant style files. However, when running the model they do not load with the correct styles. They load with a randomly selected style. I previously used a similar model in version 2.14 and the styles loaded correctly.

Is this a bug in 3.4?


texts: Keyboard shortcut for GPS data capture in QGIS

texts:
I would like to setup keyboard shortcuts for GPS data capture with QGIS.

Using GPS Information dialog box, I could use Mouse-Left-Click to "Add feature" and "Add track point", but I would like to assign keyboard shortcuts for them so that I can use a programmable Mouse.

Settings --> Configure Shortcuts lists only few commands

Is there a way I can call the API behind that and assign to a shortcut key?


texts: How to combine two polyline shapefile together

texts:
Here is my question

Two shapefile:
* A: represent the outer boundary of the city area
* B: represent the inner boundaries of the city divisions.

I want to
* Combine these two shapefile
* Transform it into polygons which represent each divisions.

But I have failed to combine two layer using vector -> Data manager tool -> merge or dissolve with stats(the inner boundaries are consist of 48 line with the same User ID: 0)

Here is my two shapefiles:
A was in black color , B is in green color.

http://i4.tietuku.com/43e65f8e7c48c508.png

I'm using QGIS 2.8.3

Update

I have already figured it out using MMQGIS.
But I don't know how to transform it into polygons.
If you are interested, please check this question I have asked and offer some valuable advices.

Update 2 2016-02-27

First step: Make two polylines file into Layer C using merge layer in MMQGIS

http://i11.tietuku.com/f2240d86f01a885b.png

The figure above seems to be right.

Second step: Using Vector -> Geometry Tools -> Lines to Polygons on Layer C as the accepted answer.

http://i11.tietuku.com/02ec8227504ea5a7.png

The result shown on the figure doesn't show the correct boundaries.


texts: How can I generate shapefile from Google Earth

texts: I am new to ArcMap 10.5. I want to generate a shapefile of an area of interest from Google Earth. I have checked some website in Google, but I did not understand some steps.


texts: Fastest way to query whether a multipolygon contains a single point

texts:
I have a multipolygon of geography type (multi_bounds) and a point. I'm trying to figure out the fastest way to query whether the multipolygon contains the point. In this case if the point is part of the boundary it should still return true.

I've tried CoveredBy:

WHERE ST_CoveredBy(ST_SetSRID(ST_MakePoint(:long, :lat), 4326),
      multi_bounds::geometry)

Where :long and :lat are arguments provided by yesql.

And I've tried contains:

WHERE ST_Contains(multi_bounds::geometry,
      ST_SetSRID(ST_MakePoint(:long, :lat), 4326))

I don't see a noticeable difference and I'm wondering what the best practice is here.

I did try ST_CoveredBy without casting multi_bounds to geometry but I couldn't get past an error:

org.postgresql.util.PSQLException: ERROR: BOOM! Could not generate outside point!


texts: Mac OS 10.7 QGIS 1.8 Desktop Install Problem

texts: I've downloaded QGIS-1.8.0-2.dmg and the required GDAL Complete 1.9 framework package and GSL framework.  The frameworks are installed; however, when I try to start the installation of QGIS-1.8.0-2.dmg, I receive this warning: "...disk images couldn't be opened", reason: not recognized.


texts: Max Number of Feature Selection in ArcGIS?

texts: What are the limitations on the maximum number of features that you can select in ArcGIS?


texts: Drawing a line to a point - style in QGIS

texts:
I need to create a style in QGIS in which the line is moved away from the second line by 2 units, but their ends merge at one point. I created 3 geometry generators - 3 lines.
At the ends of the line:

 make_line(
project(
    start_point(  $geometry ),
    2/cos(radians(30)), radians(60)+  azimuth(  make_point(  $x_at( 0), $y_at( 0)),
    make_point(  $x_at( 1), $y_at( 1)))),  start_point(  $geometry ))

 make_line(
project(
    start_point(  $geometry ),
    2/cos(radians(30)), radians(60)+  azimuth(  make_point(  $x_at( 0), $y_at( 0)),
    make_point(  $x_at( 1), $y_at( 1)))),  start_point(  $geometry ))

and offset line:

 difference(
 difference(
     $geometry ,  buffer(  end_point(  $geometry ), 2*tan(radians(30)))),
     buffer(  start_point(  $geometry ), 2*tan(radians(30))))

It looks ok, but there are also errors eg when the last episode is shorter than the offset

Is there any way that the style will always work correctly and that the line will always be tightened to the starting point?


texts: Should only a "bare-earth" DEM be used when calculating CTI?

texts: I have 50-meter DTM and 20-meter DSM data available to choose from to use for calculating a compound topographic index (CTI). While the 20-meter resolution is more attractive, logic tells me that when calculating the compound topographic index (CTI), one should be using a bare-earth elevation model (DTM), not a surface elevation model (DSM). If flow direction and accumulation are being calculated, using a surface model would not provide a good representation of earth surface hydrology/routing; however, I see many examples where SRTM or other DSMs are used as the input elevation surface. Is this a valid approach? Your comments and any references are appreciated.


texts:
I have integrated leaflet cluster for maps. But in my scenario data dynamically comes from mqtt, So markers count, their icon & popup content is changed all the times when new data came.

This is code integrated which works fine

ngOnInit() {
   this.cluster = L.markerClusterGroup();
   initializeMap();
   // Some methd for getting past data on page initiation
   callback().subscribe(mapdata => {
      this.locations = mapdata;
      renderPoints();
   });

   // Some methd for getting data from mqtt when comes
   mqttcallback().subscribe(mapdata => {
      this.locations = mapdata;
      renderPoints();
   });

}

initializeMap() {
    const self = this;
    this.map = L.map('map').setView(L.latLng(LAT, LON), 5);
    L.tileLayer(
        'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
        maxZoom: 18,
    }).addTo(this.map);
  }

renderPoints () {
    let myIcon =  L.icon( { iconUrl: this.defaultIcon, shadowUrl: this.defaultIcon } );
    this.cluster.clearLayers();
    for (let i = 0; i < this.locations.length; i++) {
      const a = this.locations[i];
      const title = a.location;
      if ( a.icon !== null ) {
        myIcon =  L.icon( { iconUrl: a.icon, shadowUrl: a.icon } );
      }
      const marker = L.marker(new L.LatLng(a.lat, a.lng), {icon: myIcon, title: title });
      let info = '';
      info += '

' + title;
      if (typeof a.address !== 'undefined') {
        info += ('
' + a.address);
      }

      info += '

';
      if ( a.items ) {
        for (let j = 0; j < a.items.length; j++ ) {
          if ( a.items[j].name ) {
            info +='
';
            info += '' + a.items[j].name + ': ' + a.items[j].time + '
';
            info+='
';
          }
        }
      }
      marker.bindPopup(L.popup({maxHeight: 300}).setContent(info));
      this.cluster.addLayer(marker);
    }

    this.map.addLayer(this.cluster);
  }

My issue is that when new data comes, renderPoints method comes with updated locations. Then map is redrawn by current code, So all open popup closed down. As data is frequently comes, I am unable to correctly analyse popup content due to popup close down.

I searched for some update only functionality on other questions, but solutions look like will regenerate marker which failed my case.

How to update marker popup content & icon for leaflet cluster plugin without closing popup?


texts: How to FeatureEditorGrid configure and use in FeatureEditor

texts:
I am new user of OpenGeo suite. I want to configure FeatureEditorGrid plugin to change the column header to display name. My basic requirement is to customize column label like my table column is "pop" and want to display "Population" in FeatureEditor popup.

I have refer this question modify the GetFeatureInfo popup. So is it possible to modify FeatureEditor popup. I have tried like this:-

Include plugin :-

 * @require plugins/FeatureEditor.js
 * @require plugins/FeatureEditorGrid.js

And add reference in Tools section :-

{
    ptype: "gxp_editorgrid"
    ,propertyNames: {"project_id_fk": "Project ID",  "output_code": "Output Code"}
}

But it gives error, I don't know what I am missing.

Error: Could not create tool plugin with ptype: gxp_editorgrid
attributes = feature.attributes;

Is it possible to modify Featureedit popup??

Any suggestion will always welcome.


texts: What's the difference between "route" and "track" in OruxMaps?

texts:
What's the difference between "route" and "track" in terms of navigation? Is there a conceptual difference or only a technical one?

For example OruxMaps treats the two terms differently:
 (source)


texts: PostGIS add polygon in meters around a point (lat,long)

texts:
I have a point in my PostGIS database that is put in using the lat/long using srid: 4326. The point represents a car driving, now I want to add a polygon of the cars shape around this point and update. I have the car's bounding box in meters, but I'm not sure the best way of adding this information to the database.

I could convert the bounding box into 4 points for each corner and convert those points into Lat/Long but I'm not sure if that's efficient.

I also saw the ST_Translate but not sure how that work between meters and Lat/Long.

Don't worry about rotation at this point.


texts: Detect connections along shapefile in QGIS?

texts:
I have a set of polylines and a set of points that lie along or very near to the polylines, and I need a way to measure which points are connected to each other along the polylines, and what the distances between each point are. Having the results in a neat grid would be nice, but I'll take what I can get. I have the vague idea that I need to use GRASS or SEXTANTE, but I don't know where to go from there (then again, I didn't know what GIS was a few months ago). Also, I have access to ArcGIS, but I'd rather use QGIS if possible.

To clarify the data a bit, my polylines are waterways in the Talladega National Forest, and the points are beaver ponds that myself and my research professor sampled. The points are either on or very close to a waterway, close enough that Road Graph can use them. I also have an area estimate polygon for each point, if direct connection is needed. I know that some of the points lie on different waterways from the others, but I need an accurate and repeatable way to find those connections.


texts: Exception handling in ArcGIS .NET custom geoprocessing tools?

texts:
I'm working on a set of C# GP tools for use both in Desktop and Server 10.1.

The only soup-to-nuts treatment of writing geoprocessing tools in .NET appears to be Building a custom geoprocessing function tool. It does not cover what to do to handle exceptions.

I see a few possibilities and want feedback.

In my tool's Execute() method, I can put my code in a try block, and in the catch I can augment the Messages by IGPMessages message.AddError(errorcode, errormessage).
I can include among my tool's output parameters an error code parameter and an error message parameter. In the Execute() method's catch block, I populate these parameters if an exception occurs. Then they are available to the client in its Result object.
do both.

(1) While this seems sensible for Desktop use, it seems to suffer a problem if in Server the GP service is configured not to return messages to the client.

(2) seems to suffer a problem in that I don't know of other tools that use this approach.

I want to make sure that the tool works correctly with the ArcGIS Silverlight API Geoprocessor task, which raises a Failed event if a task fails. What do I implement in .NET to make the task 'fail' correctly and gracefully?


texts: 'Add GRASS vector layer' button in QGIS 2.16.2 with GRASS 7.0.4?

texts:
I could not find 'Add GRASS vector layer' button in QGis 2.16.2 with GRASS 7.0.4?
Can someone help?


texts: ArcGIS .Net SDK publish shapefile to ArcGIS Online

texts:
I am quite new with ArcGIS Online and their .Net SDK.
I am trying to load shapefile into my ArcGIS online account using .Net SDK.
On the ESRI tutorial portal, there is 0 information about it, all is focused around WPF technology.

From what I heard, the Esri .Net SDK have complete integration with ArcGIS Online portal, but I cannot find any documentation of how to use this SDK with Online server. Did anyone manage to actually do it?


texts: Error Exporting MapInfo file using python OGR

texts:
I am using OGR to open a layer, add a filter and then save the results as a separate MapInfo TAB file. Upon trying to save the layer, I get the following error message:

ERROR 5: CreateFeature() failed: invalid feature id 0

Using the same procedure to create a CSV or ESRI Shp works as expected.

My code is as follows:

result = dataSource.ExecuteSQL("select * from '"+ self.inputname +"' WHERE not ST_IsValid(geometry)", dialect = "SQLITE")

if ".shp" in self.outputpath:
    outdrv = ogr.GetDriverByName("ESRI Shapefile")
elif ".csv" in self.outputpath:
    outdrv = ogr.GetDriverByName("CSV")
elif ".tab" in self.outputpath:
    outdrv = ogr.GetDriverByName("MapInfo File")

filtered = outdrv.CreateDataSource (self.outputpath)
filter_layer = filtered.CopyLayer(result, 'filtered')
QMessageBox.information(self, "Process complete", "Process complete! " + str(resultpolygons) + " error(s) detected.")

Whilst attempting to save a layer from an MSSQL server to MapInfo File, I encountered the same issue. It seems as though the OGR python bindings have issues writing the new MapInfo Files.


texts:
I worked with ArcGIS for Desktop 10.3.1 to do some geomorphologic analysis, which resulted in a few raster layers (all in GeoTIFF format).

I want to publish them to ArcGIS online, in order to make a Web App for presenting those maps.

I uploaded the GeoTIFF rasters as a Tile Package (Create Map Tile Package function) and used Publish to convert it to a Tile Layer (online).
All good so far.

The problem is I can't choose which raster to display in an online map. It only shows me the one which had its check mark on, when I created the Tile Package in ArcGIS for Desktop... I can't choose another one from the list, in order to make it visible (see the picture).

Am I doing something wrong or is it a known limitation of ArcGIS Online?

I am using an Esri Developer account on Microsoft Edge 38.14393.0.0, Windows 10 Home 64 bit.


texts: How to display missing objects in QGIS 2.8.2 cartogram?

texts:
I've just created cartogram using styles/graduated symbol. But there are some missing elements on the map. Objects without data in attribute table are not present on the map (NULL in corresponding column in Attibute table). I was able to show such objects on the map using 0.0-0.0 interval in previous versions of QGIS. It does nothing now, just showing objects with 0 value but NULL objects are still missing. How to display them to make my map complete?

  Grey countries with 0 value, white spaces (e.g. South Sudan) while
  NULL is in the column.


texts: Drawing arcs/curved line/arrows with Leaflet using method other than arc.js?

texts:
I've been trying to find a good way to draw arcs or even arrows dynamically with Leaflet.js, but I haven't come up with much.

I tried arc.js, however I was having problems with that approach, and I do not want to do it that way.

What else can I do to draw arcs in leaflet?

I've looked all over but I'm new to leaflet and can't find anything that would be of help.


texts:
The geographical information data that INEGI (part of the Mexico's goverment) provides are in the following coordinate system (or is projection?)

Lambert Conformal Conic, double standard parallel
Units: Meter
Coordinate System Type:
Datum: World Geodetic System of 1984.
False Origin
Northing: 0.0000
Easting: 2500000.000
Projection Parameters
Origin latitude: 12° 0’ 0.0’’
Origin longitude: -102° 0’ 0.0’’
Northern standard parallel: 29° 30’ 0.0’’
Southern standard parallel: 17° 30’ 0.0’’

I already put the information in the PostGIS/PostgreSQL database, now, How I can change the projection/coordinate system to that projection? Could you provide the code for doing it? And How I can change it to the coordinate system that Google use?


texts: Error assessment of calculation done using unprojected vs. projected data

texts:
This question builds off of the one with the subject line "Calculating Flow Direction and Delineating Basins from Projected vs. Unprojected Data.":
Calculating Flow Direction and Delineating Basins from Projected vs. Unprojected DEM Data

This is an entirely separate question, however, as the aforementioned question has established that there are problems with using algorithms (e.g., ArcGIS Flow Direction) that assume Euclidean distance on data in a spherical/unprpojected geographic coordinate system.

We know that map projections are sort of like taking an orange peel and attempting to flatten it out on a desk - you will have some error inherently introduced by the map projection. But, it seems that the benefits of projecting offset any error introduced, particularly when you're running calculations that assume a Cartesian/projected planar surface. In this case, the algorithm I'm interested in is the ArcGIS Flow Direction algorithm which does assume that your data are projected (and this is the assumption taken by most applications based on my research) as it uses a Euclidean approach for calculating distance.

My question is: how could one quantify the error that might be introduced with calculating flow direction in a given study area using unprojected DEM data (DEM data in a geographic coordinate system) vs. projected data (DEM data in an appropriate projection such as a UTM or something conformal)?

Granted, you can derive a flow direction raster using unprojected and then the same DEM data projected. But what then? Since our goal is to model the earth's surface as accurately as we can (and we're not addressing any errors that may be introduced in the process of creating the original DEM etc. - those are a constant as far as I'm concerned)....do we just assume the flow direction data derived from the projected DEM is better, and then compare the individual cell values of the two rasters to identify which cells have different directional values (in the context of the normal D-8 model)? I guess to do this then you'd have to take the flow direction raster derived from unprojected data, and then apply the same projection used with the projected flow direction raster.

What would make the most sense, and what should the unprojected DEM be compared to as a benchmark of accuracy?

Getting into the nitty details of the mathematical equations might, to those that understand it, give you proof at the ground level and be enough for some, but that as well as something that could convey the error to someone that does not have an in-depth understanding of the math but may just know enough geography/GIS to be dangerous would be great (ideally both levels would be good which would resonate with the hardcore geography geeks and the average GIS dabbler). For the higher level folks, saying that the proof is in the math possibly leaves it somewhat open for argument - I'm looking for something more tangible (e.g., akin to attaching a dollar figure to some sort of inefficiency in government).

Any thoughts or ideas on how one might quantify this would be greatly appreciated.

Tom


texts: Geoprocessing ArcGIS 10: Sending lat/long/elevation data to a geoprocessing service

texts:
I have a silverlight application that allows the user to select points to make a polyline.  The polyline is densified per the users input (say every two feet). The new points are sent to an esri elevation service to get the elevations at those points.  I have the lat/long/elevation in a c# dictionary with a incremented number as the key.

What is the best way to send this over to a geoprocessing service and what should I have my gp service take?  I want to send something lightweight like json but I haven't fused with json much (except for trying to deserialize it with c# and failing so I just parsed the return string myself using c#).  If I call the gp service (similar to how my code is calling the densify and elevation services, what does the gp service need to take?  Are there alternatives?

What we will be doing is finding the average percent slope across the polyine.  Once the average percent slope is found, we need to generate a polyline shapefile or feature class with the associated percent slope attributed and we'll send this over to autocad folks.

EDIT:  Here's my code..!
    //This is defined as a constant string at the top of the Densify class
    Densify.SUMBITGEOMETRY = "http://gis.mustangeng.com/ArcGIS/rest/services/Geoprocessing/gpServiceTest/GPServer/gpService/submitJob?Input=";

string dog = string.Join(",", colorList.ToArray());
//String.Join(",", dictElevat.Keys.Select(o => o.ToString()).ToArray());
//HtmlPage.Window.Alert(string.Format("Count: {0}", dog));
HtmlPage.Window.Alert(String.Join(",", dictElevat.Keys.Select(o => o.ToString()).ToArray()));
//UriBuilder builder1 = new UriBuilder(Densify.SUBMITGEOMETRY);
//builder1.Query = string.Format(String.Join(",", dictElevat.Keys.Select(o => o.ToString()).ToArray()));
WebClient webClient1 = new WebClient();
webClient1.Headers["Content-Type"] = "text/plain";
Uri serviceUri = new Uri(Densify.SUBMITGEOMETRY);
string s = String.Join(",", dictElevat.Keys.Select(o => o.ToString()).ToArray());
webClient1.UploadStringAsync(serviceUri, "POST", s);
HtmlPage.Window.Alert(serviceUri.ToString());


texts: Using Raster calculator with ModelBuilder?

texts:
I am making a model in ModelBuilder and there is a problem with Raster calculator result. I have to rasters with 0 and 1 values, I want to know where do they intersect and make a new raster with value 1 in that places. In Raster calculator I put the expresion like: raster1 * raster2. The problem is that it returns empty raster (with 0 values only), but when I look at rasters I can clearly tell that they do intersect.

Does anyone know what the problem can be?


texts: Over-calculation of area due to parcels occupying same space

texts:
I'm trying to get the total acreage of different parcels by land use, and unfortunately I keep getting a total of ~15000 acres instead of ~12000 because it's over-calculating the area where there are condos or other multi-units (two condos sharing the same parcel area are being counted twice instead of once). It's basically calculating the total acreage as if each condo were occupying its own land when in fact they're both occupying the same space.

How can I calculate the total acreage only on the ground level without double counting? I don't think I can combine the attributes because I would lose data on how many occupants there are.


texts: Deleting suffix from feature class name using ArcPy?

texts:
I have to edit the Name of the feature classes in my databank by deleting the Suffix part called "_AAA_VV". I am not pro in ArcPy but prepared something which does not work.

Can you help to find my mistake?

import arcpy, os
database = r'C:...\Data_test.gdb'

try:
for dataset in datasets:
    arcpy.env.workspace = os.path.join(database,dataset)
    features = arcpy.ListFeatureClasses()
    for feature in features:
     #  feature.replace('_AAA_VV,'')
        feature.split('_AAA_VV,1)[0]

except Exception as e:
print("Found an error - {0}".format(e))


texts: SAGA Raster Calculator in QGIS Algorithm script produces 'NoneType' object has no attribute 'crs'

texts:
I would like to produce a new temporary raster after a calculation with the SAGA raster calculator using a custom python algorithm script. This is my code so far:

##MaechtigkeitunterhalbeinerHoehe=name
##Input_Raster=raster
##Hoehe=string 28.65
##Rasterout=output raster
##KoordS=crs

outputs_SAGARASTERCALCULATOR_1=processing.runalg('saga:rastercalculator', Input_Raster,[],'a - Hoehe',0,False,7,Rasterout)

It produces the error in the title.
The log shows this:

  Uncaught error while executing algorithm
              Traceback (most recent call last):
                File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 205, in execute
                  self.convertUnsupportedFormats(progress)
                File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 296, in convertUnsupportedFormats
                  crsid = layer.crs().authid()
              AttributeError: 'NoneType' object has no attribute 'crs'

  2019-02-08T14:12:03    1   There were errors executing the algorithm.
  2019-02-08T14:12:39 2   Error loading result layer:
              Traceback (most recent call last):
                File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\gui\Postprocessing.py", line 77, in handleAlgorithmResults
                  isRaster)
                File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\tools\dataobjects.py", line 186, in load
                  + '\nCheck the processing framework log to look for errors')
              RuntimeError: Could not load layer: C:\Users\saku\AppData\Local\Temp\processing2bd0c9ce76084b92b2e46ef30e6e930d\e5a1e836014f4fafb330f42ca6e8da80\Rasterout.tif
              Check the processing framework log to look for errors

I have checked other threads kind of regarding this topic and found out that this error usually means that SAGA produces an emtpy file, in part because of spaces in the file name or path. I checked my error log and noch such things occured.
An interesting fact is when using the SAGA Raster Calculator from the Toolbox and using the same parameters (except Hoehe which would simply be a number) and it create a temporary tif/raster layer no problem.

How can I solve this error? Why is it working when solely using the tool from the toolbox, but not when implemented in a script?

Even when trying to save the Rasterout.tif to a different directory I get this error. This is also not what I want by the way. I need to use the temporary raster as an input for another calculation and only want to output/write and load the finished final raster layer.

I hope I described my problem clear enough.


texts: Identifying duplicate features by comparing two layers in QGIS?

texts:
We have around 60,000 separate shp - tab files. We have to move all those into a gdb. While doing so, at times the data are getting duplicated as shown in the fig. Lyr_1 - gdb layer. Lyr_2 - individual shp file. We have to identify the duplicates of Lyr_2 in Lyr_1(gdb) and give unique id's to that features in Lyr_2.

Curretnly, we are using Xtools pro for ArcGIS -> Find duplicates option to identify the duplicates. ArcGIS -> Select by location -> are identical to source feature layers  is not working. We dont have license to Data Reviewer & Find identical tool.

Is there a way to do this in QGIS ?

Even in QGIS, tried with Spatial query -> features equals. But didn't work


texts:
I am experiencing some unexpected results when trying to use MapServer to create images with a polar projection.  I am using the standard BlueMarble tif as the base layer (in wgs84 GCS) and am trying to reproject image into WGS 84 / UPS North (WKID 32661).  The polar region seems to be getting 'clipped' out of the image.

The attached image was created using the mapfile below along with the shp2img utility included with ms4w.

Can anyone explain whats going on here?

--Mapfile
MAP

NAME BMNG
STATUS ON
SIZE 800 500
IMAGETYPE PNG
UNITS METERS
EXTENT -28567783.609 -28567757.697 32567757.697 32567783.609
IMAGECOLOR 255 255 255
CONFIG "PROJ_LIB" "C:/DevTools/ms4w/proj/nad"
PROJECTION
    "proj=stere"
    "lat_0=90"
    "lat_ts=90"
    "lon_0=0"
    "k=0.994"
    "x_0=2000000"
    "y_0=2000000"
    "ellps=WGS84"
    "datum=WGS84"
    "units=m"
    "no_defs"
END

LAYER
    NAME 'BMNG_UPSN'
    TYPE RASTER
    STATUS DEFAULT
    DATA 'D:\stuff\bmng\bluemarble.tif'
    PROJECTION
        "init=epsg:4326"
    END
END #LAYER

END #MAP


texts: Why does DataGridView data not update for ArcMap add-in?

texts:
I have created a dockwindow（name:FrmWellConfig) with a datagridview(datagridview1) control in a new ArcMap add-in project.

I then bind the data:

datagridview1.datasouce=wellconfig.tables[wellcolunms];

Why does the datagridview not update?

Code behind tool：

FrmWellConfig frm = new FrmWellConfig(SettingWorkspace.AppBasePath, wellConfigFileName, frmSave.MapType, SettingWorkspace.workspace1.CnnStr_InfoDB);

Code behind FrmWellconfig(wellConfig1 is a dataset)：

 /// <summary>
/// Designer class of the dockable window add-in. It contains user interfaces that
/// make up the dockable window.
/// </summary>
public partial class FrmWellConfig : UserControl
{
    private string cnnStr_OLEDB;
    private bool nFlag = false;
    public static string appBasePath;
    private string wellConfigFileName = "";
    sylMapType mapType;

    public sylMapType MapType
    {
        get { return mapType; }
    }
    public WellConfig WellConfigData
    {
        get { return wellConfig1; }
    }

    public FrmWellConfig(object hook)
    {
        InitializeComponent();
        this.Hook = hook;
        this.dataGridView1.DataError += delegate(object sender, DataGridViewDataErrorEventArgs e) { };
    }

    public FrmWellConfig(string AppBasePath, string WellConfigFileName, sylMapType _mapType, string CnnStr_OLEDB)
    {

        InitializeComponent();
        nFlag = true;
        frmType = sylChildFormType.DialogForm;
        cnnStr_OLEDB = CnnStr_OLEDB;
        appBasePath = AppBasePath;
        mapType = _mapType;
        dataGridView1.Columns[0].Visible = false;
        wellConfigFileName = WellConfigFileName;
        wellConfig1.ReadXml(wellConfigFileName);
    }

    /// <summary>
    /// Host object of the dockable window
    /// </summary>
    private object Hook
    {
        get;
        set;
    }

    /// <summary>
    /// Implementation class of the dockable window add-in. It is responsible for
    /// creating and disposing the user interface class of the dockable window.
    /// </summary>
    public class AddinImpl : ESRI.ArcGIS.Desktop.AddIns.DockableWindow
    {
        private FrmWellConfig m_windowUI;

        public AddinImpl()
        {
        }

        protected override IntPtr OnCreateChild()
        {
            m_windowUI = new FrmWellConfig(this.Hook);
            return m_windowUI.Handle;
        }

        protected override void Dispose(bool disposing)
        {
            if (m_windowUI != null)
                m_windowUI.Dispose(disposing);

            base.Dispose(disposing);
        }

    }


texts:
I am trying to create an indoor map with relative coordinates where the bottom left hand corner of the map is (0, 0), and the CRS is UTM, so the distance between coordinates is in meters.

Previously I have made indoor maps a little differently. I just created a new shapefile layer with a 'Pseudo Mercator' CRS, then I import an image of a building floor plan and used the 'add feature' function to trace vectors on top of the image. I would then export that layer as KML and use it with OpenLayers.

A new requirement means that I have to make indoor maps with relative (I'm not even sure what relative means here) UTM coordinates where the bottom left of the map is (0, 0).

Can anyone give me advice on how to approach this?


texts: What QGIS tool or plugin is equivalent to the ESRI "Near" tool?

texts:
Using QGIS 2.10.1 I need to determine the distance from each feature in layer A to its nearest feature in layer(s) B or C or...

ESRI has this capability with their "Near" tool:

http://resources.arcgis.com/en/help/main/10.2/index.html#//00080000001q000000

Is there a QGIS equivalent?

I have

a point layer of 1269 boreholes
stream lines
lake polygons

I need to know, for each borehole, the single nearest distance to water (either stream or lake). In addition, I need to know whether that nearest water is stream or lake.

After completing the analysis, I envision the point layer's attribute table would contain 3 new fields:

the nearest distance to water
the layer (stream or lake) responsible for the nearest distance, and
the stream or lake feature ID responsible for the nearest distance.


texts:
I saw that with openlayers 3 it's feasible to customize fonts on particular maps elements starting from a GeoJSON list.
Is there a way to customize all labels returned from OSM web site?
What I want to achieve is printinting a map on big tourist sign (a0 or a1) with readable labels.

I also looked into QGIS but it's not really straightforward to achieve my goal...


texts: Google's KML reference only states that a Document's ID attribute must be unique.  Are there any other restrictions on the content used as an ID? Specifically, is there any reason a URI would be an invalid document identifier?


texts: Looking for a QGIS 3.12 equivalent to Trim in ArcMap

texts:
I have a polygon layer with one rectangle. I have created a second polygon layer from a buffer on the rectangle. Therefore 2 differently sized rectangles that are identical in proportions but the smaller one exists completely inside the larger one.

I have lines that cross both rectangles, like Lat Long graticles.

I'd like to get rid of the portions of the lines that are inside the smaller rectangle and the portions of the lines that are outside the larger rectangle leaving just ticks that are the length of the gap between the two rectangle layers.

I don't care if it takes a number of steps, I'd just like to get it done.

I've thought of something that might be the direction of a solution but I'm not sure how to proceed with it. Convert both polygons to lines. Cut the "lat long" lines at the intersections with these "lines from rectangles", then delete the inner and outer leaving just the segments between the two rectangles.


texts: Points along lines at set elevation intervals

texts: I am looking for a way to create points along lines (roads) at set elevation differences (0.5m height differences) using QGIS.


texts: How to dissolve overlapping polygons using GeoPandas

texts:
Assuming the following:

from shapely.affinity import translate
from shapely.geometry import Polygon
import geopandas

p0 = Polygon( [(0,0), (2,0), (2,2), (0,2)] )
p1 = translate(p0, xoff=1)
p2 = translate(p0, xoff=4)

df = geopandas.GeoDataFrame(geometry=[
    p0, p1, p2
])
df.plot(cmap='cividis', alpha=0.7, edgecolor='black')

How can I get an output that dissolves polygons that overlap?

I found this answer but I am not convinced because when I replicate the answer, I get a Dataframe with 3 rows, but it turns out that the rows contain multiple Polygon objects in each row/geometry cell, so there is no real merge done.

My desired output is something like:

p3 = Polygon( [(0,0), (3,0), (3,2), (0,2), (0,0) ])
p4 = Polygon( [(4,0), (6,0), (6,2), (4,2), (4,0) ])

dfout = geopandas.GeoDataFrame(geometry=[
    p3, p4
])
dfout.plot(cmap="cividis", alpha=0.7, edgecolor="black")


texts:
I have a district boundary shapefile. I want to divide that district according to the boundaries given in image. How we can achieve it?

Can we add vector file first then add image as an overlay on it and extract the boundaries from image?


texts: How to write multitime NetCDF raster with rasterio and netCDF4?

texts:
My code is:

import numpy as np
import rasterio
from rasterio.warp import calculate_default_transform, reproject, Resampling
from netCDF4 import Dataset

mask=rasterio.open(path1)
dst_crs='EPSG:4326'
with rasterio.open(path2) as src:
    transform, width, height = calculate_default_transform(
        src.crs, dst_crs, mask.width, mask.height, *mask.bounds)
    kwargs = src.meta.copy()
    kwargs.update({
        'crs': dst_crs,
        'transform': transform,
        'width': width,
        'height': height
        })

    dst=Dataset(pathdst, "w", format="NETCDF4")
    for i in range(1, src.count + 1):
        reproject(
            source=rasterio.band(src, i),
            destination=dst.band(i),
            src_transform=src.transform,
            src_crs=src.crs,
            dst_transform=transform,
            dst_crs=dst_crs,
            resampling=Resampling.nearest)

results in an error

  AttributeError: NetCDF: Attribute not found

What is the right way to make a multiband cycle here? The best solution would be writing reprojected bands (each one is a time) with transform parameters from mask (not a multiband file) from src to dst. I believe I should create a time dimension for dst.

Full error is:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-104-2d687936926e> in <module>
     21         reproject(
     22             source=rasterio.band(src, i),
---> 23             destination=dst.band(i),
     24             src_transform=src.transform,
     25             src_crs=src.crs,

netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Dataset.__getattr__()

netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Dataset.getncattr()

netCDF4/_netCDF4.pyx in netCDF4._netCDF4._get_att()

netCDF4/_netCDF4.pyx in netCDF4._netCDF4._ensure_nc_success()

By the way. The file appears in the destination folder (96B).


texts: How can a new feature be created automatically, depending on the editing in another layer?

texts:
I would like to record data in layer 1 which, depending on the values of an attribute, create a new data record in layer 2.
Is this possible in QGIS 3.16 without phyton?


texts: Removing highlighting when selecting feature in Arcmap

texts:
Whenever I select a feature in an attribute table it gets highlighted which prevents me from seeing the symbology of that feature. I tried choosing No Color in the appearance option, but that results in it being highlighted white.

This is what it looks like after a select by attribute query (how I'd like it)

But this is how it appears when I double click the feature to go to it

Anyone know a way to make it hollow or adjust the transparency?


texts: TileServer PHP Performance - MBTiles vs "static files in a directory"

texts:
I have OSM basemap tiles being served using Klokantech TileServer using WMTS. I have multiple users using them through ArcMAP. The performance is already way better than using the usual ArcGIS Online Basemaps, but sometimes it does stall or needs refreshed, which can be an annoyance. I was curious how much better of a performance it is to use the static files as opposed to the MBTiles themselves, considering the managing of the MBTiles is much easier. I was asking because the website for the Tileserver has this statement.

"Direct reading of .mbtiles files is supported, but with decreased performance compared to the static files in a directory. The advantage is easier data management, especially upload over FTP or similar protocols."

This will also require me to figure out how to create the static tiles as I am not familiar with the methodology.


texts: DotSpatial Plugins for Measure, attributes, and query

texts:
I want the end product user to open the attributes, measure task and query the shapefile data using the DotSpatial library in C#.

I have dll with me but when I create the folder in solution and add the dll it doesn't show any change in the output.


texts: Georeferencing Tool in QGIS 3.1: Getting NULL Z-Value with DSM layer when 'rubber sheeting'

texts:
I am using the Georeferencing tool/plugin in QGIS 3.1 to try and 'rubber sheet' two layers together.
My reference sheet is a LiDar data set (ESPG 2961- NAD 83), pixel size 0.0709, -0.0709.
The sheet I am trying to fit is a dated UAV DSM file. The two layers have a difference in elevation by ~5-10m. The problem I am having is that when I run the Georeferencing tool, the new 'georeferenced' layer is shown to have a NULL Z-value (1.79+308 being the max limit of computations-see photo below).
The data are taken of a coastal shoreline and I am measuring elevations of the intertidal area, so bare rock, sand, etc. I have posted photos of the methodology below:
Here is what the issue looks like- this photo is of the UAV layer post-rubbersheeting:

My process was as follows:

Select 20 GCPs from around both layers so that they are uniform.
Use the following transformations: 'Thin Plate Spline', with the resampling type of 'Cubic Spline'.
Let run

UAV derived DEM with elevations on legend:

LIDAR derived DEM with elevations on legend:

Georeferncing toolbar open showing chosen GCPs from both reference layer and new layer:

I am new to this tool, and ideally would be doing something like this in Pix4D or Global Mapper but I don't have access to the datum files for either layer so am unable to figure out the issues and fix them using those applications.
Is it possible to even use this tool on a UAV DEM file with z-values? IF yes, is there a way to run the program without getting NULL values? If not- are there other applications that work similarly?


texts: Selecting a feature in an attribute table using keyboard cursor with QGIS 3

texts: How to select feature (row) in QGIS 3 attribute table using keyboard cursor? I can't find a hotkey for this. Is this even possible?


texts: Making data points different sizes based on data using QGIS?

texts:
I am trying to plot sales data on a map using QGIS. I will add the disclaimer that I am a rookie at using the program. I added the different sales types by adding delimited text layers (utf16). The data included Longitude, Latitude, and Amount. I want to make the dots on the map scale with the value of the sale. Ive had no luck with trying to use Simple Marker->Data defined properties-> size and writing case functions. Some data points show up at different sizes while others show up at all data points. Here are my functions under different simple markers:

CASE WHEN Amount <= 10000 THEN '.2' END
CASE WHEN 10000 < Amount < 75000 THEN '.4' END
CASE WHEN 75000 < Amount <= 250000 THEN '.6' END
CASE WHEN Amount >= 250000 THEN '1' END

The majority of my data set falls into the 10-75k range. However the .4 and .6 size circles show up at every data point on the map, while the .2 and 1 sizes only show up where the data specifies (along with the .4 and .6 sizes). At this point I am trying to figure out what is wrong with the equations, however I am stuck.

Is there a better way to go about this or am I just simply messing up the equations?

I wish I could share my whole map with you but it is looking great. I went with U/Joseph 's solution and here is an excerpt of the results for those interested.


texts: How to convert Australia related EPSG in pyproj?

texts:
I want to convert longitude (151.209900) and latitude (-33.865143) into Australia related EPSG (4283 and 7844) by using pyproj library.
I have tried:
from pyproj import CRS, Transformer
transformer = Transformer.from_crs('epsg:4326', 'epsg:4283')
print(transformer)
# Output: proj=noop ellps=GRS80

# Sydney
x = 151.209900
y = -33.865143
point = transformer.transform(x, y)
print(point)
# Output: (151.2099, -33.865143)

I get the same outputs with EPSG:7844.
It seems that pyproj is able to recognize EPSG:4283 and EPSG:7844 but it just does not convert. I am using pyproj 3.0.0.post1 version.
Could you tell me if it is possible to do such conversions? If not could you recommend a library for doing it?


texts:
I have a QGIS project where there are plots with a attributes like name of the owner, address of the owner, cultivate, and so on.

This plots are read from a PostGIS database. The future users of this project are not user of QGIS and is not an option to teach them things like "Go into properties->fields  calculators...etc".

They only need to use things like selections by name of the owner, or cultivate of the plot, town of the plot, ..., and show the plots with this attributes.

I can make a dialog form in Qt and create a postgres(postGIS) view from the selects fields, but I don't know how can QGIS refresh or read the created views.


texts: I want to close all layers in Mapinfo except one and again add one layer. How to do so in Mapinfo using Mapbasic or without?


texts: I am trying to create a complex routable graph with osm2po. For this I need to extract relations (restrictions for example) and attach them to my graph. Does anyone know what I need to override/extend in the osm2po java API?


texts: QGIS Web Client, tiled raster at fixed zoom levels?

texts:
I have a tiled png raster map, which is available in zoom levels 8, 9 10 and 11, loaded as background layer / basemap via OpenLayers.Layer.OSM.

in /site/js/Customizations.js I added in customBeforeMapInit()

var myBGLayer = new OpenLayers.Layer.OSM("Name","http://<server>/<path>/tiles/${z}/${x}/${y}.png",
  {
    isBaseLayer: true
  });

baseLayers.push(myBGLayer);

QGIS Web Client only displays this base map when the map window zoom is in one of the available zoom levels. What I'd like is that it maintains map display at the last available zoom level, even when zooming beyond level 8 or 11 i.e. keeping the map in level 8 when zooming to 7 or smaller and keeping it to 11 when zooming to 12 or greater.

Any suggestions how to set this up?


texts: Joining attribute table between two features classes

texts: I have two networks of london, one comes from openstreetmap and the other one from a national Survey. I need to join the attribute table of the second one to the first one. The problem is that they are not completely overlapped. Any suggests?


texts: In arcgis how do I filter my geo data in a certain state?

texts: I currently have a database of points that contains latitude and longitude. What I want to do is to filter out all the points so that only the ones that are in Texas will show. I have done a spatial join with the target as the points and the join as the state, but it still shows all the points from the original set.


texts: QGIS default style stored in PostGIS public.layer_styles table won't load with data from other schemas

texts:
In QGIS 2.18.15 (and 3.0), I cannot get default styles stored in 'public.layer_styles' in a PostGIS database to load automatically when adding a new layer to the map.  I believe the problem is that the data layers are stored in different schema from 'public'.

The following approaches provide the desired result of automatically loading the default 'public.layer_styles' when a layer is added from the database:

1) 'public.layer_styles' column 'f_table_catalog' contains the name of the database, column 'f_table_schema' contains the name 'public' --> this only works if the data layers are ALSO stored in the 'public' schema.

2) 'public.layer_styles' column 'f_table_catalog' contains the name of the database, column 'f_table_schema' contains the name 'another_schema' (in this case 'dnk') --> this only works if the data layers are ALSO stored in the 'another_schema' schema (here, 'dnk').

Option 2 above gets me most of the way to where I want to be.  The only problem is that it limits me to only being able to load data with default styles from one additional named schema ('dnk' in this case).  I have several other schemas in the same database from which I'd like to add data layers and have them styled automatically based on 'public.layer_styles'. I want to be able to load data layers from any named schema outside of 'public' and have the default layer_styles stored in 'public' be applied.

Is there some kind of wildcard character that can go in the 'f_table_schema' column to enable this (instead of 'public' or 'another_schema')?  Is there another way to do this that I'm missing?


texts: Buffering a curving line results in polygon overlaps and gaps

texts:
Using Arcmap 10.5.1, I need to buffer a line feature class with varying buffer widths, according to the values in one of the feature class attributes.  The buffer ends must be flat.

When the line (or portions of it) are straight, the buffering works well, as in this hand-drawn representation:

However, when the line bends, the resulting buffers have an overlap on the inside of the curve, and a gap on the outside:

The overlaps and gaps are a problem.  The output feature class must have the overlaps reduced to a single polygon and the the gaps filled in.

I can flatten the overlaps to single polygons using a combination of unioning and dissolving.  However, I do not know how to fill in the gaps with new polygons.  I'm envisioning one possible solution with the following graphic; the grey areas represent the "fill-in" polygons:

I have thousands of such lines, so hand editing is out.  Any thoughts on how to create polygons in the gaps?


texts: How to load my CSV file with WKT to QGIS


texts: Uploading shapefile with more than 1,000 features to ArcGIS Online?

texts:
I have many GIS files that I was using to create some maps for my work. Our desktop version of ArcGIS expired and we decided to move to the basic online version. I am unable to upload any of my databases and all the shapefiles that I have are said to have over 1,000 features.

Is there any way I can get this to upload? Maybe splitting the data in two parts and uploading them separately?


texts:
Using QGIS on Windows XP based desktop.
I am trying to use USDA orthophoto data from this WMS server:
"http://raster.nationalmap.gov/arcgis/services/Orthoimagery/USGS_EDC_Ortho_NAIP/ImageServer/WMSServer"

I can get the layer into QGIS with no problem but the only layer on the WMS server is of the entire United States. I want to extract from that the area I am interested in (a city). I have a vector layer of that city to use as a clip coverage but GDAL can only clip from a local raster layer. I have probably left out some pertinent information so please just ask if you need more information.


texts: Compute area for polygons in an EPSG:4326 shapefile?

texts:
I have a shapefile covering the whole globe, in EPSG:4326 (geodetic WGS84). I would need to compute the polygons areas in a metric such as km2.

How can I do that in QGIS or with GDAL/OGR and having a good precision?


texts: Multiple input tables for Add Field in ModelBuilder

texts:
My model requires field1 to be added to fc1 and fc2, and then calculated according to a Python expression calc1. field2 is then added to fc2, and calculated using calc1. How do I add the multiple feature classes as the input to Add Field and Calculate Field? I have tried creating an input table variable as a list of values, and while it accepts fc1 and fc2 when I type it in, the model does not run ("dataset does not exist").

edit I'm adding these fields so that I can join the tables on a common pre-existing field and populate fc2.field1 with the values from fc1.field1.


texts: GDAL Intersects() not working as it should?

texts:
Doing a topological analysis in GDAL/OGR returned an unexpected result. When I started investigating, it seems possible that the Intersects() method is badly implemented. Specifically, points along a polygon's boundary returns False, when it should return True:

from osgeo import ogr

poly = ogr.Geometry(ogr.wkbPolygon)
ring = ogr.Geometry(ogr.wkbLinearRing)
ring.AddPoint(0, 0)
ring.AddPoint(5, 5)
ring.AddPoint(10, 0)
ring.CloseRings()
poly.AddGeometry(ring)

point = ogr.Geometry(ogr.wkbPoint)
point.AddPoint(10, 0)

poly.Intersects(point)
>>> False
poly.Disjoint(point)
>>> False

Not only does the point correctly intersect the polygon, Intersects and Disjoint should be opposite subsets, and never return the same value. Furthermore, the Intersection() method, which should only work when geometries intersect, works normally:

inter = poly.Intersection(point)
inter.ExportToWkt()
>>> 'POINT (10 0 0)'

I'd like to know if perhaps I'm not understanding this correctly, or if my GDAL compilation is problematic, or if it's GDAL itself that has a bug.

Info: GDAL 2.2.1 64-bits, Tamas Szekeres' VS2008 version.


texts: QGIS 2.10 Edit shapefiles saving only once

texts:
I'm have some trouble while editing my shapefiles. I can save only once.

So what I have to do is to save as another file, add to QGIS and edit again. Save as another file... And on and on...

Does anyone have a clue to solve this?


texts: Coordinate System is `' (empty) in GeoTIFF when checking with GDAL

texts:
Following is the output for my gdalinfo mygeo.tif.
Driver: GTiff/GeoTIFF
Files: 3489_DUBLIN_AREA_2KM2_rgb_124639_id32c1_20150326115630.tif
Size is 9000, 6732
Coordinate System is `'
Metadata:
  TIFFTAG_MAXSAMPLEVALUE=254
  TIFFTAG_MINSAMPLEVALUE=0
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  TIFFTAG_SOFTWARE=FramePro 1.3.0.2569 (rev 68105)
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 6732.0)
Upper Right ( 9000.0,    0.0)
Lower Right ( 9000.0, 6732.0)
Center      ( 4500.0, 3366.0)
Band 1 Block=9000x1 Type=Byte, ColorInterp=Red
Band 2 Block=9000x1 Type=Byte, ColorInterp=Green
Band 3 Block=9000x1 Type=Byte, ColorInterp=Blue

mygeo.tif is a georeferenced tiff (GeoTIFF) image. Therefore, I reckon it should display the coordinate reference system. What could be the possible reason to see it blank?