texts: Spatialite, to speed performance, when should I create Views, Indexes or additional spatial tables?

texts:
I’ve got a large Spatialite database with a table of lines (roads, rail and water).  I created a spatial index of the geometry to speed things up.

This works amazingly well when I’m zoomed in close.  However, when I’m zoomed out in QGIS 1.8, the display is slower than I’d hope.  And so I created a separate Table-View of just the major roads, intending to speed things up.  That didn’t work—I suppose because the display is still plowing through all the roads just to find the major roads.

Is it justified for me to create another spatial table of “just the major roads” to use when I’m zoomed out.  Or, is there some way to index the queried column for major roads, or some other trick, and thus create a very speedy display of the major roads without creating a brand new spatial table?  I’m trying to keep my Spatialite database as small and practical as possible, without filling it with a lot of redundant tables of data.  I’m finding that Spatialite is extremely quick, but perhaps I’m expecting too much performance, though I’d still like to get as much as possible.


texts: Can I control how GDAL interpolates the edges of an array?

texts:
I am currently using GDAL 2.1.0 in a Python script to reproject a geotiff with a given pixel size into an other geotiff with the same projection, but with a different pixel size. To do so, I use the following GDAL function:

     gdal.ReprojectImage(in_dataset, out_dataset, in_srs.ExportToWkt(),
                         out_srs.ExportToWkt(), gdalconst.GRA_Average)

Is there any way I can control how the resampling option provided by gdalconst deals with the edges of my image?

In this case, I end up with the new image that has the 2 first rows, the last row, the first column and the last column with a value of 0 (i.e. around the edge of my reprojected image). And this can be more depending on the resampling method. Below, the first picture is the original image on a Google Map in a GIS and the second is the reprojected image showing the border.

For the moment, I convert the edge pixels to NaNs through indexing:

myarray = np.pad(myarray[2:-2, 2:-2], ((2,2),(2,2)), mode='constant',
                 constant_values=(np.nan,))

but I feel this isn't the best way to deal with it and am hoping there is an in-built solution (as it is the case for other libraries such as astropy's convolute).


texts: Correctly displaying structural data in different map projections

texts:
How can I ensure the correct display of oriented structural data in GIS at northern latitudes when the map is reprojected.
We are making new geological maps in northern latitudes and have a lot of structural data that we want to display. we can of course display them correctly with the rotation of a symbol by an attribute (strike) in ArcGIS Pro\ArcMap.
However, as our maps make up part of a series which cover more than one UTM zone we must ensure that the symbols are rotated correctly with respect to north as the map is reprojected.
We currently get over this issue by using lines oriented for strike instead of symbols, as the line will reproject but a symbols attribute will not be recalculated so therefore does not rotate.
Is there a way to do this using just the symbols instead of creating line features instead? The structural data must be queriable by the end user and be able to retrieve the strike\dip data, which is easier to do with point data rather than lines...


texts: How to write raster in saga format with python

texts:
I try to write a raster file in SAGA GIS format (sgrd). My script is work but some information is missing in the final file (i.e output.sgrd).
Here is script :

from osgeo import gdal, ogr, osr
import numpy as np

raster = gdal.Open(raster_file)
driver = gdal.GetDriverByName('SAGA')
driver.Register()
cols = raster.RasterXSize
rows = raster.RasterYSize
band = raster.RasterCount
datatype = raster.GetRasterBand(1).DataType
outDataset = driver.Create(output+'output.sdat', cols, rows, band, datatype)
geoTransform = raster.GetGeoTransform()
outDataset.SetGeoTransform(geoTransform)
crs = raster.GetProjection()
outDataset.SetProjection(crs)

raster_out = np.zeros((rows, cols), dtype=np.uint8)
outBand = outDataset.GetRasterBand(1)
outBand.WriteArray(raster_out)

How can I fix my error?


texts:
i am trying to create datasets from xmd files (based on INSPIRE data model). i get a notice that my "workspace does not found"). does anyone have experience with that?

i am looking for a schema for base mapping and topographic mapping that baset on iso19101 data model or allike. will be thankfull for any help.


texts: Getting 16 days composite in Google Earth Engine?

texts:
I've wrote this code. In this code I've call lst daily product. But I don't know how can I compute 16 days mean composite from daily product?

code link: https://code.earthengine.google.com/b29845b2c97b13074c7b370cd8a0460f

Map.centerObject(table);
Map.addLayer(table);

var modis = ee.ImageCollection('MODIS/006/MOD11A1')
.filterBounds(table)
.filterDate('2010-01-01','2011-01-01');


texts: How to recalc WGS84 Shape_Area field to square miles in ArcGIS 10

texts:
What are the units of the Shape_Area field in a wgs84 feature class? Is it decimal degree squared?
I would like to convert that to something more meaningful like square miles without reprojecting the feature class... Is there a formula for it out there? I am looking to recalc the field programmatically.
Thanks for your help!


texts: Symbolizing arrow length proportional to value in ArcGIS for Desktop?

texts:
I am trying to plot velocities (from GPS data) as arrows in ArcGIS 10.3. Say the velocity at one point is 20 mm/y and at another point 40 mm/y. I will worry about the direction later - let us assume it is straight north. I would like to symbolize the data points as arrows starting at the coordinates of the datapoint, going straight north and with a length of respectively 20-times some unit and 40-times some unit.

I know I can use arrow symbols when using the "Symbology - Quantities - Graduated symbols" but that does not scale each arrow exactly by the value in question. For "Symbology - Quantities - Proportional symbols", I can only figure out how to make the size of squares or circles proportional to some value but not the length of an arrow.

Has anyone done this?

If it is not doable in Arc - is there some open source GIS that can do that?


texts: How to automatically generate the coordinates of new points features and add them to the feature table?

texts:
I need to add point coordinates into table (xcoor field and ycoor field).
I knew this could be done using Field Calculator.
First I created new field xcoor and used expression $x to get x coordinate. I set field type as decimal number (real). I did the same for the ycoor.
The table looked like this:

For existing point xcoor and ycoor field were updated.

But when I tried to insert new point feature I didn't get it's coordinates in the table. Both fields were empty for that feature.

Then I changed field type like this creating new field but virtual with type double:

And now, when I add new point it's coordinates are automatically inserted into table. But I can't understand why is this possible using virtual field and why double data type is offered just in this case?
I hope someone can explain this to me.


texts:
I would like to extend the QGIS function to add object with mouse and keyboard. Every time I click on add object a window appears in which I have to enter the attribute value, which should be prevented in the future (see picture).

Concrete task: Each time I left-click on my mouse, the number 1 should be written once by keyboard programming (PyQGIS)


texts: Strange buffer of polygons in sf st_buffer()

texts:
I am trying out the R package sf function st_buffer():

outbuf <- st_buffer(inpoly,10)

and get a buffer which looks strange. The buffer seems to be gridded in some way and does not cover the original polys. What should I do to get a buffer 10 m around the polygons? I have validated the geometry with st_make_valid() before buffering and precision is set to 0.01.


texts: Spatial query and sending SMS - Which techno on mobile?

texts:
I would like to set up a mobile application to send SMS messages to nearby contacts. To make it simple, here are the steps in the process:

The user opens the app and adds a point on the map.
A script automatically returns the list of contacts within a radius of 10 km around the point.
The user's smartphone sends an SMS (via SIM card) to each contact found.

The nomadic user may sometimes be out of reach of the 3G/4G network, so the data (rasters, location and number of contacts...) will have to be stored in the smartphone memory.

Which technology do you think should be used for offline use?


texts: Exctracting values and their coordinates from a raster layer in QGIS?

texts:
I would like to extract the pixel value and coordinates of each of them from a ndvi raster layer. I don't have a point layer from where I can extract those values, as I read in other posts.
Specifically, in this experiment I have a ndvi image from a vineyard field and I want to discretize the different treatments that we applied on this field. To do so, int he first place I want to get the pixel values and their coordinates (E,N), not the whole layer but from some parts that I selected by creating a polygon.


texts: World Topographic Map in QGIS is blocky pixelated

texts:
The ArcGIS World Topographic Map in QGIS is pixilated, specifically the text and lines.
View the images below in full screen to see the blocky pixelation.
How can the World Topographic Map be added to QGIS without the blocky pixelation?
Web Map: ArcGIS World Topographic Map
Map Details: World Topo Map Details
XYZ Tile source: https://qms.nextgis.com/geoservices/519/


texts: ArcGIS: applying different formulae based on a raster's VALUE field

texts:
(using ArcInfo 10.0 sp3) As part of the creation of a cost-map for a cost-distance analysis, I need to create map A that is based on the following on two formulae, where S stands for slope in degrees:

20.9 tan(S)^2 + 4.18 tan(S) + 1.38    (-60 < S < -6)
52.1 x 103 tan(S)^2 + 10.4 tan(S) + 2.65    (-6 < S < 60)

In other words, for every VALUE between -60 and -6, 1 should be run, for every VALUE between -6 and 60, 2 should be run, resulting in one, combined map. I have a slope map ready. What I do not know, is how to translate this if/then statement to the Model Builder. My knowledge of Python is almost zero, so I sadly do not possess the skill to adjust the similar-but-different Python scripts which I found by search. Any ideas?

Thanks in advance.


texts: Extracting EPSG from a raster using gdal bindings in Python

texts:
My goal is to check that a shapefile and raster have the same projection and datum using EPSG number.

One can easily extract EPSG number from a shapefile by the following:

ds=ogr.Open(r'....satates48.shp')
utm_sr=ds.GetSpatialReference()
utm_sr.GetAttrValue('AUTHORITY',1)

This works great but how does one do the same for a raster file, you cannot, to my knowledge get a spatial reference of a raster.

One can get projection, or projecitonref (I am not sure if there is any difference), but you cannot do more, like:

fn_raster=gdal.open(r'raster_file.tif')
raster_sr=fn_raster.GetProjection().GetAttrValue('AUTHORITY',1)

This does not work. Perhaps there is an alternative way to do this?


texts: How to set a map in portrait orientation in layout of qgis.3.2.0(bonn).there is no option in  layout view for changing the orientation of paper.


texts: Qgis Python console print statements not working

texts:
I have a small problem with the Python console in Qgis.
I am working through some introductory tutorials on Python scripting for Qgis. I have a script that loads layers, then queries the canvas for names and loops through the names and prints them, something like this:

print "This print statement does not help"
#
# import layers to canvas
qgis.utils.iface.addVectorLayer("/path/file1.shp", "First file", "ogr")
qgis.utils.iface.addVectorLayer("/path/file2.shp", "Second file", "ogr")
qgis.utils.iface.addRasterLayer("/path/file3.tif", "Third file")
#
# print "This line triggers the print function in the for loop to work"
#
canvas = qgis.utils.iface.mapCanvas()
allLayers = canvas.layers()
#
for i in allLayers: print i.name()

The problem is that, unless I print to the console before the for loop but after the imports, the layer names are not printed, the script simply exists cleanly. If I run the script a second time (with the files still in the canvas) the files are imported again and the for loop works, but of course now there are two copies of the files in the canvas.
Is this yet another path problem or a bug or am I expecting too much?

(OSX 10.7.5 and Qgis 2.6.0)


texts: OSM table(Matrix) Api returning distance 0 for small routes

texts:
I am building a webservice which returns distance of various shops, from lat,long received from mobile.

For that I want to use osm table api, but it return zero for search on lat,long:

Click on link:
http://router.project-osrm.org/table/v1/drive/22.9755,72.5024;23.0143,72.5647;23.0483,72.4796?sources=0

Here I'm search for below matrix:

     From       |       To
22.9755,72.5024 |  23.0143,72.5647
22.9755,72.5024 |  23.0483,72.4796

If I search manually in there website (http://www.openstreetmap.org/search) and it return correct distance.


texts: How to request a limited no of features in Overpass api?

texts:
I am using Overpass api to query Building data from OpenStreetMap. the query string is like this

(way[building](bbox);node(w););out body;

This works really fine (the bounding box is specified by Openlayers).

Now i want to improve it, such that only 10 buildings are returned by the query, to speed up the process. For this i used the query

(way[building](bbox);node(w););out 10;

but doing this returns only 10 nodes like here

What i want is 10 buildings.


texts: How to set transparency to multiple raster values with Python

texts:
With the following code I can set 100% transparency to raster value 0:

map=None

for lyr in QgsMapLayerRegistry.instance().mapLayers().values():
  if lyr.name() == "some_layer":
    map= lyr

tr=None

tr=QgsRasterTransparency()
tr.initializeTransparentPixelList(0)
map.renderer().setRasterTransparency(tr)
map.triggerRepaint()

How can I define two values (0 and 8) to be 100% transparent?

When I repeat the commands of the last block with raster value 8, the first value (0) is removed from the layer transparency.


texts: Omitting field mapping in Copy As Python Snippet?

texts:
I performed a task ArcMap 10.1, using the Spatial Join tool in the toolbox. Then, from the Results widows, right-click and select Copy As Python Snippet. This will be the basis for a script that will loop over a series of input / output combinations to automate the repetitive steps a user would otherwise perform manually.

The script contains a large field mapping. I'm not performing any field mappings so, in my mind, I don't really need it. Is there a way to remove the field mapping section and tell arcpy to just use the same names? That's what the code is doing but I'm looking for a cleaner way. Plus, my iterations will not contain the same fields but they will not have any field mapping either. I tried removing the field mapping section and replacing it with "" but that didn't work.

Update 2 - One solution, and I'm holding out hope for something more elegant, iterate the feature classes used for each spatial join and build the field mappings in code.

Update 1 - Added script. The error is "arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid." when I replace the field mappings with "". The error occurs on the line beginning with "INTERSECT",.

arcpy.SpatialJoin_analysis("XXX-TargetFeatures-XXX",
                           "C:/.../localFileGeodatabase.gdb/XXX-JoinFeatures-XXX",
                           "C:/.../localFileGeodatabase.gdb/XXX-OutputFeatureClass-XXX",
                           "JOIN_ONE_TO_MANY",
                           "KEEP_COMMON",
                           """Field01 "Field01" true true false 4 Long 0 0 ,First,#,C:/.../localFileGeodatabase.gdb/XXX-TargetFeatures-XXX,Field01,-1,-1;
                            Field02 "Field02" true true false 4 Long 0 0 ,First,#,C:/.../localFileGeodatabase.gdb/XXX-TargetFeatures-XXX,Field02,-1,-1;
                            Field03 "Field03" true true false 2 Text 0 0 ,First,#,C:/.../localFileGeodatabase.gdb/XXX-TargetFeatures-XXX,Field03,-1,-1;
                            .
                            .
                            .
                            Field120_1 "Field120" true true false 2 Text 0 0 ,First,#,C:/.../localFileGeodatabase.gdb/XXX-TargetFeatures-XXX,Field120,-1,-1""",
                            "INTERSECT", "2000 Feet", "


texts: Removing parts of raster layer with QGIS (equivalent of vector difference tool)?

texts:
I'm trying to get the difference between two raster layers the same way we can do it with the difference tool with vector layers. I'm using QGIS 2.14.

Anyone has already done that and can tell me how to proceed ?


texts: Using SLD  to construct multi-character font symbols

texts:
I've been trying to figure out different approaches to constructing circles with text inside of them in SLD/GeoServer. Single character font-based "external" symbols work fine, with the "text" part being e.g.:

<PointSymbolizer>
  <Graphic>
    <Mark>
      <WellKnownName>ttf://Arial#0x70</WellKnownName>
      <Fill>
        <CssParameter name="fill">#000000</CssParameter>
      </Fill>
    </Mark>
    <Size>7</Size>
  </Graphic>
</PointSymbolizer>

My question is, is it possible to combine several characters into one WellKnownName tag in the hex format? Haven't found anything at least in the SLD documentations / references. Or does one always have to generate several PointSymbolizer entities with single characters accompanied by some offset technique to generate multi-character text symbols? Looking for the cleanest, least-markup approach here.

For instance if I'd want a text "AA" inside a circle, the HEX code would be 4141, but so far it seems one can only single letters, e.g. ttf://Arial#0x41. At least ttf://Arial#0x4141 doesn't seem to work.

Of course one can create texts inside circles with TextSymbolizer but that runs into all kinds of label removal/placement issues.


texts:
I wrote the script to copy a existing shapefile tc_line to a new file tc_pi, and it ran fine:

from shapely.geometry import mapping, shape
import fiona

with fiona.open('tc_line.shp', 'r') as input:
    schema = input.schema.copy()
    input_crs = input.crs
    with fiona.open('tc_pi.shp', 'w', 'ESRI Shapefile', schema, input_crs) as output:
        for elem in input:
            output.write({'properties':elem['properties'],'geometry': mapping(shape(elem['geometry']))})

Now I want to copy the existing file and add a new column (type: float) containing "1" to the attribute table (I would like the new-added column to be attached to the right of the existing columns in the attribute talle), so I edited the code above to this:

from shapely.geometry import mapping, shape
import fiona

with fiona.open('tc_line.shp', 'r') as input:
    schema = input.schema.copy()
    input_crs = input.crs
    schema['properties']['pi'] = 'float'
    with fiona.open('tc_pi.shp', 'w', 'ESRI Shapefile', schema, input_crs) as output:
        for elem in input:
            output.write({'properties':elem['properties'],'geometry': mapping(shape(elem['geometry']))})

but error occurred:

Traceback (most recent call last):

File "C:\Users\Heinz\Desktop\test.py", line 10, in <module>
    output.write({'properties':elem['properties'],'geometry': mapping(shape(elem['geometry']))})
  File "C:\Python27\lib\site-packages\fiona\collection.py", line 333, in write
    self.writerecords([record])
  File "C:\Python27\lib\site-packages\fiona\collection.py", line 327, in writerecords
    self.session.writerecs(records, self)
  File "fiona/ogrext.pyx", line 1024, in fiona.ogrext.WritingSession.writerecs (fiona/ogrext.c:17361)
ValueError: Record does not match collection schema: [u'cat_', u'value', u'label'] != ['pi', u'label', u'value', u'cat_']

How to solve this and achieve my objective of 'copy the existing file and add a new column (type: float) containing "1" to the attribute table of new file'?

I am working with python 2.7.12, Fiona 1.7.0


texts: ArcGIS Server JavaScript: copy attribute from feature snapped to

texts:
I have an application that allows the user to add a point (in this case, pipe breaks) and snap to a line (water main).  I have been asked to pre-populate one of the attributes in the point feature with the same attribute from the line that it is snapped to.  Simple enough, theoretically, yet complicated, I believe, programmatically.  I should also mention that I am not a good programmer. I am also using the GitHub CMV template, but since this is so outside the realm of CMV, I did not post there.
So, has anyone done this?


texts: Obtaining the coordinates of point through arcpy

texts:
I have a feature selected from a feature class based on user input through arcpy.

How can I obtain the x,y coordinate of the selected point feature class (Points).

How do I do this?:

arcpy.AddMessage ("Coordinates: " + Points.getSelectedExtent().X)


texts: Changing source dataset for maps in CartoDB?

texts: Is it possible to change the source dataset for an existing map? I want to use a previously developed map with an updated dataset (same basic structure).


texts:
I have tried to add buildings from WFS layer. https://kartat.espoo.fi/teklaogcweb/wfs.ashx (building layer is GIS:Rakennukset)

Geometry never shows up. However, map extent and data in attribute tables seems to be correct. Also, QGIS doesn't give any error message.

I have been so far able to track down that WFS layer contains different geometry types which seems to be problem for QGIS. I tried to save as GML and then select only polygons, but geometry still doesn't exist (extent and attributes are still fine).

Any tricks/tips?


texts:
I'm using JavaScript API 3.24 for reference. I want my application to automatically allow users to access secured services based on background authentication via a token (this way they don't need to login). I have reviewed the documentation and many questions here, but I just can't seem to get it to work. Sorry for the length of this post, but I want to explain fully what I have tried.

I've secured one geoprocessing service called Habitat Management. It is located in the HabitatManagement folder, the service is titled HabitatManagement, and it contains a geoprocessing task called HabitatManagement. Essentially, the url for the secured service looks like this:

https://www.mydomain.com/myServer/rest/services/HabitatManagement/HabitatManagement/GPServer/HabitatManagement

The actual web mapping application resides inside of a .NET application. The URL of the .NET application is this:

https://www.mydomain.com/appName

The actual web map url is this:

https://www.mydomain.com/appName/HabitatMap/HabitatJSMap

I have my proxy config file set up like so:

<ProxyConfig allowedReferers="*"
             mustMatch="false"
             logFile="proxyLog.txt"
             logLevel="Warning">
    <serverUrls>
      <serverUrl url="https://www.mydomain.com/myServer/rest/services/HabitatManagement/HabitatManagement/GPServer/HabitatManagement"
                  username="username"
                  password="password"
                  matchAll="true"/>
    </serverUrls>
</ProxyConfig>

I have the proxy JS code like this:

urlUtils.addProxyRule({
                urlPrefix: "https://www.mydomain.com",
                proxyUrl: "https://www.mydomain.com/appName/proxy/proxy.ashx"
            });

If I go to the proxy page following this URL:

https://www.mydomain.com/appName/proxy/proxy.ashx

It works as expected, it says "Config File: "OK" Log File: "OK""

When I test this URL, it shows the login screen for my REST services, even though the token should be passing the username and password so I can see the services, right? That's issue #1 that I don't understand.

https://www.mydomain.com/appName/proxy/proxy.ashx?https://www.mydomain.com/myServer/rest/services/HabitatManagement/HabitatManagement/GPServer/HabitatManagment

Additionally, when I go the web map and try to access the service, it still makes me login with this message:

  Please sign in to access the item on https://www.mydomain.com/myServer
  (HabitatManagement/HabitatManagement)

If I login, things work fine - it appears the token is generated and appended to the URL as it should be.

I have also tried to change my serverURL to something very general with no luck. Ideally, the serverURL would be more specific than this as there are some services we have that don't require authentication thus do not need to run through a proxy. This just takes me to the login page for my REST services too.

<serverUrl url="https://www.mydomain.com"
                  username="username"
                  password="password"
                  matchAll="true"/>

I'm not sure if my proxy is located in the wrong spot in my .NET application, or if my referrer URL is messed up, or if my serverURLs are messed up. How do I access my secured services using the proxy?


texts: Help with vector layer (geojson) in openlayers

texts:
In openlayers I try get geojson from geoserver to overlay in map. Code:

  var vectorSource = new ol.source.Vector({
    format: new ol.format.GeoJSON(),
})
$.ajax({
    type: "GET",
    url: "http://localhost:8080/geoserver/ows?service=WFS&version=2.0&request=GetFeature&typeName=global:ua46lo_hydran_poi&SRS=EPSG:4326&outputFormat=text/javascript&format_options=callback:getJson",
    dataType : 'jsonp',
    jsonpCallback : 'getJson',
    success:function(data){
        // If response is valid
        var geojsonFormat = new ol.format.GeoJSON();
        console.log(data);
        // reads and converts GeoJSon to Feature Object
        var features = geojsonFormat.readFeatures(data);
        vectorSource.addFeatures(features);
    }
});
var restaurantsold = new ol.layer.Vector({
    title: 'b_layer',
    source : vectorSource
});

Add this layer to map, but get only this:

Why?
geojson from geoserver:

    {
  "type": "FeatureCollection",
  "totalFeatures": 2450,
  "features": [
    {
      "type": "Feature",
      "id": "ua46lo_hydran_poi.1",
      "geometry": {
        "type": "Point",
        "coordinates": [
          24.068626,
          49.785831
        ]
      },
      "geometry_name": "geom",
      "properties": {
        "gid": 1,
        "mp_type": "0x5000",
        "label": "Антонича Б. вул., 6",
        "indicator": "Так",
        "typnet": "К",
        "dsitky": "200",
        "typpg": "М"
      }
    },
    {
      "type": "Feature",
      "id": "ua46lo_hydran_poi.2",
      "geometry": {
        "type": "Point",
        "coordinates": [
          24.069041,
          49.785097
        ]
      },
      "geometry_name": "geom",
      "properties": {
        "gid": 2,
        "mp_type": "0x5000",
        "label": "Антонича Б. вул., 12",
        "indicator": "Так",
        "typnet": "К",
        "dsitky": "600",
        "typpg": "М"
      }
    },
    {
      "type": "Feature",
      "id": "ua46lo_hydran_poi.3",
      "geometry": {
        "type": "Point",
        "coordinates": [
          24.068407,
          49.783316
        ]
      },
      "geometry_name": "geom",
      "properties": {
        "gid": 3,
        "mp_type": "0x5000",
        "label": "Антонича Б. вул., 24",
        "indicator": "Так",
        "typnet": "К",
        "dsitky": "600",
        "typpg": "М"
      }
    },
    {
      "type": "Feature",
      "id": "ua46lo_hydran_poi.4",
      "geometry": {
        "type": "Point",
        "coordinates": [
          24.067433,
          49.783146
        ]
      },
      "geometry_name": "geom",
      "properties": {
        "gid": 4,
        "mp_type": "0x5000",
        "label": "Антонича Б. вул., 26",
        "indicator": "Так",
        "typnet": "К",
        "dsitky": "250",
        "typpg": "М"
      }
    },
    {
      "type": "Feature",
      "id": "ua46lo_hydran_poi.5",
      "geometry": {
        "type": "Point",
        "coordinates": [
          24.060515,
          49.791894
        ]
      },
      "geometry_name": "geom",
      "properties": {
        "gid": 5,
        "mp_type": "0x5000",
        "label": "Антоненка-Давидовича Б. вул., 1",
        "indicator": "Так",
        "typnet": "К",
        "dsitky": "250",
        "typpg": "М"
      }
    }
  ],
  "crs": {
    "type": "name",
    "properties": {
      "name": "urn:ogc:def:crs:EPSG::4326"
    }
  }
}


texts:
A librarian has helped me create some maps, and I need to open them. He is off work at the moment and I am in a rush for this. I have downloaded ArcGIS and he says I can open this with ArcMap. He has given me a folder that is .gdb and inside it contains many files:

.gdbindexes
.gdbtable
.gdbtablex
.spx
.atx
etc..

I cannot open any of them with ArcMap.


texts:
I just updated QGIS from 3.10.2 to 3.10.3. When I start QGIS I receive this message log in processing tab:

  2020-02-24T14:27:00     CRITICAL    Could not import script algorithm
  'quick_api' from
  '/home/federico/old_lacie/federico/qgis/pyqt/quick_api/quick_api.py'
               attempted relative import with no known parent package.

and this message log in Error Python tab:

  2020-02-24T14:27:00     WARNING    Traceback (most recent call last):
                File "/app/share/qgis/python/plugins/processing/script/ScriptAlgorithmProvider.py",
  line 119, in loadAlgorithms
                alg = ScriptUtils.loadAlgorithm(moduleName, filePath)
                File "/app/share/qgis/python/plugins/processing/script/ScriptUtils.py",
  line 66, in loadAlgorithm
                spec.loader.exec_module(module)
                File "", line 728, in exec_module
                File "", line 219, in _call_with_frames_removed
                File "/home/federico/old_lacie/federico/qgis/pyqt/quick_api/plugin_upload.py",
  line 13, in
                standard_library.install_aliases()
               NameError: name 'standard_library' is not defined

and processing works bad.
I suppose same variable settings has changed, but I didn't find which are.


texts: After loading osm data using osm2pgrouting how can I add my point data for kdijikstra

texts:
I have imported osm data to postgis by osm2pgrouting. Now I want to add point data of my locations, to find distance from one point to multiple points through the osm ways data. I am new to pgrouting.

How can I create topology from these points to ways data.

=


texts: How to display raster attributes by default in ArcGIS for Desktop?

texts:
I have a 4-bit thematic raster image with a color map from white to dark blue (Figure 1).  The values 1 - 6 represent tree canopy cover at various breakpoints.  I also created a raster attribute table with the various classified breakpoints (Figure 2).  Is there a way (i.e. other than creating a .mxd document) for the image to immediately display the "Cover" attributes in Figure 2, rather than what currently displays in figure 1?

Essentially what I am trying to do is eliminate the classes with no data (e.g. 0, 7-15) and make the "Cover" raster attributes display by default when the user brings up the image in the viewer.

Figure 1

Figure 2


texts: Allow user to pan after once 'box' is draw in Openlayer2

texts:
I am using this example

  http://dev.openlayers.org/examples/draw-feature.html

to draw a box on a map using 'draw box' checkbox option. Now I want , After drawing box I can be able to pan on map using roller of mouse(scroll wheel ) ? like for drawing I use left button of mouse so for panning I will click roller of mouse and pan on map

To drawing Code is

box: new OpenLayers.Control.DrawFeature(boxLayer,
                    OpenLayers.Handler.RegularPolygon, {
                        handlerOptions: {
                            sides: 4,
                            irregular: true
                        }
                    }

which is taken by

  https://github.com/openlayers/ol2/blob/master/examples/draw-feature.html

And working of this file I already attached.


texts: Plugins are not installed in qgis 1.8.0 Lisboa

texts:
I am trying to install plugins in qgis1.8.0 Lisboa but error message is appear as follows,

  Failed to unzip the plugin package. Probably it's broken or missing
  from the repository. You may also want to make sure that you have
  write permission to the plugin directory:
  /home/hebert/.qgis//python/plugins

Please tell me solution for it.


texts: Error when updating arcpy.SearchCursor to arcpy.da.SearchCursor

texts:
I'm trying to update a python script to use the arcpy.da.SearchCursor instead of the legacy arcpy.SearchCursor.  The cursor searches for duplicate values in a field.

I am getting an error:

  Traceback messages below.
  AttributeError: 'tuple' object has no attribute 'getValue'

There must be a syntax difference between the two cursors that I have wrong.
Can anyone tell where I am going wrong?

#Constant Vars
dblayerprefix = "CityworksGIS_Test.DBO."
whydrant = dblayerprefix + "WHYDRANT"
#Parent
centralDB ="<YOUR DB CONNECTION>" #this variable used for replication
#Child
editDB ="Database Connections/DBO@CityworksGIS_Test.sde"
columnName = 'AssetID'
updateSql = "AssetID IS NULL"
noNullSql = "AssetID IS NOT NULL"
#old variable for arcpy.searchcursor
fieldascend = columnName + " A"

try:
    #Set editor environment workspace
    arcpy.env.workspace = 'Database Connections/DBO@CityworksGIS_Test.sde'

    #Old cursor:
    #rows = arcpy.SearchCursor('CityworksGIS_Test.dbo.WHYDRANT', noNullSql ,"","", fieldascend)
    #New cursor
    rows = arcpy.da.SearchCursor('CityworksGIS_Test.dbo.WHYDRANT', columnName, noNullSql, sql_clause=(None, 'ORDER BY ASSETID ASC'))
    dupValuesList = [] #List for holding empty values
    print 'Checking WHYDRANT for duplicate SampleID values'
    i = -1
    row = rows.next()
    value = row.getValue(columnName)
    for row in rows:
        if row.getValue(columnName) != value:
            value = row.getValue(columnName)
        else:
            dupValuesList.append(value)

    #Check duplicates and create report
    if len(dupValuesList) == 0:
        print 'No duplicates found moving on'
        del rows
        del dupValuesList
    else:
        raise ValueError('Duplicate AssetID values found in WHYDRANT')


texts: Creating random points using feature class points data within polygon using ArcGIS Desktop

texts:
I have ArcGIS Desktop 10.4.

I have a shapefile containing a number of polygons with specified attributes.
And a feature class containing a large number of points. both have a field in common.
Basically I want to generate the points in the map with the condition that the points that have X value in Y field, will be displayed in the polygon that has X value.

I tried the create random points tool but it doesn't satisfy my condition, it simply creates a number of random points within the map.


texts: Does arcpy.AggregatePoints_cartography create multiple polygons?

texts: Does this function allow you to put in an array of points, which may, or may not, be representative of many polygons, and create many polygons from it, or just the one, linked?


texts: Creating responsive interaction with tiled maps

texts:
I think I may have two conflicting aims but...

I need to create responsive Choropleth map very similar to  http://leafletjs.com/examples/choropleth.html or
http://www.texastribune.org/library/data/us-senate-runoff-results-map/

I need to take it down to county level of detail - like the texastribune example - but unlike the two examples above I cannot restrict the map to either a state or even a country. It has to have the show the detail globally.

To describe the whole world in GeoJson polygons down to the county/ postal area level would involve shipping an insane amount of data to the browser which has taken me down the route of using tiles and leaflet.js to orchestrate. This works well for providing a basic Choropleth map but I can't then see a way to display the additional data when you mouse over an area.

Is there any hybrid way of getting the best of both worlds


texts: Scale distortion in QGIS when printing to PDF/SVG

texts:
I do have a problem with saving my print-composition into PDF/SVG-Format (haven't checked image export yet, but I think the problem would be the same).

It turns out the measurements given for sheet size do not match the exported file:
E.g. I'm trying to save my plan on a Din A3 (297,0 mm x 420,0 mm) sheet, PDF format. The file created by QGIS measures 297,0 mm x 420,2 mm, which might not seem much, but causes "one-dimensional"-distorsions, as the whole length of the plot is stretched by this 2 mm, within the plan. This in the end makes my plot to not fit the given scale, which is crucial.

Anyone with the same problem and a workaround?
It does not help reducing the sheet size within QGIS by 2 mm, then it will magically add like 1 mm, or sometimes reduze it by the same. Also direct printing (could not acutally print it this way yet, but printed it into a PDF-printer) does have the problem.

Currently working with 2.14.1, double checked it with the newest version, same problem.

Could be, of course, that the sheet size does not cause the distorsions in the later print, so that there exist 2 problems: Wrong Sheet size given by QGIS, and (a non-QGIS-problem) with printing. Seems unlikely though.


texts: How to do the loop when using GRASS module r.water.outlet?

texts:
I have seen this post:Watershed Analysis with GRASS, and I have a .txt file which contains coordinates of many points, and I want to use r.water.outlet to get basin area of each point.

I type the following code in the post:

while read X Y; do
.... ;
done < cross_pts.txt

and in GRASS command line, it shows:

I already import the DEM file and successfully run r.watershed to get the drainage file in GRASS, but I do not know how to follow the guide in the post.

I am new to using command line and know nothing about bash script. How can I loop through all different coordinates? I am using GRASS 6.4.3 under windows8.


texts: What are some affordable hosting services for a webgis using?

texts:
A friend and I have been building, for the first time, a webgis that enables queries and visualizations of data. Our work looks a bit like this:

http://www.communityindicators.net.au/files/SingleMap/atlas.html

We used PostgreSQL, Leaflet library, and PHP Zend Framework. These may be different from the website above, but I just use it to give a better sense of the design. We've been in a good shape and are likely to be able to upload the website on internet soon.

I want to know about some hosting services that support PostgresSQL as we have limited experience in this. Affordability is the preference since our work is more a demo at this stage.


texts:
There are too many question on this issue, but unfortunately I couldn't get the solution. I have the following settings,

var geographic = new OpenLayers.Projection("EPSG:4326"); // WGS 1984
var mercator = new OpenLayers.Projection("EPSG:900913"); // Spherical Mercator Projection
var myExtent = new OpenLayers.Bounds(60, 23, 79, 37).transform(geographic, mercator);

map : {
        title : "Map",
        projection : mercator,
        displayProjection: geographic,
        extent: myExtent,
        restrictedExtent: myExtent,
        }

The problem is that it zooms to the wrong location, secondly the pan is also not available.


texts: Creating a buffer of colored map (OSM or Google maps) in a monochrome map in QGIS

texts:
I'm working with the OSM layer (black and white). I would like to create a buffer in which the OSM layer will become colored.

Is there any option to combine 2 different OSM layers at the same map?


texts: Printing to Python window of ArcMap using different font colors?

texts:
Can i highlight the print raster in different color? Below  I have attached the shapshot, where i trying to highlight in different color only print raster, I have underlined where i trying to put different color, I am running program on Arc GIS python window.

Code i am running : Instead of getting all result by print white color, i just want to print raster name in different color while its printing the name of raster along with statistics valu , so its easy to find out each raster

import arcpy
arcpy.env.workspace = r"D:\2008\JANUARY"
rasterList = arcpy.ListRasters()

for raster in rasterList:
     rasterObj = arcpy.Raster(raster)
     print raster

     bands = arcpy.GetRasterProperties_management(raster, "MEAN")
     print "MEAN VALUE: %s" %bands

My desire output, i have attached below. i highlight manually by yellow color, i just want to put some code to define the color of list of raster


texts: Spatial interpolation with breaklines in R

texts:
I have a dataset consisting of irregularly-spaced points (x,y,value) that represent an area of ocean that contains some land. I need to interpolate these to a regular grid, ensuring that the interpolation routine does not consider data points that are on the opposite site of a land barrier (e.g. the other side of a peninsular). I understand that this means that I need to insert "breaklines" in the data, and I have polygons of the coastline that I can use for this.

Do any R packages allow for spatial interpolation using breaklines? Ideally I think that natural neighbour interpolation would be the most appropriate for my dataset, but I suspect that the breaklines are more important than the interpolation method.


texts:
I tried to test the QGIS Offline Editing Plugin but it appears not to work at all.

I'm using qgis 2.14.3 running on a Lenovo Yoga 900 and Windows 10 on the client side. For the server I'm running Ubuntu 16.04 Postgresql 9.5 and PostGIS 2.2 on the same machine using Virtualbox 5.

The workflow: import a shapefile into PostGIS using QGIS desktop>DBManager. After loading the layer I Click the 'toggle editing' button and select a feature so that it is highlighted yellow. I then click the 'node tool' button, select a node and move it to a random spot. At this point, I do not save the change as I just want to ensure editing works for PostGIS. Editing seems to behave as expected for PostGIS layer.

I then select the layer in the 'Layers Panel', click the 'Database' menu item and select 'Offline editing>Convert to offline project'. A .sqlite file is created on my local drive and the Layer has '(offline)' appended to its title in the 'Layers Panel'.

Editing (Offline): I attempted to follow the workflow above however, when I select a feature another random feature is selected (highlighted yellow)! If I pan then others features are highlighted yellow as if panning changes the feature selected!! If I click the 'Node Tool' and try to select a node on the highlighted feature then no nodes are selected (stay as crosses and not cross and box) and the edit tools seems to stop working totally unless I reload the project file.

I have tried this on three separate layers including 2 polygon and one line. The behaviour is the same for all three layers.

I checked 'Log Messages Panel' under the 'Processing' tab I have this warning "OTB was not found or is not correctly installed." I'm not sure if the Offline Plugin uses Orfeo Toolbox??

I also found this post that seems very similar but there doesn't seem to a resolution:
Alternatives to Offline Editing Plugin of QGIS?


texts: Terminology for groupings/categories within ArcGIS Pro galleries?

texts:
In ArcGIS Pro 1.1.1, when I use the INSERT tab to insert a New Layout, I am offered a gallery of layout templates to choose from.

I think the terminology that I have used so far matches that found in ArcGIS Pro's Terminology and user interface reference guide.

I then, for example, want to choose the A3 template from the ISO - Portrait category.

Is the term category the correct one to apply here?

The Terminology and user interface reference guide does not seem to mention what term should be used to refer to any groupings within galleries.


texts:
I am trying to copy fgdb from one path to another using Python.

copy(base.gdb,dest)

And got the message:

Error Info:
[Errno 13] Permission denied:

How to fix it?


texts: R raster: masking a raster by polygon also remove cells partially covered?

texts:
I want to mask out a raster based on the values of a polygon: i.e., set to NA all values of the raster that are not covered by the polygons. However, it seems that raster::mask() masks out cells (i.e. set them to NA) even if they are partially covered?

This is similar to the question: Cropping a raster by a polygon - cells missing that are partially outside the polygon, but unlike crop(), mask() does not have the snap="out" option.

Check: here the right point of the triangle touches a cell, yet that cells is masked out.

library(raster)
library(sp)

r <- raster(xmn=1, xmx=5, ymn=1, ymx=5, nrows=4, ncols=4)
r[] <- 1:length(r)

Sr1 = Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2)))
Sr2 = Polygon(cbind(c(4.1,4,2),c(2,3,2)))

SpP = SpatialPolygons(list(Polygons(list(Sr1), "s1"), Polygons(list(Sr2), "s2")), 1:2)

plot(mask(r, SpP))
plot(SpP,  add=TRUE)


texts: How to increase number of results returned by QGIS locator bar

texts: In QGIS 3.x, the Locator bar can be used to perform various kinds of search. However, it only returns up to 6 results for searching 'Features in All layers'. How to force it to return all possible results?


texts: Saving TIFF file in database with GeoDjango

texts:
I am trying to save a TIFF file in database with GeoDjango, but I get weird errors at dem.save().

Versions:

Python: 3.7

PostgreSQL: 11

Django 3.0.2

django.contrib.gis.gdal.gdal_version(): 2.4.0

Code:

from api.models import Elevation
from django.contrib.gis.gdal import GDALRaster

path = options['path'][0]
f = open("example.tif", "rb")
bytes_read = f.read()
rst = GDALRaster(bytes_read, write=True)
dem = Elevation(name='Test', raster=rst)
dem.save()

Error:

GDAL_ERROR 6: b'Cannot extended in-memory file whose ownership was not transferred'
GDAL_ERROR 1: b'_tiffWriteProc:Success'
GDAL_ERROR 1: b'TIFFWriteDirectoryTagData:IO error writing tag data'
GDAL_ERROR 1: b'TIFFFetchDirectory:/vsimem/28170efa-d413-4308-85bb-f0fd0c815ae1: Can not read TIFF directory count'
GDAL_ERROR 1: b'TIFFReadDirectory:Failed to read directory at offset 1283354'
GDAL_ERROR 1: b'_TIFFVGetField:/vsimem/28170efa-d413-4308-85bb-f0fd0c815ae1: Invalid tag "Predictor" (not supported by codec)'
GDAL_ERROR 6: b'Cannot extended in-memory file whose ownership was not transferred'
GDAL_ERROR 1: b'_tiffWriteProc:Success'
GDAL_ERROR 1: b'TIFFWriteDirectoryTagData:IO error writing tag data'
GDAL_ERROR 1: b'/vsimem/28170efa-d413-4308-85bb-f0fd0c815ae1:LZW strip decoding is not implemented'
GDAL_ERROR 1: b'TIFFReadEncodedStrip() failed.'
GDAL_ERROR 1: b'/vsimem/28170efa-d413-4308-85bb-f0fd0c815ae1, band 1: IReadBlock failed at X offset 0, Y offset 0: TIFFReadEncodedStrip() failed.'


texts:
I am using the ArcGIS Javascript API (v3.15) for a basic use case of placing some markers with text on a map. I am able to add the marker, but I am running into issues inserting text on that marker.

Here is my code:

require([
  "esri/map",
  "esri/dijit/BasemapToggle",
  "esri/dijit/LocateButton",
  "esri/geometry/Point",
  "esri/symbols/SimpleMarkerSymbol",
  "esri/symbols/SimpleLineSymbol",
  "esri/symbols/Font",
  "esri/symbols/TextSymbol",
  "esri/Color",
  "esri/graphic",
  "esri/layers/GraphicsLayer",
  "dojo/domReady!"
], function(
  Map, BasemapToggle, LocateButton, Point, SimpleMarkerSymbol, Font, TextSymbol, SimpleLineSymbol, Color, Graphic, GraphicsLayer
) {
  map = new Map("map", {
    center: [mapval[0][2],mapval[0][1]],
    zoom: 18,
    basemap: "streets"
  });

  map.on("load", function() {
    var gl = new GraphicsLayer();
    var font = new Font("20px", Font.STYLE_NORMAL, Font.VARIANT_NORMAL, Font.WEIGHT_BOLDER);
    for (var i = 0; i < mapval.length; i++){
      var p = new Point(mapval[i][2], mapval[i][1]);
      var s = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 20,
        new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
        new Color([255,0,0]), 1),
        new Color([0,255,0,0.25]));
      var g = new Graphic(p, s);
      g.setAttributes({
        name: mapval[i][0]
      });
      gl.add(g);

      var t = new TextSymbol(mapval[i][0], font, new Color([0, 0, 0]));
      var g2 = new Graphic(p, t);
      gl.add(g2);
    }

    map.addLayer(gl);
  });

  var toggle = new BasemapToggle({
    map: map,
    visible: true,
    basemap: "satellite"
  }, "BasemapToggle");
  toggle.startup();

  var geoLocate = new LocateButton({
    map: map
  }, "LocateButton");
  geoLocate.startup();

});


texts:
I am trying to export my layer in a .dxf file. My code right now looks like this:
dxfExport = QgsDxfExport()
layers = [QgsDxfExport.DxfLayer(self.iface.activeLayer())]
settings = self.iface.mapCanvas().mapSettings()
dxfExport.setMapSettings(settings)
dxfExport.addLayers(layers)
dxfExport.setLayerTitleAsName(False)
dxfExport.setDestinationCrs(QgsCoordinateReferenceSystem("EPSG:2100"))
dxfFile = QFile('C:\\Users\\Desktop\\file.dxf')
dxfExport.writeToFile(dxfFile, 'utf-8')

What I would like to do though it's a bit more advanced. I would like based on the value of a column in the attribute table to have different layers in the .dxf file. If I have to make different layers and add the features corresponding to a different value on that column that's fine.
In the code above, even if I add more layers, there is only one LineString layer in the .dxf file.


texts: Converting POLYHEDRALSURFACE to (MULTI)LINESTRING or POLYGON?


texts: Creating scale bar in Km when map projection Decimal Degrees?

texts:
I want to add a scale into my map but it is not accurate. I've set View > Date Frame Properties to Kilometres and I set the scale to Kilometres but I think it is only showing Decimal Degrees.

How do I create a scale in ArcGIS that accurately reflects on-the-ground distances?


texts: Inaccurate rendering of shapes in Mapbox

texts:
I am trying to create an overlay of the streets of the US. The map streets v8 provided by Mapbox is missing some information that I need. So, I downloaded the OSM files (from here) and filtered out everything but roads. Now, I am trying to upload this data as a layer in Mapbox but the shapes are inaccurate. I tried different ways, like uploading GeoJSON files or Mbtiles files. Every time I get different shapes.

For example, this image shows 3 lines all representing the same road. The red one is created in Mapbox studio as a line shape. Black one is from an uploaded Mbtiles file and Blue is from an uploaded GeoJSON file of Alabama. The road starts from ["lat": 34.8174377, "lon": -86.9436697] to [ "lat": 34.8175178, "lon": -86.9439487]. You can view the original this road here.

Have anyone encountered a problem like this with Mapbox or any other map provider? Is there a short fix for this?


texts: How to load sample points or coordinates on GPSMAP 62s?

texts:
Does anyone know how to upload 100's of sample points or coordinates from the GPSMAP 62s series to a computer?

Does anyone also know the steps to create beeps or alarms when we approach these points in field?


texts:
Do you know the date when google launched that API:
https://developers.google.com/earth/


texts: Mixed raster and text printing in QGIS print composer

texts:
Making PDF maps in QGIS with print composer I often include a link that leads to a live Google map of the meeting location for the group using the map. The maps can include a marked up raster map sitting on top of a Google street map or satellite view with further label and logos added in print composer.

If I check the print composer box to "Print as raster" the PDF file is compact and fast but link text is an image and not recognised as a link.  If I leave the box uncheck, the PDFs then have multiple layers, balloon in size and become much slower to render.  There is an awkward workaround so the link is recognised, print the map as a tif, load that back onto QGIS, uncheck almost everything then print again. This method however degrades the map quality.

What I am looking for is a way to print the map and all composer items except the box with the link as raster.  Any suggestions?


texts:
I'd like to create polygon shapefiles to communicate elevation information on regional maps. I find these draped over a hill shade layer provide one of the best base maps.

I can tell some cartographers are creating these by hand by digitizing vector features over raster maps, but others are clearly created automatically.

Currently, I am using the following procedure:

Convert contour lines from a single part to multipart
Polygonize multipart contour lines
Join contour data to new polygonized contours
classify based on elevation
simplify as required

I'm having a couple of problems creating these layers (in QGIS):

Creating polygons from closed contour lines (not line segments) is fine, but if the line has a start and end point, it is not a feature with an area that I can create a polygon from.
Contour interval data is dropped during conversion, so I have to join the original contour lines to the new polygons to include this information.

I think I have ways around all these problems, but I'd like a quick and easy way to do these conversions since it's a procedure I plan to do for many locations.

Does anyone know of a script that may expedite this process, or a guide demonstrating the preferred way to achieve this result?


texts: Rasterize function from GDAL in Python has problem with "GetGeoTransform"

texts:
I'm trying to rastrize a shapefile that I have.
I read the shape using GeoPandas. I would like to give the new raster values based on the shape column called "class" which has numerical class value based on another field :

I have tried to do this process using rastrize with the following function:
def rasterise_me(raster, vector, attribute,
                fname_out="", format="MEM"):
    """Rasterises a vector dataset by attribute to match a given
    raster dataset. This functions allows for the raster and vector
    to have different projections, and will ensure that the output
    is consistent with the input raster.

    By default, it returns a handle to an open GDAL dataset that you
    can e.g. `ReadAsArray`. If you want to generate a  GTiff on disk,
    set format to `GTiff` and `fname_out` to a sensible filename.

    Parameters
    ----------
    raster: str
        The raster filaname used as input. It will not be overwritten.
    vector: str
        The vector filename
    attribute: str
        The attribute that you want to rasterize. Ideally, this is
        numeric.
    fname_out: str, optional
        The output filename.
    format: str, optional
        The output file format, such as GTiff, or whatever else GDAL
        understands
    """
    # Open input raster file. Need to do this to figure out
    # extent, projection & resolution.
    g = gdal.Open(raster)
    geoT = g.GetGeoTransform()
    nx, ny = g.RasterXSize, g.RasterYSize
    srs = g.GetProjection()
    min_x = min(geoT[0], geoT[0]+nx*geoT[1])
    max_x = max(geoT[0], geoT[0]+nx*geoT[1])
    min_y = min(geoT[3], geoT[3] + geoT[-1]*ny)
    max_y = max(geoT[3], geoT[3] + geoT[-1]*ny)
    # Reproject vector to match raster file
    vector_tmp = gdal.VectorTranslate("", vector, format="Memory",
                                    dstSRS=srs)
    # Do the magic
    ds_dst= gdal.Rasterize(fname_out, vector_tmp, attribute=attribute,
                        outputSRS=srs, xRes=geoT[1], yRes=geoT[-1],
                        outputBounds=[min_x, min_y, max_x, max_y],
                        format=format, outputType=gdal.GDT_Int32)
    return ds_dst

but I always get the same error:

AttributeError                            Traceback (most recent call last)  in
----> 1 rasterise_me("path\to\tiff.tif", "path\to shape.shp", "class")  in rasterise_me(raster, vector,
attribute, fname_out, format)
28     # extent, projection & resolution.
29     g = gdal.Open(raster)
---> 30     geoT = g.GetGeoTransform()
31     nx, ny = g.RasterXSize, g.RasterYSize
32     srs = g.GetProjection() AttributeError: 'NoneType' object has no attribute 'GetGeoTransform'

I don't really understand why I get this error and how can I solve it
My end goal: To create new raster based on my shapefile class values.
If any more information regard what I did before is needed I would love to give it, but unfortunatly can't share the shapefile.


texts: MapBasic, MapInfo Pro automation of existing Raster Operations

texts:
I have the latest version of MapInfo Pro and I would like to know if it is possible to fully automate the use of existing Raster operations into several files at once?

For example, having several hundred raster files such as .grd with a specific coordinate system, I would like to create a batch file that would call on the "Reproject" feature available in the raster operation to execute that feature on hundreds of files instead of me doing it manually for each .grd file.

Is it possible to do so, and is it possible to do it on any Raster operation available in MapInfo Pro?


texts: I am looking for a complete tutorial in QGIS (lisboa version)?

texts:
I am looking for a complete tutorial in QGIS (lisboa version) ??

Can you show me any website where I can download this tutorial?


texts: apache httpd mod_tile error: "Failed to create shared memory segment on file"

texts:
This question may seem out of place, but it appears it's coming from mod_tile, so thought I'd give it a shot here.. (I also haven't managed to get answers elsewhere..)
Started getting this error once a week during logrotate, when it was attempting to reload apache httpd server:

[Sun Jul 23 03:27:25.301291 2017] [tile:error] [pid 19728:tid 140568496863200] (17)File exists: Failed to create shared memory segment on file /tmp/httpd_shm.19728

Tried switching to stop, sleep 10, start -- does not help.
Running apache httpd 2.4.6 on centos 6 ..


texts: Does PyGeoprocessing need to be installed?

texts:
I have not found much documentation on PyGeoprocessing, but from what I have read, I would like to try it out.  I downloaded the package from here . . . https://pypi.python.org/pypi/pygeoprocessing.
One of the links indicates that it's a wheel file, but when I downloaded it, the source is what I got (no .whl file).

Does this utility need to be installed or do you just use the python scripts without installing it first?

I do have all of the prerequisites installed (numpy, scipy, etc.).
I don't know how many people out there are familiar with PyGeoprocessing, but I hope someone is.


texts: Clear Vector source without recursively calling the sources loader method

texts:
OpenLayers v4.6.5:

       var source = new ol.source.Vector({
            format: new ol.format.GeoJSON(),
            loader: function() {
                return $.ajax({
                  url: myURL
                }).then(function(response){
                   var geoJsonReader = new ol.format.GeoJSON();
                   var newFeatures = geoJsonReader.readFeaturesFromObject({
                     type: "FeatureCollection",
                     features: response.features
                   });
                   source.clear(); /** This calls the loader recursively */
                   source.addFeatures(newFeatures);
                });
            },
            strategy: ol.loadingstrategy.bbox
        })

In the code above, I try to re-add all newly retrieved features every time the source is loaded, after clearing the source.
However, every time I call the clear method on the source, the loader gets triggered againg (via the changed event), leaving me in an endless recursion. How do I avoid that?

This is the respective stack Trace:

ol.source.Vector.clear  @   js:62564
onFeatureCollectionLoaded   @   js:110894
(anonymous) @   jquery.min.js:2
i   @   jquery.min.js:2
fireWith    @   jquery.min.js:2
y   @   jquery.min.js:4
c   @   jquery.min.js:4
XMLHttpRequest.send (async)
send    @   jquery.min.js:4
ajax    @   jquery.min.js:4
query   @   js:113058
getData @   js:110862
loader  @   js:110523
ol.source.Vector.loadFeatures   @   js:62947
ol.renderer.canvas.VectorLayer.prepareFrame @   js:33475
ol.renderer.canvas.Map.renderFrame  @   js:28899
ol.PluggableMap.renderFrame_    @   js:21137
(anonymous) @   js:20052
requestAnimationFrame (async)
ol.PluggableMap.render  @   js:21028
boundListener   @   js:9705
ol.events.EventTarget.dispatchEvent @   js:10125
ol.Observable.changed   @   js:10293
ol.layer.Group.handleLayerChange_   @   js:19705
boundListener   @   js:9705
ol.events.EventTarget.dispatchEvent @   js:10125
ol.Observable.changed   @   js:10293
ol.layer.Layer.handleSourceChange_  @   js:21816
boundListener   @   js:9705
ol.events.EventTarget.dispatchEvent @   js:10125
ol.Observable.changed   @   js:10293
ol.source.Vector.clear  @   js:62564
onFeatureCollectionLoaded


texts: In ArcGIS 10.6, How do I remove FID columns from automatically being created/inserted during Merge?

texts:
When I go to merge some polygons, it automatically adds an FID for each polygon as a column. It takes forever to go through and delete each FID for the output. Two questions: Is there a way to prevent Arc from adding each FID column to the output during the merge step? If not, is there a quick way to delete all of them?

This might be an easy fix, but I've been working on it longer than I would like...

Attribute Table Output

Merge Inputs


texts: QGIS Essen vs Wien discrepency in saving tiff

texts:
In QGIS 2.8.4 Wien, when I right click a layer and save the rendered image with the create VRT option enabled, QGIS creates both a .vrt and .tif file.  However, when I do that in QGIS 2.14.0 Essen, only the .vrt is created and I'm not sure why the exact same steps produce different results in the versions.

Has anyone else run into this problem?


texts: Merging several polygons located at same place in same layer using QGIS?

texts:
This is my problem that I first present using a Screenshot:

In a layer, I have many cases of figures like this one:
Polygons that overlap in the same place. Each of its polygons represents different data and they have no common columns. My question is twofold:

I would like to create a column in the attribute table that would give an identical identifier to all polygons in the same place.
In addition, I would then like to count the number of polygons that overlap in the same place.

I could do this manually by selecting polygons with the location or intersect function but this is not possible due to the very large size of my dataset.
I can't use tools like merge/union because it overwrites my various data.

Do you have any ideas?


texts:
I am shifting from QGIS to GRASS GIS. I believe GRASS GIS enables better automatization and QGIS basically uses a bunch of GRASS GIS functions anyway.

However, the change is not as smooth as I thought it would. Knowing that I am already familiar with shell scripting, what would be, in your opinion, the best way to start using GRASS, working with the GRASS GIS GUI or directly with the GRASS shell?


texts: Conversion of ASTER GDEM data for CFD Analysis

texts:
I need to do a computational fluid dynamics (CFD) analysis of wind over a large area of land. I have obtained the necessary tiles from the ASTER GDEM data set (in .tif format) and was wondering how I would go about converting this data into a 3D model which would be accepted by a CFD package such as ANSYS Fluent.

Thanks for your help.


texts: In QGIS have an issue with my contour value labels being pushed to the edge of my map, instead of lining up at the center where they seem to have more space. Does anyone know why this happens for some and not all? Can someone help me to get them all centered? Please see the attached image.


texts: Is there a way to create attribute subdomains in ArcGIS with clauses?  For example, if I'm editing a line feature class of pipes, I create a domain for the pipe type to be either plastic or metal. I want to setup another domain field "Rusted" with a yes/no value. When editing the data in ArcMap, if the pipe is metal, I should get a yes/no coded value option on the "Rusted" field. If it is plastic, I want the "Rusted" field to calculate N/A or perhaps give me other options.


texts:
I updating one of the parameters in my ArcGIS Python toolbox with data from SQL Server, but am getting an illegal list value error. I have removed a lot of the 'special' characters, but am thinking there should be a list of what constitues an 'Illegal list value'. Does anyone know?

  ERROR  Traceback (most recent call last): File "", line 276, in
  updateParameters ValueError: FilterObject: illegal list value


texts: GeoPandas: interpolate for time X in timeseries

texts:
I've got some position data as a dataframe per target. Dataframe for target A:

  index   TimeOfFix   Lat Lon geometry
  0   1478133083  -27.1124    34.3203 POINT(34.3203 -27.1124)
  1   1478133085  -27.1124    34.3202 POINT(34.3202 -27.1124)
  2   1478133094  -27.1124    34.3229 POINT(34.3229 -27.1124)
  3   1478133610  -27.1124    34.3355 POINT(34.3355 -27.1124)
  4   1478133611  -27.1124    34.3354 POINT(34.3354 -27.1124)
  5   1478136813  -27.0822    34.3303 POINT(34.3303 -27.0822)

How can I go about interpolating a position for each target for time X. I see that pandas has a resample method to fill in, or average, data to a uniform sampling time. I don't really care about uniformity, I just want a estimation of (lat,lon) at time X. Most of the targets move in straight lines so a linear interpolation would be fine.

The gaps in the data can be quite large, spatially, so getting the right projection becomes important.


texts: Issue with WebADF Application on Windows Server 2008

texts:
I am trying to resolve this issue with a custom WebADF application that I have migrated from 931 to 10. The appl works fine in Development environment but when deployed on the server, it is throwing an IndexOutOfRangeException. I have traced this error on the server but still don’t see what may be causing this. At this point I am sure that this is an issue with Deafult.aspx. I am not sure if this is related to 32/64 bit in anyway.  Since appl is working fine in development environment, I may be still missing something on the server side.

Appreciate any feedback.

Thanks
jay

Test Environment
Windows XP
Visual Studio 2008

Server environment:
ArcGIS Server 10
Windows Server 2008 R2 Standard
IIS 7

Session State
Session Key Type Value
/default.aspx_RefreshUpdatePanel ESRI.ArcGIS.ADF.Web.UI.WebControls.RefreshUpdatePanel ESRI.ArcGIS.ADF.Web.UI.WebControls.RefreshUpdatePanel
/default.aspx_RefreshUpdatePanel_ID System.String Toolbar1
/default.aspxResults$TaskResults1_nodes ESRI.ArcGIS.ADF.Web.UI.WebControls.TreeViewPlusNodeCollection ESRI.ArcGIS.ADF.Web.UI.WebControls.TreeViewPlusNodeCollection
/default.aspxToc_Panel$Toc1_nodes ESRI.ArcGIS.ADF.Web.UI.WebControls.TreeViewPlusNodeCollection ESRI.ArcGIS.ADF.Web.UI.WebControls.TreeViewPlusNodeCollection
/default.aspxMapResourceManager1_ValidationTimeOut System.Int32 6000
/default.aspxMagnifier1_MagMap System.String Map1
/default.aspxTaskManager1$PrintTask_VBNet1_title System.String Print
/default.aspxTaskManager1$FeatureSearchTask2_title System.String Feature Search
/default.aspxTaskManager1$SpatialSearchTask1_title System.String Spatial Search
/default.aspxTaskManager1$OpenAttributeTableTask1_title System.String Open Attribute Table
/default.aspxTaskManager1$PostPoints1_title System.String Post User Points
/default.aspxTaskManager1$GeoprocessingTask1_navigationPath System.String
/default.aspxTaskManager1$GeoprocessingTask1_title System.String Buffer Points
/default.aspxTaskManager1$GeoprocessingTask2_navigationPath System.String
/default.aspxTaskManager1$GeoprocessingTask2_title System.String Buffer Lines
ErrorMessage System.String Page_Error
Error System.IndexOutOfRangeException System.IndexOutOfRangeException: Index was outside the bounds of the array.    at WebMapApplication.Page_Load(Object sender, EventArgs e)    at System.EventHandler.Invoke(Object sender, EventArgs e)    at System.Web.UI.Control.OnLoad(EventArgs e)    at System.Web.UI.Control.LoadRecursive()    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


texts: Programming a new WMS request with geoserver source code

texts:
I want to get in touch with the geoserver source code and my first task would be to create a new request for WMS. I already set up the geoserver source code in eclipse.

So when using this URL to get the capabilities:
http://localhost:8080/geoserver/wms?REQUEST=GetCapabilities

I want to get the same capabilities but for another URL:
http://localhost:8080/geoserver/wms?REQUEST=GetSomething

So how do I change the request keywords in the source code. Someone has some hints about that? I try to understand this complex source code so I will be happy about any help.


texts:
I would like to display some layer according to max and min zoom levels. I tried with the method min / max zoom and resolution but without success.

I specify that I use vector tiles.

Here is my code:

// Courbe de niveau (Mbtiles)
var layerIso = new ol.layer.VectorTile({
  source: new ol.source.VectorTile({
    format: new ol.format.MVT(),
    url: 'http://localhost:8085/data/courbe50/{z}/{x}/{y}.pbf',
    minResolution: 10
  }),
  style: function (feature, resolution){
      var ISO100 =  new ol.style.Style({
        stroke: new ol.style.Stroke({ color: '#1c8b00' })
      });
      var ISOERROR =  new ol.style.Style({
        stroke: new ol.style.Stroke({ color: '#ba4646' })
      });

      if (feature.get('elevation')  % 200 === 0 ) {
        return [ISO100];
      }
      else {
        return [ISOERROR];
      }
  },
});

map.addLayer(layerIso);


texts: Species occurrence - from dots to 10X10km grid cells in QGIS

texts: I have a map of species occurrences with dots, where each dot represents a registration of a species. I also have a 10x10km grid cell layer of the area. I want a map only containing grid cells where there is an overlap between the dots and the grid. Each grid has an ID.


texts: Fading or Removing Boundaries in ArcMap?

texts:
I have a dot density map of a county. I need to either fade or remove the tract lines. I can adjust the frame transparency but that's not what I'm after.

I'm using ArcGIS 10.2 for Desktop.


texts: What is the best way to extract the highest dimension geometry from a GEOMETRYCOLLECTION?

texts:
I am looking for the best approach to convert a GEOMETRYCOLLECTION to MULTI* geometry type using the highest dimension geometry in the collection.

So basically a ST_CollectionExtract where the second parameter is automatically chosen.

I am using PostGIS 2.3 and I also have these functions loaded: https://github.com/pedrogit/postgisaddons


texts: I have created a model that converts .gpx's to shapefiles and changes the projection. Each shapefile has the same output as the .gpx's input. Instead of deleting the original shapefile and renaming the projected file, my model is deleting the very last shapefile it creates. All other files in the folder are converted, projected and renamed correctly though. How can I fix this issue?


texts: ArcGIS Python API zoom_to_layer() attribute error

texts:
I am working with the ArcGIS API for Python mapping widget within the ArcGIS jupyter notebook environment. I've successfully connected to my organization's enterprise portal, grabbed content, mapped it, and set the zoom level manually (see code below). The problem is when I try to zoom to the added layer, at which point I receive the error:
AttributeError: 'MapView' object has no attribute 'zoom_to_layer'
According to the arcgis.widgets documentation page and other Esri tutorials I've seen zoom_to_layer() exists and I'm using the correct syntax - map.zoom_to_layer(layer).
The only thing I can think of is that since my installation of the API is what comes with ArcGIS 10.7.1 (API version 1.6.1) whereas all the online API documentation pages are for version 1.8.2. Is zoom_to_layer() a function that was implemented between those two versions? Or can anyone else think of other reasons why this might be erroring?
gis = GIS("portal_url", username="my_username")
contentItem = gis.content.get('content_string')
contentLayer = contentItem.layers[0]
m = gis.map()
m.add_layer(contentLayer)
m.zoom_to_layer(contentLayer) #this errors
# m.zoom = 14 #this works fine
m


texts: Feature Selection Using Custom Python Expression Functions in QGIS 2.18

texts:
I'd like to write an expression function in QGIS 2.18 to select features based on the value of their attributes. How can I access attribute values within my function?

I have noticed that in QGIS 2.18.x, the selection does not seem to work when accessing feature attributes as feature['attribute'].

For example, I tried the following functions to select features from Natural Earth's Populated Places Simple dataset. The three functions below select all the capital cities in QGIS 2.14.12, but no features are selected in QGIS 2.18.7.

@qgsfunction(args=0, group='Custom')
def select_country_capitals_1(value1, feature, parent):
    """ Select all the capital cities """
    return feature['featurecla'] == 'Admin-0 capital'

@qgsfunction(args=0, group='Custom')
def select_country_capitals_2(value1, feature, parent):
    return feature[3] == 'Admin-0 capital'

@qgsfunction(args=0, group='Custom')
def select_country_capitals_3(value1, feature, parent):
    return feature.attributes()[3] == 'Admin-0 capital'

Agreed that the above is possible with a simple query "featurecla" = 'Admin-0 capital' from the expression engine, but I would like to access attribute values within the function and perform some further computation.


texts:
I already tried to find the solution for my problem in any of the previous answers for similar problems, but none of it works for me.

I have two polygon shapefiles and would like to do a spatial join based on a certain field.

One polygon shapefile contains count-data for different dates. Each polygon refers to a certain date, but there could be several polygons for the same date at different locations. Each polygon is in a different row, so the date is also shown in rows.

Then I have a second polygon shapefile containing the cropstatus for different fields (parcels) at different dates of the year. The different fields (parcels) and corresponding information are listed in rows and the date with the corresponding cropstatus is in columns.

Now I would like to spatially join the count-data polygons with the cropstatus polygons based on a certain date (using the centerpoint of the count-data polygons).
The result should be a new file with all count-data-polygons having a certain cropstatus at the appropiate date.

Unfortunately, I don't have any experience with Python scripting.

I'm using ArcGIS 10.2 and Windows 7

Here is an example of my data:

Pink circles/ellipses are birdcounts on different days and/or areas, and the filled polygons indicate different fields (parcels). Different colours have different cropstatus/fieldstatus.

And here are examples of my attribute tables:

These are the bird counts with polygons for different days and/or areas (Antal...=Number of birds).

This is the attribute table of the cropstatus. The different fields (parcels) are in lines and the date of the field status is in columns (fields).

Both attribute tables have much more columns than shown here with further information. Also, the dates for the cropstatus range from 13.Sept.2013 to 31.Dec.2013, so Johns suggestion of spatially joining each date separately will take too long.


texts: Compare same values and keep biggest number's value in another column?

texts:
Here is an example to explain what I mean:

I want from this:

    index  area key
0      1    50  1f
1      2    60   2
2      3    70  3d
3      5    80   4
4      1    90   5
5      2   100   6
6      3    10   7
7      3    20   8
8      3    70   9

to go to this:

     index  area key key1
0      1    50  1f    5   <--new 'key1' column that keeps the value from 'key' where same
1      2    60   2    6         numbers in 'index' have the largest area.
2      3    70  3d   3d
3      5    80   4    4    Example: Checks all 2 in index field which has the largest area
4      1    90   5    5  since the largest area with index 2 has 100 in 'area' the'key1'
5      2   100   6    6  field takes 5 in both positions.
6      3    10   7   3d
7      3    20   8   3d
8      3    70   9   3d

I have managed to do this using pandas: This makes the first table:

import pandas as pd   # Think this as a shapefile's attribute table
df = pd.DataFrame({"index": [1,2,3,5,1,2,3,3,3], "area":
[50,60,70,80,90,100,10,20,70], "key": ["1f",2,"3d",4,5,6,7,8,9]})
print (df)

And this makes the result:

df["rank_a"] = df.groupby("index")["area"].rank(ascending = False, method = "first")
df["key1_temp"] = df.apply(lambda row: str(row["key"]) if row["rank_a"] == 1.0
else "", axis = 1)
df["key1"] = df.groupby("index")["key1_temp"].transform("sum")
print (df[["index", "area", "key", "key1"]])

Purpose

I want to make this in ArcPy.


texts: How to rendering and manipulate GeoTIFF image in iOS devices?

texts:
I am experienced iOS developer but I am new to geographical information manipulation. I am developing an iOS application that require me to render a geotiff image file (as a map) and be able to edit the map by placing different objects. And export it as a XML file. Can anyone please recommend me some libraries that can help me with it.

iPad mapping application with custom maps

The answers in this question talk about different application that does that. But I am building an app, so I need libraries/SDK that enable this.

Is ArcGIS a good choice?


texts: Removing duplicate values within rows using ArcPy?

texts:
How can I remove duplicate values within a text field using ArcPy?

The following example shows a list of numbers for each row in a featureclass, some with duplicate numbers.

I am aware of UpdateCursors (code snippet below), however, I am unsure how to remove the duplicate numbers that happen to be in string format.

with arcpy.da.UpdateCursor(fc, ("field")) as cursor:
    for row in cursor:


texts: Why do pixel (cell) values change for 32 real NDVI values when taking from Multispec to QGIS?

texts:
Landsat 5 values change from normal NDVI -1 to 1 when created in Multispec as a 32 bit signed data image.  When adding the raster layer in QGIS, the value range changed to 0-255.  How does one properly export the image from Multispec into QGIS to maintain pixel values obtained in Multispec?

After TOA and DOS1 were applied to the raw data, red and near infrared bands values ranged between 0.007 and 0.818.

AREA_OR_POINT=Area
TIFFTAG_IMAGEDESCRIPTION=Generated by MultiSpecWin32_12.17.2014 on 07-29-2015 19:12:31 |
TIFFTAG_RESOLUTIONUNIT=1 (unitless)
TIFFTAG_XRESOLUTION=1
TIFFTAG_YRESOLUTION=1
Band 1
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=79.410480872596
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=65.984417579303
Dimensions
X: 781 Y: 748 Bands: 1
Origin
654045,5.84688e+06
Pixel Size
30,-30
No Data Value
*NoDataValue not set*
Data Type
Byte - Eight bit unsigned integer
Pyramid overviews
Layer Spatial Reference System
+proj=utm +zone=18 +south +datum=WGS84 +units=m +no_defs
Layer Extent (layer original source projection)
654045.0000000000000000,5824435.0000000000000000 : 677475.0000000000000000,5846875.0000000000000000
Band
Band 1
Band No
1
No Stats
No stats collected yet


texts: Problem to read geometry from SQL Server

texts:
I'm working with SQL Server on a GIS system, and I have a table that has for each row a polygon which delimits an area. I need to read theses values and put them on my map that I'm building with OpenLayers. But I'm having serious problems reading the values. OpenLayers seems not be able to read EPSG:29193 and convert to EPSG:3857.

Is there something that I could do?

Before anything else, I CAN NOT use ArcGIS, GeoServer, or whatever, I HAVE to use only SQL Server to read these polygons (which are stored as array of bytes) and OpenLayers only because the client has serious limitations.

If I use ToString() on the column name it return something like this

POLYGON ((611529.71889999975 7812359.7381, 611515.02589999977 7812357.5313, 611518.44199999981 7812328.4877, 611542.00299999956 7812331.4384, 611529.71889999975 7812359.7381))

But none of these values take me to somewhere that make sense.

I used this point 611529.71889999975 7812359.7381 at the website epsg.io with the described projection (EPSG:29193) and it shows the correct place, but when I try to do the same with openlayers does not works.


texts: Inspecting Segment Attributes with Training Data using ArcGIS Pro

texts:
I'm using ArcGIS Pro to undertake object-based image analysis. I'd like to take this to the next level by doing some deeper statistical analysis on my segmented rasters to analyse how different segment attributes appear in different classes.
I currently use the 'Compute Segment Attributes' tool which gives me a nice table of all segments and their attributes - however it's a bit onerous to then join this data to my actual training data polygons. My workaround is to convert my segments to polygons using segment ID, then do a spatial join between my training data and the segments, then finally join the segment attributes to each training polygon using the segment ID. However this gets a bit process-heavy when my images get large (>1,000,000 segments).
Is there an easier/quicker way to do this? Ideally we'd be able to use the training data as input to the compute segment attributes tool so the output already had a class field in the table, but don't think this is possible in Pro.
Note: I know this is possible in eCognition but currently looking for a solution in Pro or open-source software.


texts:
I am receiving a 999999 error each time that I attempt to run Zonal Statistics as Table. I am attempting to overlay population data from an asc file with a shp file with French Alsatian municipal boundaries delineated as features. I am working on arcmap 10.6

I converted the asc file to a raster (with the "ASCII to Raster" tool) and then used it as the input value raster in the Zonal Statistics as Table tool. I use a shp file for the feature zone data. I have found that I get an error if leave the processing extent set to Default, but this goes away if I set it at the extent of the (asc) input value raster.

I think that the issue may be stemming from the asc file used for the input value raster. Its properties indicate that it has an "Undefined" spatial reference, and the shp file used to input feature zone data has not produced this 999999 issue when used with other non asc files.

I also get the following message box when I first create a layer from the asc file in question:

  The following data sources you added are missing spatial reference
  information. This data can be drawn in ArcMap, but cannot be
  projected.

I have followed the directions from https://community.esri.com/thread/47038; Neither selecting a coordinate system from the properties window nor using the "define projection" tool has resolved this issue.

One other potential lead is that the issue stems from the relative size of the shp projection vs that of the asc; When I zoom to the layer of the asc file, I have to scroll out from 1;1081 to about 1:50,000,000 before the shp file in question even appears in view. By that point the world map from the asc file is too small to be visible.

[edit]: Here are a few pictures to depict what I said about the raster and shapefile not overlapping.


texts: Getting directory path from QgsFileWidget using PyQGIS

texts:
I use Plugin Builder and Qt Designer to create a plugin on QGIS.
I would like to export a PDF file with results of processing. I try to use QgsFileWidget, to get the directory, but I cannot connect the plugin_dialog_base.ui file on plugin.py, to take the user directory to the 'OUTPUT': line for export the PDF file.
How do I connect QgFileWiget in the interface?


texts: ArcGIS Silverlight QueryTask Fails After Upgrade to ArcGIS Server 10.2.2

texts:
Our ArcGIS Server was upgraded to 10.2.2 yesterday and the QueryTasks in my Silverlight code fail with Error Code '400': 'Unable to complete operation.'

The REST services are online and running and I've verified that the URLs are correct.

The QueryTasks worked just fine before the upgrade.

Has anyone else run into this problem?


texts: Is there any plugin for QGIS to calibrate contrast and brightness of a raster layer?

texts:
I frequently need to deal with the contrast and brightness of raster layers in QGIS and I miss the tools in ArcGIS for this task. Should there be a plugin already developed for QGIS? If there is, where can one find it?
Regards.


texts: Polygons from PostGIS table won't highligt in QGIS

texts:
QGIS 2.14.1 / PostGIS 2.2.1

I have a table with polygons and a view on this table in PostGIS. When I select the features from the view in QGIS with Identify Features, the objects highlight on the map.

When I identify the same features from the table they won't highlight.

The table has a primary key, the view doesn't.

The table was created with FME and the view was created by hand in SQL.

I don't know how highlighting works under the hood but my best guess is a select statement. Probably based on OIDs. The table doesn't have OIDs. Enable OIDs in PgAdmin didn't solve the problem.

Can someone point me in the right direction?


texts: Defining no data in qml style file or python for QGIS

texts:
I am attempting to script a process that I undertake quite frequently, and have got everything working apart from one little step.

Essentially I want to convert a singleband raster into a 3 band geotiff based on a qml style file.

This is working, apart from the fact that No Data needs to be displayed as 255,0,255. If for example the No Data value is 15, I define this in the symbology, but the qml doesn't save the checkbox "No data value" setting which needs to be unchecked in order to display the no data. As a result, my 3 band geotiff displays no data as black instead of pink.

I was wondering if there is a way to integrate this step into my script? I use the python-qgis.bat file from OSGEO4w in C:\OSGeo4W64\bin to run this in command prompt.

Below is the script that exports as rendered image based on my style file, then removes 4th band that is created.

import qgis
from qgis.core import *
from qgis.utils import *
from qgis.gui import *
from PyQt4.QtGui import *
from PyQt4.QtCore import *
QgsApplication.setPrefixPath("C:/OSGeo4W64/apps/qgis", True)
app = QApplication([], True)
QgsApplication.initQgis()
rasterpath = "C:\Users\folderpath\1bandraster.tif"
layer = QgsRasterLayer(rasterpath, "rastername")
QgsMapLayerRegistry.instance().addMapLayer(layer)
uri = "C:\Users\folderpath\stylefile.qml"
layer.loadNamedStyle(uri)
extent = layer.extent()
width, height = layer.width(), layer.height()
renderer = layer.renderer()
provider=layer.dataProvider()
crs = layer.crs().toWkt()
pipe = QgsRasterPipe()
pipe.set(provider.clone())
pipe.set(renderer.clone())
file_writer = QgsRasterFileWriter('C:\Users\folderpath\4bandraster.tif')
file_writer.writeRaster(pipe,
                       width,
                       height,
                       extent,
                       layer.crs())
import os
os.system('gdal_translate -co COMPRESS=LZW -of GTiff -b 1 -b 2 -b 3 C:\Users\folderpath\4bandraster.tif C:\Users\folderpath\OUTPUT-3band.tif’)

[


texts: Converting shapefile to raster by passing specific column/variable using GDAL in Python

texts:
Followed the steps from this link to create raster from shapefile using GDAL
Convert an OGR File to a Raster
but it is returning an empty raster.
Can someone tell how to define a particular column from the shapefile data to burn?
The code is as follows
import gdal
from osgeo import osr
from osgeo import ogr

raster_path = 'D:\SWAT_HRU_Test\SWAT_Bihar\Bihar_shapefile_python\Full_HRU_GCS_output.tif'

shapefile = 'D:\SWAT_HRU_Test\SWAT_Bihar\Bihar_shapefile_python\Full_HRU_GCS.shp'
source_ds = ogr.Open(shapefile)
source_layer = source_ds.GetLayer()
pixelWidth = pixelHeight = 0.01
x_min, x_max, y_min, y_max = source_layer.GetExtent()
cols = int((x_max - x_min) / pixelHeight)
rows = int((y_max - y_min) / pixelWidth)
target_ds = gdal.GetDriverByName('GTiff').Create(raster_path, cols, rows, 1, gdal.GDT_Float32)
target_ds.SetGeoTransform((x_min, pixelWidth, 0, y_max, 0, -pixelHeight))
target_dsSRS = osr.SpatialReference()
target_dsSRS.ImportFromEPSG(4326)
target_ds.SetProjection(target_dsSRS.ExportToWkt())
band = target_ds.GetRasterBand(1)
band.SetNoDataValue(-9999)
gdal.RasterizeLayer(target_ds, [1], source_layer, options=["ATTRIBUTE = HRUGIS"])
### this HRUGIS is a column in the shapefile on the basis of which i want to create the raster but it is returning a raster with all values 255
target_ds = None


texts: Uploading item/file as hosted layer to ArcGIS Online using ArcREST?

texts:
I am using ArcREST python package, specifically the add_item.py example to upload a shapefile to ArcGIS Online (AGOL).

The example is straightforward and I have successfully uploaded a shapefile to my org account.

However I want to be able to upload it as a hosted layer so that I can immediately pull the ArcGIS REST Services URL that is created when you would otherwise normally add an item on AGOL and check the box "Publish this file as hosted layer".

Perhaps there is an item parameter I am missing or something of that sort.

usernameInput = raw_input("Please enter your username: ")
passwordInput = raw_input("Please enter your password: ")

securityinfo = {}
securityinfo['security_type'] = 'Portal'#LDAP, NTLM, OAuth, Portal, PKI
securityinfo['username'] = usernameInput
securityinfo['password'] = passwordInput
securityinfo['org_url'] = "http://www.arcgis.com"
securityinfo['proxy_url'] = proxy_url
securityinfo['proxy_port'] = proxy_port
securityinfo['referer_url'] = None
securityinfo['token_url'] = None
securityinfo['certificatefile'] = None
securityinfo['keyfile'] = None
securityinfo['client_id'] = None
securityinfo['secret_id'] = None

root = Tkinter.Tk()
root.withdraw()

filename = tkFileDialog.askopenfilename(parent=root,title='Select File to Upload')

upload_file = filename
try:

    shh = securityhandlerhelper.securityhandlerhelper(securityinfo)
    if shh.valid == False:
        print shh.message
    else:
        admin = arcrest.manageorg.Administration(securityHandler=shh.securityhandler)
        content = admin.content
        userInfo = content.users.user()

        titleInput = raw_input("Please enter a title for your upload: ")

        itemParams = arcrest.manageorg.ItemParameter()
        itemParams.title = titleInput
        #itemParams.thumbnail = None
        """
        Valid types
        "Shapefile", "CityEngine Web Scene", "Web Scene", "KML",
                     "Code Sample",
                     "Code Attachment", "Operations Dashboard Add In",
                     "CSV", "CSV Collection", "CAD Drawing", "Service Definition",
                     "Microsoft Word", "Microsoft Powerpoint",
                     "Microsoft Excel", "PDF", "Image",
                     "Visio Document", "iWork Keynote", "iWork Pages",
                     "iWork Numbers", "Map Document", "Map Package",
                     "Basemap Package", "Tile Package", "Project Package",
                     "Task File", "ArcPad Package", "Explorer Map",
                     "Globe Document", "Scene Document", "Published Map",
                     "Map Template", "Windows Mobile Package", "Pro Map",
                     "Layout", "Layer", "Layer Package", "File Geodatabase",
                     "Explorer Layer", "Geoprocessing Package", "Geoprocessing Sample",
                     "Locator Package", "Rule Package", "Workflow Manager Package",
                     "Desktop Application", "Desktop Application Template",
                     "Code Sample", "Desktop Add In", "Explorer Add In",
                     "ArcGIS Desktop Add-In", "ArcGIS Explorer Add-In",
                     "ArcGIS Explorer application configuration", "ArcGIS Explorer document"
        """
        itemParams.type = "Shapefile"
        itemParams.overwrite = True
        itemParams.description = "Auto Upload File"
        itemParams.tags = "tags"
        itemParams.snippet = "Auto Upload File"
        itemParams.typeKeywords = "Data"
        #itemParams.filename = upload_file
        item = userInfo.addItem(
            itemParameters=itemParams,
            filePath= upload_file,
            overwrite=True,
            relationshipType=None,
            originItemId=None,
            destinationItemId=None,
            serviceProxyParams=None,
            metadata=None)
        print item.title + " created"

except:
    line, filename, synerror = trace()
    print "error on line: %s" % line
    print "error in file name: %s" % filename
    print "with error message: %s" % synerror


texts: Is this a known issue in gaps between masked raster and spatial polygon in R with mask command?

texts:
This is my codes

raster file: RAD
polygon(shape): ws_sfc

RAD.sub <- crop(RAD, extent(ws_sfc))
plot(RAD.sub)

RAD.sub <- mask(RAD.sub, ws_sfc)
plot(RAD.sub)
plot(ws_sfc, add = TRUE)

Masked raster didn't match with polygon boundaries as shown black arrows.
Is it known issue?


texts: How to draw polygons around known clusters

texts:
I need to split up an area into non-overlapping, but contiguous territories.  I have n points on a map, which are partitioned into k sets. The partition is only partially geographic, meaning that there is no reason to believe that the points are mixed in with one another.  No two points overlap each other.  The problem is to draw polygons such that each polygon contains all points from one set, and excludes all points from all other sets, such that the polygons have the following properties:
No two polygons overlap each other.
Polygons must be contiguous.

A further "nice to have" would be that the polygons minimise the proportion of the area they cover which is not within r distance units of any of the points in the set, subject to the condition that no two lines of the polygon are closer than d to each other.

I can't post an image of what I'm talking about until I have reputation 10.  Please let me know if what I'm asking is unclear.

My question is this:
Has anything like this been done before?
Are there any papers I should be reading, or known algorithms I can make use of?
I'm new to GIS in general, are there any suggestions on search terms I could be using to find similiar concepts?


texts:
I am making a slope raster in QGIS from DEM.
My DEM was made using WGS84 coordinates system.
Do I need to be using a z scale conversion factor ?
If so what would that be?


texts: How can I filter my image collection based on incidence angle in SAR?

texts:
Im completely new to SAR, and Im trying to understand the basics.

Im studying a small area in Google Earth Engine, and Im making timeseries of water pixels with SAR imagery. However, I observed significant differences between some days, and when I looked the angle from those images, there were like 31 and 40.

Therefore, how could I filter my image collection based on angle? Something like to stack images with angle 30-35, and 35-40, etc. Which function can I use in the filtering part?

Map.addLayer(vuursteentocht, {}, 'ROI')
Map.centerObject(vuursteentocht, 8)

var collectionVV_desc = ee.ImageCollection('COPERNICUS/S1_GRD')
 .filter(ee.Filter.eq('instrumentMode', 'IW'))
 .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
 .filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'))
 .filterBounds(vuursteentocht)
 .filterDate("2017-10-30", "2018-02-21")
print(collectionVV_desc);


texts: Why does ee.String.replace() have problems when using a period for it's regex in Google Earth Engine?

texts:
I was trying to format a list of dictionary keys for export when I ran into this odd problem.
When trying to replace a decimal point in a string, the ee.String.replace() method seems to treat all characters as decimal points.
//function to remove decimal in second position
var str = ee.String('Sally was a li*ttle lamb. her fleece was white as yo. ')

var regex = '.'

var cut = function(string){
  var newString = ee.String(string);
  //remove decimal
  var decimalTrim = newString.replace(regex, '#');
  return decimalTrim;
};

var testCut = cut(str);
print('testCut', testCut);

var cut2 = function(string){
  var newString = ee.String(string);
  //remove decimal
  var decimalTrim = newString.replace(regex, '#', 'g');
  return decimalTrim;
};

var testCut2 = cut2(str);
print('testCut2', testCut2);

I can achieve the desired results use slice and concatenate methods, but I'm curious to see why my code isn't working. I'm assuming the period is some sort of wildcard, but can't find anything about this in the documentation. Attempting to replace a '*' character will also yield an error message. Anyone knows what's going on here?


texts: Concatenating address fields with possible blank or null values in fields using Python parser?

texts:
The following Python code is what I have already tried in field calculator of ArcMap 10.5.1:

Pre-Logic Script Code:

def ConcatAddr(!JOIN_KEY!)
      val = ""
          if !Address! <> val
              return !Address! + " "
          else
              return val
          if !StreetName! <> val
              return !StreetName! + " "
          else
              return val
          if !Apartment! <> val
              return !Apartment! + " "
          else
              return val
          if !CityCode! <> val
              return !CityCode! + " "
          else
              return val
          if !ZipCode! <> val
              return !ZipCode! + " "
          else
              return val

JOIN_KEY =
ConcatAddr(!JOIN_KEY!)


texts: Does QGIS run on new Microsoft Surface Pro X with ARM arquitecture?

texts:
I am planning to buy for my company a Microsoft Surface Pro X tablet. I will use it mainly for QGIS, sometimes in the streets, sometimes in the office.
It has windows installed but does QGIS run on new Microsoft Surface Pro X with ARM arquitecture?


texts: Is there a tool in GIS to find the surface of a profile section in a DEM?

texts:
For example I have a DEM of river bed over which we made several profiles – eg sketch: http://prntscr.com/cqwile
Now in cross section, it will look like this http://prntscr.com/cqwx59 .

Is there a way in GIS to find the surface of the green area by adding the DEM and a profile line from which it should be measured?

Or maybe set a Plane Height from which to start.