texts: ArcMap Symbology: Assign Color by one attribute, symbol by other attribute

texts:
I've got a question concerning the symbology in ArcMap.

I want to use the Unique values/Many fields option to assign unique values based on three attribute fields. To symbolize the first attribute field, I would like to use a color, the second and third attribute field shall use a symbol. Obviously, this can easily be done manually, but as I have nearly 1000 unique values, I was wondering whether there is a possibility to assign the color first, and then the symbols to each same combination, without having to click every item individually.

I hope I have been clear about what I want to do.

I am running ArcGIS 10.2 Basic, and do not know much, or rather nothing, about python.

Edit:

The answers so far do not seem to work properly for me. Therefore, I will try to be more clear with what I need.

I have got a point-shape with 3 fields and 988 features. I want to make a layer of this to apply to different shapes afterwards.

So here is what I want:

Every unique value (13 unique values) of the first field to have the same color
Every unique value (4 unique values) of the second field to have the same symbol
Every unique value (18 unique values) of the third field to have the same symbol
The different symbols for the second and third field must not superpose each other

I do know how to realise this manually, but I do not want to choose and click every single one of 988 features in the symbology window, especially as they cannot be sorted by the second or third field.

Is there any possibility to automatically assign colours to the values of one field and symbols to the values of another field?


texts: PostGis ST_Transform: failed to load NAD27-83 correction file (-38)

texts:
So I'm getting some user drawn polygons in WKT with OpenLayers. (Web Mercator CRS) and I now need to now convert it to SRID4326 so can do some spatial queries. However, when it fails to do a ST_Transform. A simplified query I run that gives me the error:

SELECT ST_AsText(
       ST_Transform('SRID=3857;POLYGON((-10179308.152034 5209576.5082574,-10140172.393558 4329021.9425348,-8516038.4167805 4329021.9425348,-9514000.2579329 5385687.421402,-10179308.152034 5209576.5082574))'::geometry,4326)
);

It gives me this error:

  ERROR:  transform: couldn't project point (-1.08446e+07 5.1652e+06 0):
  failed to load NAD27-83 correction file (-38)

  HINT:  PostGIS was
  unable to transform the point because either no grid shift files were
  found, or the point does not lie within the range for which the grid
  shift is defined. Refer to the ST_Transform() section of the PostGIS
  manual for details on how to configure PostGIS to alter this
  behaviour. cohere=> select postgis_full_version();

Even after a bit of google-foo, I still can't figure out how to install the correction file I can do And I can do other transformations just fine (I tried 4326 to 2026 and 3857). I read somewhere to check to make sure PROJ is installed and it is:

SELECT PostGIS_Full_Version();

  POSTGIS="1.5.2" GEOS="3.2.2-CAPI-1.6.2" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.6.26" USE_STATS

Thanks,


texts:
I created two tables with PostGIS, within which I have inserted a shapefile of an Italian region (Apulia) in the first, and the coordinates in the second table.

In both tables are set with the geometry srid 4326, but by importing layers into QGIS, layers are not properly overlapped.

The procedure I followed is the following :
I downloaded the following shapefile (link), and I created the sql script with command

$ shp2pgsql -a -c -D -s 4326 -I R16_01 public.puglia > puglia.sql

within the script, the geometry is added to the table in this way:

ALTER TABLE "public"."puglia" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('public','puglia','geom','4326','MULTIPOLYGON',2);

similarly, for the table coordinates

SELECT AddGeometryColumn('public','coord','geom','4326','POINT',2);

then I insert into the table coord some coordinates, also occurred via google maps ...

INSERT INTO mapp (gid, cod_istat, geom)
VALUES (2,3, ST_SetSRID (ST_MakePoint (41.8976987992015, 16.121389858102294), 4326));

When I import the layers in QGIS , the overlap is not what I expect . The coordinates that I post are far away from where they should be.

what's wrong ?


texts: Using python lookup table to compare records with existing geodatabases

texts:
I am trying to use python to look through an access table containing facilities that need to have geodatabases with geodatabases that already exist in order to generate a list of facility geodatabases that still need to be created. The script is working but the loop is stopping at the first record of the table and not continuing to page through the rest of the records.

Here is what I have:

lookuptbl = r"P:\\USACE Mobile 0610-01 2010 63D RSC NR Contract\\03-Source Documents\\GIS\\SITE_ID_LOOKUP.mdb\\new_facility"
q = '[include_in_gis] = ' + "'" + "X" + "'"

rows = gp.SearchCursor(lookuptbl, q)
row = rows.next()

while row:
    facil_id = row.GetValue("facil_id")
    lookuptbl2 = r"P:\\USACE Mobile 0610-01 2010 63D RSC NR Contract\\03-Source     Documents\\GIS\\SITE_ID_LOOKUP.mdb\\gdbs"
    q2 = '[facil_id_in_gdbs] = ' + "'" + facil_id + "'"
    #IF q is satisfied, the gdb that is currently being processed was found in lookup table;
    #If q is NOT satisfied, the script will skip the gdb alltogether; nothing will be done

    rows = gp.SearchCursor(lookuptbl2, q2)
    row = rows.next()

    while row:
        print facil_id + "--already exists"
        row = rows.next()

    row = rows.next()

I'm new to scripts.


texts: Export raster to 8bit png with transparency

texts:
I have various scanned images in different file formats (jpg, tiff, png) and I need to georeference, clip and export those images.

As a result I need to have a 8 bit png file with transparacy (the clipped areas) on index value 255. I'm currently using ArcGIS but have QGIS and ArcGIS Pro available, but I'm somewhat struggling to accomplish this task. The 'errors' are ranging from completely black images outside of ArcGIS, having transparency for specific colors in the whole picture or having no 8 bit at all.

Could someone describe a workflow GUI- or script-based, preferably in ArcGIS but QGIS or ArcGIS Pro would be possible too.


texts: How do I work with Excel and QGIS so that Excel formulas are intact when data is edited in QGIS?

texts:
I work a lot with Excel spreadsheets that are linked across multiple tabs and files. In this case, I have a sheet with coordinates and a whole lot of other data fields which needs to be imported into QGIS. Because this raw data is pretty messy and has a bunch of fields that does not need to be imported into my map, I like to create a new sheet and do a index-match to get a clean dataset for mapping.

What I've realized is that after I use the Spreadsheet Layers plugin to import my point layer, I am unable to edit data in the layer without breaking the Excel formulas which keep my data connection to the original source data "live" (i.e. the moment I make an edit in the layer, my excel data becomes hard-coded).

How can I maintain the live connection while having the flexibility to manually edit data?


texts:
I'm trying to get postgis raster layers in geoserver-2.3.1, with postgresql-8.4, postgis-2.0 and gt-imagemosaic-jdbc-9.1.jar support. I'm going through the tutorial with a PNG raster that i have. In the last step i'm stuck with a java exception...can't really understand what is it!? I've tried other jdbc-postgresql driver and less tiles but the error seems to come up everytime.

Here is the output! Any interpretations? Every help is welcome. Thanks

java -jar ~rdfs_run/geoserver/geoserver-2.3.1/webapps/geoserver/WEB-INF/lib/gt-imagemosaic-jdbc-9.1.jar import -config ~rdfs_run/geoserver/geoserver-2.3.1/data_dir/coverages/postgis/aveiro.postgis.xml -spatialTNPrefix tileaveiro -tileTNPrefix tileaveiro -dir tiles -ext png
Apr 28, 2013 8:50:34 PM org.geotools.gce.imagemosaic.jdbc.Import logInfo
INFO: Truncating table : tileaveiro_0
Apr 28, 2013 8:50:34 PM org.geotools.gce.imagemosaic.jdbc.Import logInfo
INFO: Number of tiles to import: 48
Apr 28, 2013 8:50:34 PM org.geotools.gce.imagemosaic.jdbc.Import logInfo
INFO: Inserted tile AveiroRDFS_rgb_5_8.png : 1/48
...
INFO: Inserted tile AveiroRDFS_rgb_3_8.png : 48/48
    java.sql.BatchUpdateException: Batch entry 0 INSERT INTO tileaveiro_0 (location,geom,data) VALUES  ('AveiroRDFS_rgb_5_8.png',geomfromwkb(?,4326),?) was aborted.  Call getNextException to see the cause.
        at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2746)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1887)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:405)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2893)
        at org.geotools.gce.imagemosaic.jdbc.Import.sqlCommit(Import.java:1026)
        at org.geotools.gce.imagemosaic.jdbc.Import.fillSpatialTable(Import.java:856)
        at org.geotools.gce.imagemosaic.jdbc.Import.start(Import.java:401)
        at org.geotools.gce.imagemosaic.jdbc.Toolbox.main(Toolbox.java:46)


texts: google map api v3 large/complex polygons

texts:
I have quite some large/complex polygons I'd like to overlay on a Google map. I can do this but wondered what the best/fastest way is to load them?

I have tried using a KML but understand there are some limitations on size and the number you can load. Also I've looked at fusion tables but again they have limitations.

I'm thinking about storing the polygons in JSON files split into region A, B, C, etc... then limit the zoom level so that only certain polygons would be visible at one time then only fetching those.

Suggestions welcome.

Thanks Andy


texts:
I'm currently trying to produce a line-of-sight map of a tower with no results. Every time I run the viewshed tool, the program uses the base Z value of the DEM.

I use the DEM Raster for the elevation model. The point has a Z value in the attribute table of 100.9. Which is the AGL height in meters. I leave the Z factor at 1.

For some reason the viewshed is not the line-of-sight from 100.9M but from the base Z value. Anyone have any ideas what I am doing wrong?

I have been out of this game for about 5 years. I learned the program back in the 9.1 days. So I could have easily forgotten a step or two.


texts: I have some points and vector grid in .shp files. I need to combine points which are in the same cell(or cross cell) and sum their values. How can I do this in QGIS?


texts:
QGIS 2.0 uses overpass to query osm data. I want to make customized queries like only buildings or only roads or both. And i only want the geometry so i'll go for skel mode in overpass. I may also need to set the timeout options for large data.

How can i make these custom queries from qgis?


texts: How get intersection of polygons in the same table by PostGIS?

texts:
I have a single table of over 1000 polygons in postgreSQL (with PostGIS), and I have a field "evaluation_type" that only receives two values, either 'good'(green) or 'bad'(red), as you can see in the picture below.

Once some 'bad' and 'good' polygons overlap, I'd like to use a PostGIS function where I can get the following:

And in the attribute table I'd have
 - 'good'
 - 'bad'
 - 'fair': For the intersections

I'd like the result layer (the one containing the intersection) in a "2D" layer, in other words, I want no overlap between the intersects. It's because, in the end, the thing I'm looking for is to count, for each small little polygon, how many 'good' and 'bad' polygons it represents, see below the hypothetical attribute table I want to have.

    id|  evaluation  |  count_good  |  count_bad

1 |  good    |   223    |   0
2 |  fair    |   108    |   288
3 |  bad     |   0      |   278
4 |  fair    |   193    |   132
5 |  fair    |   183    |   198
6 |  ...

If the small polygon only represents a intersection of 'good' polygons it will receive an value of 'good' and will have 0 in the field 'count_bad'
If the small polygon only represents a intersection of 'bad' polygons it will receive an value of 'bad' and will have 0 in the field 'count_good'
If the small polygon represents a intersection of 'bad' and 'good' polygons it will receive an value of 'fair' and will have 0 counts > 0 in both fields 'count_good' and 'count_bad'

As far as I remember in ArcGIS Union tool, it would break the intersections. I realized that ST_Union behaves a bit different. I used the following code and it returned a dissolved polygon.

    CREATE TABLE out_table AS
    SELECT ST_Union(geom) as geom
    FROM areas_demo;

Do you have a hint, how could I get such result I described?


texts: Why does feature selection from SQLite attribute table fail?

texts:
When I open a SQLite attribute table, I cannot select any features from the table. Right-clicking >"Select All Ctrl+A" and filters (queries) still work.

This method of selecting features from the attribute table works just fine for other types of spatial files.

Is this a bug, or a limitation of SQLite files? Are there any work-arounds?


texts: Extracting projection from each LAS file in directory using ArcPy?

texts:
I am using ArcPy to automate the conversion of LAS files to Raster in ArcGIS.  I'd like to extract the spatial reference from each LAS file along the way.

Is it possible to do this using ArcPy tools?

I was able to install and import Laspy, but is it possible to convert a Laspy object to an ArcGIS spatial reference object?


texts:
I recently went to install qgis2web on QGIS3.8 Zanzibar and got the same message, irrespective of checking and installing the QtWebKit5.

I would like to be able to use the plugin in some training I am organising. Can someone help me assess this error message and revolve this issue please?

Pasted below:

Couldn't load plugin 'qgis2web' due to an error when calling its classFactory() method

ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'
Traceback (most recent call last):
  File "/app/share/qgis/python/qgis/utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/eoin/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/qgis2web/__init__.py", line 28, in classFactory
    from .qgis2web import Qgis2Web
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/eoin/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/qgis2web/qgis2web.py", line 30, in
    from qgis2web.maindialog import MainDialog
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/eoin/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/qgis2web/maindialog.py", line 57, in
    from qgis.PyQt.QtWebKitWidgets import QWebView, QWebInspector, QWebPage
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/app/share/qgis/python/qgis/PyQt/QtWebKitWidgets.py", line 24, in
    from PyQt5.QtWebKitWidgets import *
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'

Python version: 3.7.3 (default, Nov 10 2011, 15:00:00) [GCC 8.3.0]
QGIS version: 3.8.3-Zanzibar Zanzibar, 685d8b15

Python Path:
/app/share/qgis/python
/home/eoin/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python
/home/eoin/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins
/app/share/qgis/python/plugins
/usr/lib/python37.zip
/usr/lib/python3.7
/usr/lib/python3.7/lib-dynload
/usr/lib/python3.7/site-packages
/app/lib/python3.7/site-packages
/app/lib/python3.7/site-packages/numpy-1.14.3-py3.7-linux-x86_64.egg
/app/lib/python3.7/site-packages/MarkupSafe-1.0-py3.7-linux-x86_64.egg
/home/eoin/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python
/home/eoin/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/DigitizingTools/tools
/home/eoin/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/DigitizingTools
/home/eoin/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/mmqgis/forms


texts: how can convert geometry type to geometry(Point)?

texts: I think my question is stupid but I'm blocking. I just work with postgis ST_Line_Locate_Point function (linestring, point). to find the ends of lines. My problem is that my objects geometry type, not point. So how can I convert the geometry to geometry (point) ..?


texts: Is it possible to install ArcPy on a server for use in a geoprocessing web application?

texts:
I have a website on my intranet and would like to add some geoprocessing tools to it with Python.

Many Users will not have Arc installed on their machines, so I think I need to have the scripts set up in such a way that they are not dependant on the traditional mappings.

I have Python installed on my server and set up IIS to run scripts on the serverside.
currently running the "HelloWorld.py".

Is there a way to install ArcPy on my server?

Any ideas would be welcome.

Andy


texts: QGIS: Selecting active layer to be processed in Python script exported by Graphic Modeller

texts:
I created a model and I would like to have it as a python script.

This is what I see when I run my model and I can select a layer from this window. I don't necessarily need to select a layer, it can just process the active layer.

When I export this model as python code this is the corresponding part that select myLayer parameter.

from qgis.core import QgsProcessing
from qgis.core import QgsProcessingAlgorithm
from qgis.core import QgsProcessingMultiStepFeedback
from qgis.core import QgsProcessingParameterVectorLayer
from qgis.core import QgsProcessingParameterFeatureSink
import processing

class myModel(QgsProcessingAlgorithm):

    def initAlgorithm(self, config=None):
        self.addParameter(QgsProcessingParameterVectorLayer('addlayer', 'myLayer', types=[QgsProcessing.TypeVectorAnyGeometry], defaultValue=None))
        self.addParameter(QgsProcessingParameterFeatureSink('Result', 'Result', type=QgsProcessing.TypeVectorAnyGeometry, createByDefault=True, defaultValue=None))

Is it possible to edit this code in order to make it target the active layer to process the model?


texts: Remember Save location for image created in composer?

texts: QGIS remembers the last saved location for the image that was last created. Is it possible to change a setting so that this last saved location is remembered per QGIS project file?


texts: QGIS can't find osgeo after GDAL upgrade

texts:
Mac OS 10.6.8: I installed QGIS 1.8.0 with GDAL 1.8; then another app requires GDAL 1.9 and installed it; now QGIS can't find osgeo [python-gdal]. (I can't find any trace of GDAL 1.8 left in my system.)

What needs to be edited to point QGIS to GDAL 1.9?


texts: Splitting overlap between polygons into disjoint sets using shapely?

texts:
I have two overlapping shapely polygons A and B. I want to divide their intersection into two pieces, such that one part of the intersection is the set of points in A.intersection(B) (or symmetrically, B.intersection(A) to the boundary of A-B, and the other is the set of points closer to the boundary of B-A.

Is there an way to do this in shapely other than applying a brute-force mesh and checking the distance to each polygon's boundary?


texts: How do I handle mouseover for features in OpenLayers 6

texts:
I am migrating a project from an earlier version of OpenLayers to v6+.
In the previous version I added 'event handlers' to the marker. I have changed the code to the code below and whilst JS does not complain nothing happens.
var marker = new ol.Feature({
    geometry: new ol.geom.Point(lonlat),
    id: myid,
});

marker.setId(myid);

var icon = new ol.style.Style({
    image: new ol.style.Icon(({
        size: size,
        offset: offset,
        src: 'image.png',
        id: myid
    }))
});
marker.setStyle(icon)

markers.push(marker); // markers is an arry

markerSource = new ol.source.Vector({
    features: markers
});

markersLayer = new ol.layer.Vector({
    id: 'Markers',
    source: markerSource,
    zIndex: 50
});
map.addLayer(markersLayer);
markersLayer.setZIndex(50);

marker.on('mouseover', function(evt)
{
     alert('you hovered');
}, null)

Can anyone help?


texts: Finding Points in Polygons with Matching ID's?

texts:
I'm fairly new to using PyQgis, so sorry if this question is basic. I'm working with two vector layers:

(layer 1) A series of polygons, each with an ID field specifying what geographic district the polygon is in

(layer 2) A series of points, also with the same ID field as above

I am trying to determine what points from layer 2 lie within a polygon with a matching ID field from layer 1.

As a start, I decided I would loop over all of the polygons in layer 1, and for each polygon, loop over all of the points in layer 2 to see if the ID fields of each polygon/point matched. The ID field in layer 1 is attribute number 10. The corresponding ID field in layer 2 is attribute number 1. My problem is that, in the following code, only the first feature in layer 1 gets looped over. So, while there are about 200 or so polygons in layer 1, each with a unique ID, the code only loops over a single ID corresponding to a single polygon.

Here's what I have:

layer1 = QgsVectorLayer('shapefile1_location', "polygon_layer")
if not layer1:
  print "Layer 1 failed to load!"

layer2 = QgsVectorLayer('shapefile2_location', "points_layer")
if not layer2:
  print "Layer 2 failed to load!"

layer1 = iface.addVectorLayer('shapefile1_location', "polygon_layer", "ogr")
layer2 = iface.addVectorLayer('shapefile2_location', "points_layer", "ogr")

iter1 = layer1.getFeatures()
iter2 = layer2.getFeatures()
for polygon in iter1:
    for point in iter2:
        if polygon[10]==point[1]:
            print polygon[10], "Success!"


texts: Exporting KMZ multiple layer to one image TIFF/PNG

texts:
I've got a KMZ with multiple tile zoom layer.

How can I convert this KMZ tile into one file TIFF or PNG?
Or how can I rasterize the tile layer into one image?
So it covers all tile in one image.
I've tried with Global Mapper to convert to TIFF. But when zooming the image is broken and the image size is small.


texts: Is there a way to limit the overview map to a certain zoom level?

texts:
The OpenLayers overview map control works great when I use standard options. I would like to limit the overview to one resolution, but I can't seem to find the right combination of values for the properties and mapOptions. Is there a way to force the overview map to stay at a single zoom level?

The example code below uses the "numZoomLevels : 1" option, but this has no effect.

function init() {
// start with a browser check. If it's IE6, transparent png's are not supported
var ua = $j.browser;
if(ua.msie && ua.version.slice(0, 1) == "6") {
    var imgtype = 'image/gif';
} else {
    var imgtype = 'image/png';
}

// Define a projection for the map
var proj = new OpenLayers.Projection("EPSG:4326");

// Define the map options and start with an empty control set
var mapOptions = {
    controls: [],
    projection : new OpenLayers.Projection("EPSG:900913"),
    displayProjection : proj,
    units : "m",
    numZoomLevels : 20
};
// Create the map object
var map = new OpenLayers.Map('map', mapOptions);

 // Define the overview map options
var overviewOptions = {
    size : new OpenLayers.Size(300, 200),
    maximized : true,
    minRectSize : 0,
    autoPan : true,
    mapOptions : {
        projection : new OpenLayers.Projection("EPSG:900913"),
        displayProjection : proj,
        units : "m",
        resolutions : [90],
        numZoomLevels : 1  // this has no effect, the ov map still zooms in and out with the map
    }
};

// Add controls to the map
map.addControl(new OpenLayers.Control.OverviewMap(overviewOptions));
map.addControl(new OpenLayers.Control.Navigation());
map.addControl(new OpenLayers.Control.PanZoomBar({panIcons : false}));
map.addControl(new OpenLayers.Control.ScaleLine());
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.Scale($('scale')));
map.addControl(new OpenLayers.Control.MousePosition({
    element : $('location')
}));

// Add layers
var gmap = new OpenLayers.Layer.Google("Google Streets", {
    numZoomLevels : 20
});

map.addLayers([gmap]);

// Start the map at a particular point
var point = new OpenLayers.LonLat(-118, 34);
point.transform(proj, map.getProjectionObject());
map.setCenter(point, 16);

}; // Ends the init()


texts: QGIS processing script: No raster output from gdalogr:translate and gdalogr:cliprasterbyextent

texts:
When I import the following processing script in the QGIS Python console it does not give any error and even displays ("Executing algorithm xy").
However the output file is not generated. Does anyone know why? Do I need to save raster output files differently than vector output files in processing scripts?

The two versions of code access the input image differently and the extent values do not make much sense in these snippets.

### gdalogr:translate ###
from PyQt4.QtCore import QFileInfo
import processing

file = iface.activeLayer()
f = file.source()
fileInfo = QFileInfo(f)
baseName = fileInfo.baseName()
rlayer = QgsRasterLayer(f, baseName)
extent = rlayer.extent()
xmin = extent.xMinimum()
xmax = extent.xMaximum()
ymin = extent.yMinimum()
ymax = extent.yMaximum()

output = "C:/result.tif"
processing.runalg('gdalogr:translate',{"INPUT":rlayer,"OUTSIZE":100,"OUTSIZE_PERC":False,"EXPAND":2,"PROJWIN":"%f,%f,%f,%f"%(xmin, xmax, ymin, ymax),"OUTPUT":output})

##########################################################################
### gdalogr:cliprasterbyextent ###
from PyQt4.QtCore import QFileInfo
import processing
import os

os.chdir(r"D:\...\3_Resizing")
files = os.listdir(os.curdir)

for f in files:
    if os.path.splitext(f)[1]=='.tif':
        fileInfo = QFileInfo(f)
        baseName = fileInfo.baseName()
        rlayer = QgsRasterLayer(f, baseName)
        rextent = rlayer.extent()
        xmin = rextent.xMinimum()
        xmax = rextent.xMaximum()
        ymin = rextent.yMinimum()
        ymax = rextent.yMaximum()

        clip_output= "D:/.../test.tif"
        # I also get no result when providing a name 'test' only, which did work to generate a vector output from qgis:vectorgrid

        processing.runalg('gdalogr:cliprasterbyextent', {"INPUT":rlayer, "PROJWIN":"%f,%f,%f,%f"% (xmin,xmax,ymin,ymax),"OUTPUT":"%s"%(clip_output)})


texts:
Which are the most common features in order to perform a supervised classification in remote sensing?

Furthermore anyone worked with SAR features?

Which are the most commonly used?

Can anybody suggest me a book for feature extraction?


texts:
I have polygon dataset containing quite a complicated coastline.  How can I produce an outline of that coastline?

Please see the image: my dataset is in green and the coastline I need to get is in red.


texts: Preserve attribute table while using Extract by Mask in ArcGIS

texts:
When using the Extract by Mask function on a raster with several columns (beyond value and count) in the attribute table, the resulting raster does not have all the columns (it only has value and count).

Is there a way to conduct extract by mask and also preserve the columns?

Please note that this is part of a script in python.


texts: Add spatial functions to a geopackage template

texts:
I would like to dump data from my survey software to a geopackage file through an ODBC connection but I need a minimum of spatial functions to execute my requests:
ST_IsEmpty(geom), ST_MinX(geom), ST_MaxX(geom), ST_MinY(geom), ST_MaxY(geom), GeomFromEwkt, St_Multi.

Here's a exemple of my PostGIS request through ODBC:

|   INSERT INTO myTab
|   ( name,
|   date_cmp,
|   geom)
|   VALUES
|   ([myPoint],
|   to_timestamp([[myPoint]:DT]),
|   ST_SetSRID(GeomFromEwkt('JS_WKT([myPoint],P3)'),3163)
|   );

JS_WKT(component,type) is producing an EWKT.

My gpkg is a template file made by qgis 2.18.17 my software will copy an fill with Insert requests.

My question is a little similar to geopackage-update-query-generates-an-error-no-such-function-st-isempty


texts: Does the MapInfo centroid function guarantee a centroid within the polygon?

texts: I wish to calculate the centroids of a large number of building polygons in OS MasterMap using MapInfo.  MapInfo calculates the centroid using the object's Minimum Bounding Rectangle.  Theoretically could a building's shape mean the centroid was outwith the building's footprint?


texts: How to interpolate (x,y,h) points within a polygon shapefile?

texts:
I have 2D points with (x,y) coordinates. Each point has an associated height value 'h'.

These randomly distributed points lie inside a polygon shapefile. My desired output is to interpolate the heights across the polygon using these 2D points. Where, the final result is a polygon shapefile with interpolated heights.

How can I do this in ArcGIS or R?


texts: IFeatureClassWrite and ITableWrite doubt

texts:
I'm looking at these specific interfaces ITableWrite and IFeatureClassWrite.

I have a need to store some features (mostly a custom log) and I can't having them triggering my editor events (OnCreate, OnChange and OnDelete - but more specifically OnCreate).

The document is clear that IFeatureClassWrite will NOT trigger these events (IRow.Store).

ITableWrite just says:

  " .WriteRow | Write a row to the
  database without polymorphic object
  update behavior. "

Do they mean the same thing? e.g. using WriteRow or WriteRows will not trigger the OnStore event (which BTW is not listed on IRowEvents) and using IFeatureClassWrite will not trigger OnStore events?

Another question: do I need to bypass these events? I'm only listening to OnCreate, OnChange and OnDelete events of the editor.

Also, is that the best tatic to capture these specific events? I'm afraid that programmatically, someone else might use IWorkspaceEdit, and my editor event handler won't listen to those (events).

Sorry for the long question, but the setup to test this is kinda of big, and I'm open to advice. Thanks!


texts: I made two tool on Model Builder ArcMap 10.7. Didn't work on ArcMap 10.3. Can I fix this problem?

texts:
I made two tools using Model Builder on ArcMap 10.7.

I saved both toolbox as version 10.0 and tested on my ArcMap 10.7, they worked fine.
I shared it with the public and it worked fine on ArcMap version 10.7. But the tool had a red X on it when people tried to use it on ArcMap 10.3.

I imagine this problem happens because some of the tools I used inside my tool had been updated on newer version of ArcMap.

Is there a way to fix it?


texts:
Using the following script, I am trying to do precipitation anomaly detection but I am not able to figure out what is the actual monthly average based on which the anomalies are plotted for the given time period. In other words I want a plot of monthly average for the period of 1981-2019
(code link: https://code.earthengine.google.com/c6aa83b9e57cfb92418cf0cccc1b6148 )
//var point = /* color: #d63000 */ee.Geometry.Point([76.79667658,10.62448299]);

var means = ee.ImageCollection(ee.List.sequence(1, 12)
  .map(function(m) {
    return chirps.filter(ee.Filter.calendarRange(m, m, 'month'))
        .mean()
        .set('month', m);
}));

var start = ee.Date('2015-01-01');
var months = ee.List.sequence(0, 48);
var dates = months.map(function(index) {
  return start.advance(index, 'month');
});
print(dates);

// Group by month, and then reduce within groups by mean();
// the result is an ImageCollection with one image for each
// month.
var byMonth = ee.ImageCollection.fromImages(
      dates.map(function(date) {
        var beginning = date;
        var end = ee.Date(date).advance(1, 'month');
        var mean = chirps.filterDate(beginning, end)
                    .mean()
                    .set('date', date);

        var month = ee.Date(date).getRelative('month', 'year').add(1);
        return mean.subtract(
            means.filter(ee.Filter.eq('month', month)).first())
            .set('date', date);
}));
print(byMonth);

Map.addLayer(ee.Image(byMonth.first()));

var chart = ui.Chart.image.series({
  imageCollection: byMonth,
  region: point,
  reducer: ee.Reducer.mean(),
  scale: 10000,
  xProperty: 'date'
});
print(chart);

Map.centerObject(point, 12)


texts: Interpolating rasters into mosaic from point data using LayerTime object in ArcPy?

texts:
While trying to run the ArcGIS provided python script to interpolate a bunch of rasters on a time-enabled point feature class file I get the following error:

  Runtime error  Traceback (most recent call last):   File "",
  line 34, in    File "c:\program files
  (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 6043, in
  MakeFeatureLayer     raise e ExecuteError: ERROR 000840: The value is
  not a Feature Layer.

My code is this (line 34 is talking about making a feature class, and I cannot for the life of me figure out what it's referring to):

    import arcpy, datetime
# Check out the ArcGIS Spatial Analyst extension for using the IDW interpolation tool
arcpy.CheckOutExtension("spatial")

arcpy.env.workspace = "C:\Users\Chris\Desktop\interpolation\Interpolation.gdb"

# Get the layer time properties
lyr = arcpy.mapping.Layer(r"C:\Users\Chris\Desktop\interpolation\points.lyr")
lyrTime = lyr.time

# Calculate the number of iterations based on the time extent and timestep interval
startTime = lyrTime.startTime
endTime = lyrTime.endTime
timeExtent = endTime - startTime
timeStepInterval = lyrTime.timeStepInterval

iterations = timeExtent.days / timeStepInterval.interval

# Get the time field containing the time values associated
# with the data in the time-enabled layer
startTimeField = str(lyrTime.startTimeField)

# Specify the output mosaic dataset to which the interpolated rasters will be added
outputMosaicDataset = r"C:\Users\Chris\Desktop\interpolation\Interpolation.gdb\rasta"

i = 0
while i <= iterations:
    # Formulate the time query and increment the time by the timeStepInterval
    currentTime = str(startTime + (i*timeStepInterval))
    timeQuery = "\"" + startTimeField + "\"" + " = date '" + currentTime + "'"

    # Create an in-memory feature layer containing points that are valid at each timestep
    tempFeatureLyr = "tempTimeLayer" + str(i)
    arcpy.MakeFeatureLayer_management(lyr, tempFeatureLyr, timeQuery)

    # Create an interpolated raster surface using the points valid at each timestep
    outRaster = r"C:\Users\Chris\Desktop\interpolation\Interpolation.gdb\output" + str(i)
    print outRaster
    arcpy.gp.Idw_sa(tempFeatureLyr, "avg_hrly", outRaster)

    # Add the newly created raster surface to a Mosaic Dataset
    arcpy.AddRastersToMosaicDataset_management(outputMosaicDataset, "Raster Dataset", outRaster)

    i = i + 1

# Calculate the statistics on the output Mosaic Dataset for
# classifying your data after new rasters are added
arcpy.CalculateStatistics_management(outputMosaicDataset,"1","1","#")

The error (near top of this post) points to line 34, which reads:

arcpy.MakeFeatureLayer_management(lyr, tempFeatureLyr, timeQuery)

I have checked lyr.isFeatureLayer and it's True, timeQuery returns the next time slice in a proper string format that i have verified in the SQL builder, and tempFeatureLyr = 'tempTimeLayer1'...but it does not create it. As in, I do not see tempTimeLayer1 layer in the Table of Contents, though tempTimeLayer0 IS. So, it's not being created, though its name (tempTimeLayer1) is ready to go...

Here is the site I got the help from, example 3:
LayerTime(arcpy.mapping)


texts:
I've done the following process:

take a set of points, each one representing a hotel with a field that says the "neighborhood" that the hotel is in (field is called "full_hierarchy")
Performed SNN clustering on these points
Created Voronoi Polygons using the clusters
Dissolved the Voronoi polygons on the field "full hierarchy")

And I get this:

My problem is that there are bits of each polygon inside of other polygons, as you can see in my image where I have highlighted one of my neighborhoods.

Any ideas how I can get rid of these bits so that each of my polygons is complete with no "islands" in them?

I am going to be doing this on a mass scale, so I need a process that I can do on QGIS

Would also be interested in smoothing the polygons, if possible.

EDIT: Using the options recommended to be below when using the eliminate sliver polygons:

But the output layer looks exactly the same - nothing changes?


texts: I want to take the XML output of a Xapi query and display it using leaflet or polymaps. How can I do that? Is there an easy way to convert XML to geojson


texts:
I have installed the new version os QGIS(3.4) on my computer. I am working in a standalone application of PyQGIS so I need to load PyQt5 components. As a difference with previous versions when I try to load a PyQt5 component like

from PyQt5.QtWidgets import QApplication

I get this DLL problem:

Traceback (most recent call last):
File "(stdin)", line 1 in
Import error: DLL load failed: Not possible to find the specified module.

I have checked if I have some DLL conflicts with other python installations but seems something coming from this module.

Is there anyone who has already faced this problem?


texts: Determining Pixel-by-pixel Catchments in ArcHydro

texts:
I used ArcHYDRO to prepare HydroDEM (5m) without sinks, Flow direction (FDR) raster, flow accumulation raster (FAC). As I understand FAC, value of pixel shows number of pixels that contribute to this pixel. Now, let say I derive drainage line from FAC (in raster form), I would like to link somehow all pixels that contribute to particular pixel in my drainage line, in way that I have separate contributing areas for each pixel in that drainage with clear relation to this pixel. How do I do that?

The main goal is to derive height difference between pixel in the drainge and any pixel that contribute to it and only to it.


texts: Any 16-bit TMS/WMS tile renderer/servers?

texts:
I am looking for something like Geoserver or gdal2tiles.py that can render tiles to 16 bit PNG files (grey-scale).  The tech needs to be open source.  The geoserver PNG grey-scale output is not 16 bit but an 8-bit two band image which is no good for my use-case (I need a single-band 16-bit image). gdal2tiles also produces 8-bits.  I thought of using Mapnik as a renderer and then tilestache or some combination like that, but Mapnik offers only 8 or 32 bit PNGs and no 16 bits according to the documentation.

I want to tile according to a well-known grid and have 16-bit single-band tiles served over well-known web protocols (tms, wms).  Any suggestions?

EDIT:
Although my inputs are also 16-bit they do not conform to a suitable tiling scheme and are in EPSG 4326 when I want them in 3857, so I have to retile and reproject and can't just use the original files.  So I am looking for the convenience of a renderer that will produce 16-bit tiles conforming to tms or wms, with caching


texts: Selecting features by mouse click using PyQGIS

texts:
I am following a tutorial where I am trying to learn how to use PyQGIS to programmatically accept a user's feature selection from the map canvas of QGIS by mouse click. I have encountered a problem with the following code snippet where, as I understand it 'setSelectedFeatures' is no longer an attribute for a QgsVectorLayer.
I have some other posts that suggest the current method in PyQGIS is to use 'selectByIds' but cannot work out how to set up the code to incorporate that correctly, despite looking through the documentation (pygqis documentation).
Has anyone dealt with this type of functionality and could offer some guidance?
 if len(found_features) > 0:
        layer = found_features[0].mLayer
        feature = found_features[0].mFeature
        layer.setSelectedFeatures([feature.id()])

 else:
     self.layer.removeSelection()


texts: Arcmap: save all layers in Table of Contents to layer files

texts: Using python, how can one save all layers in the Arcmap (v10) table of contents pane to layer files on disk?


texts: Using a comboBox to load a layer from PostGIS based on a field which is not the primary key

texts:
I am developing a small plugin in which I would like to create a dropdown menu that would enable the user to choose among a list of polygons (stored in a PostGIS database) according to their names.
Here is a sample of what I tried so far :
self.sql1 = '(SELECT * FROM schema.layer1 WHERE layer1.name =' + str(dlg.comboBox.currentText()) + ')'
self.uri.setDataSource('', self.sql1, 'geom', '', 'id')
self.layer1 = QgsVectorLayer(self.uri.uri(), "layer1", "postgres")

if self.layer1.isValid:
    self.Project.addMapLayer(self.layer1)
else:
    print('Chargement de la couche: echec !')

# Créer un dossier dont le nom est un attribut du champs 'name' de la couche active

idx = self.interface.activeLayer().fields().indexFromName('name')

self.path = "C:/folder/name_layer1_"

for feat in self.interface.activeLayer().getFeatures():
    self.attrs = feat.attributes()
    if os.path.exists(self.path + self.attrs[idx]) == False :
        os.makedirs(self.path + self.attrs[idx])

                # Sauvegarde du shp dans le dossier créé

QgsVectorFileWriter.writeAsVectorFormat(self.layer1, self.path + self.attrs[idx] + '/layer1.shp', "utf-8",self.layer1.crs(), "ESRI Shapefile")

Unfortunately I get a warning I can't solve:

QgsVectorFileWriter.writeAsVectorFormat(self.layer1, self.path + self.attrs[idx] + '/layer1.shp', "utf-8",self.layer1.crs(), "ESRI Shapefile")
AttributeError: 'Test1Plugin' object has no attribute 'attrs'

What I don't understand is that I don't face any problem when I don't add a combobox :
self.sql1 = '(SELECT * FROM schemaA.layer1 WHERE layer1.name = \'D27-16\')'
self.uri.setDataSource('',self.sql1,'geom','','id')
self.layer1 = QgsVectorLayer(self.uri.uri(), "layer1", "postgres")

or when I use the primary key of layer1 in the comboBox :
self.sql1 = '(SELECT * FROM schema.layer1 WHERE layer1.id=' + str(dlg.comboBox.currentText()) + ')'
self.uri.setDataSource('', self.sql1, 'geom', '', 'id')
self.layer1 = QgsVectorLayer(self.uri.uri(), "layer1", "postgres")

Does someone see what I'm missing?


texts: ArcGIS Spatial Statistics: Distance to 3rd/4th/5th closest feature

texts:
We have an algorithm which requires us to produce a score based on the distance from any given cell in an output raster to a score calculated from the distances of the 3rd closest, 4th closest, and 5th closest point features in a separate feature class.

For example, our score might be calculated as score=a/(3c+4d+5e), where a is a constant and c, d, and e are the (Euclidean) distances to the 3rd closest, 4th closest, and 5th closest points on the input feature class, respectively.

Can anyone point me in the direction of how to write a custom function to calculate such a cell statistic?

I have looked at the various Proximity Analysis functions, but they all seem to leave no room for defining custom scoring metrics.


texts: I have not downloaded HAZUS 3.0 yet and am currently using ArcGIS 10.3.1 on my machine. I would like to know if HAZUS 3.0 runs on ArcGIS 10.3.1 or if not any alternatives?


texts:
What is the best way to export from PostGIS to KML using open source tools?

Can I do it directly, or do I need to first export to shape files?


texts: Determining how many of my coordinates overlap with layer in QGIS

texts:
I am working on a project about a certain animal species. I have gotten coordinates from where the species has been observed.
Now I want to know what percentage of the observations are from gardens/residential area and what percentage from forest/ edges of forests.
I have found a layer for living areas so the animals found there would count as 'found in garden/residential area'.
So my question is how do I find out how many of my coordinates overlap with this layer and how many do not?


texts: Drawing 2 points at the beginning and the end of the LineString

texts:
I have LineStrings in a GeoJSON files, in example:

{"type":"Feature","geometry":{"type":"LineString","coordinates":[[8.5918904,46.6325099,0],[8.5984267,46.6184961,0]]},"properties":{"name":"Pendelbahn Andermatt-Gurschen","styleUrl":"#style-Ski_Lift_Cable_Car","styleHash":null,"description":"Pendelbahn Andermatt-Gurschen (Cable Car) Capacity: people"}},

{"type":"Feature","geometry":{"type":"LineString","coordinates":[[8.5987235,46.6184062,0],[8.6116613,46.6022691,0]]},"properties":{"name":"Pendelbahn Gurschen-Gemsstock","styleUrl":"#style-Ski_Lift_Cable_Car","styleHash":null,"description":"Pendelbahn Gurschen-Gemsstock (Cable Car) Capacity: people"}}

I want to draw 2 points at the end and the beginning of the LineString. Is it possible with TileMills CartoCSS?  I don't want any modification on the GeoJSON file.

I want a line like below if it is possible:


texts:
I am in the process of cleaning a large polygon dataset. This dataset represents the extents of an electrical network from a substation.

The polygons have not been created correctly and there are over 2800 slivers of varying sizes and lengths between each polygon boundary.

Compounding the issues I am having there are a number of other “feeder” polygons representing transmission lines. So these polygons can be many kilometres long and pass through more than one of the polygons I am working with. These transmission polygons are removed and leave a sliver crossing multiple polygons.

I am looking for a way to repeatedly and automatically remove these slivers to provide a clean dataset to stakeholders.

I would usually:

Create a large bounding box around all polygons
Erase the polygons from this bounding box
Merge the remaining polygons into the main dataset and select them
Run an Eliminate on this dataset and sanity check the result

Problem here are the polygons crossing multiple areas. As well as a few other issues, e.g. the eliminate in QGis removes some of the polygons I want to keep, resulting in a final output with missing data.

My new methodology in theory (at least I think it should work).

Once the erase is completed, I densify the polygon and extract the
vertices
I created Thiessen Polygons from these vertices
I run the erase again on the newly created polygons, using the main
dataset I want to fix.
I then proceed with the regular process.

I haven’t been able to get this to finish.

I have been using QGis, but I have access to ArcGIS Pro if needed as well as FME. I am comfortable using Python. I am running a Windows Machine and do not have access to Mac OS / Linux.

My question is: are there any other techniques I can try to improve on the topology of this dataset in a way that is repeatable and possibly scripted?


texts: Enforce inter-field dependencies during editing?

texts:
I'm wondering if anyone knows if you can have something a bit more intelligent than mandatory fields in attribute tables.  Basically I want people to fill in a table & if they type something in Column A they HAVE to put something in Column B, but if they don't put something in Column A they don't need to put something in Column B.

Don't want have to run a check & then chase people down.


texts: Retrieve path and file name of current QGIS project in Python

texts:
Is there a way to get the path and the file name of the current QGIS project from a Python script?
I'm currently trying to develop a Python plugin for QGIS and I need to create a file with a similar name in the same folder.


texts: Is there a maximum length of pdf file QGIS composer can plot?

texts:
In QGIS 2.4 is there a maximum dimension in milimeters composer can produce while exporting to pdf?
Trying to produce a 3000 x 900 mm or 2800 x 900 mm map. The QGIS composer displays all the map area but everytime i export it to pdf, the map gets cut at about 2780 mm displaying white space.


texts: Python GUI for QGIS plugin ; how to add menu in QGIS 3.0

texts:
QGIS 3.0 is not backwardly compatible with QGIS 2.0, so currently my plugin (which was fine in the old version) is broken and I am trying to overhaul as required. The documentation seems to be taking a while to catch up with the software.

Would anyone be able to post some code which shows how to create a custom menu for a plugin in version 3.0?

My existing method (good in version 2.x / PyQt4) is this:

from PyQt4 import QtGui

self.menu = QMenu( "&Whatever", self.iface.mainWindow().menuBar() )
actions = self.iface.mainWindow().menuBar().actions()
lastAction = actions[-1]
self.iface.mainWindow().menuBar().insertMenu( lastAction, self.menu )

mnuSub1 = self.menu.addMenu('Sub-menu')
mnuSub1.setIcon(QIcon(icoFolder + 'img1.png'))
mnuAction = mnuSub1.addAction("Do something...",self.RunSomething)


texts: When creating a new raster, how to determine a raster's upperleftx, upperlefty?

texts:
I'd like to create a raster from point data, averaging the point data over a given area and placing the results into a given pixel/cell.  With each pixel/cell as 50m x 50m.

I'm new to this and have a beginner question.

I see that in PostGIS 2.0 there is a ST_MakeEmptyRaster() function, but what are the units for width, height, and pixelsize.  And how do you determine the  upperleftx, upperlefty points?  Is this just random, or is there a convention used to determine this point?

raster ST_MakeEmptyRaster(integer width, integer height, float8 upperleftx, float8 upperlefty, float8 pixelsize);


texts: How to query one shapefile using another shapefile?

texts:
How to query a shapefile using another shapefile in ArcGIS?

For example: I had one shapefile with states, another shapefile with towns. Now I want to query towns using the states file like towns of particular states.

Note: I can extract the data using clip , union or intersect tools in ArcGIS. Here, I don't want to extract data, I need to view the data.


texts:
May I set variable in CSS, like as

<ogc:Function name="env">

I have this:

* {
  fill: [recode(strTrim(name),
         'Akmola Region', '#6495ED',
         'Aktobe Region', '#B0C4DE')];
  fill-opacity:0.4;
  stroke: lightgrey;
}

but I want set variables for Fill and Stroke-width parameters. Like this:

<Rule>
          <Title>Akmola Region</Title>
           <ogc:Filter>
            <ogc:PropertyIsEqualTo>
             <ogc:PropertyName>name</ogc:PropertyName>
             <ogc:Literal>Akmola Region</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
            <PolygonSymbolizer>
                  <Fill>
                  <CssParameter name="fill">
                  #<ogc:Function name="env">
                 <ogc:Literal>Akmola_fill_color</ogc:Literal>
                   <ogc:Literal>6495ED</ogc:Literal>
                  </ogc:Function>
                   </CssParameter>
                  <CssParameter name="fill-opacity">0.4</CssParameter>
                  </Fill>
              <Stroke>
                <CssParameter name="stroke">#605f5f</CssParameter>
                <CssParameter name="stroke-width">
                <ogc:Function name="env">
                <ogc:Literal>Akmola_stroke_width</ogc:Literal>
                <ogc:Literal>0.1</ogc:Literal>
                </ogc:Function>
                </CssParameter>
              </Stroke>
          </PolygonSymbolizer>
        </Rule>

        <Rule>
          <Title>Aktobe Region</Title>
           <ogc:Filter>
            <ogc:PropertyIsEqualTo>
             <ogc:PropertyName>name</ogc:PropertyName>
             <ogc:Literal>Aktobe Region</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
            <PolygonSymbolizer>
                  <Fill>
                  <CssParameter name="fill">
                  #<ogc:Function name="env">
                 <ogc:Literal>Aktobe_fill_color</ogc:Literal>
                   <ogc:Literal>B0C4DE</ogc:Literal>
                  </ogc:Function>
                   </CssParameter>
                    <CssParameter name="fill-opacity">0.4</CssParameter>
                  </Fill>
              <Stroke>
                <CssParameter name="stroke">#605f5f</CssParameter>
                <CssParameter name="stroke-width">
                <ogc:Function name="env">
                <ogc:Literal>Aktobe_stroke_width</ogc:Literal>
                <ogc:Literal>0.1</ogc:Literal>
                </ogc:Function>
                </CssParameter>
              </Stroke>
          </PolygonSymbolizer>
        </Rule>

I want emulate hover event when mouse hover on map object. Maybe it is possible with css capabilities?


texts: How to attribute/cite QuickMapServices Google satellite layer in QGIS?

texts: I work for an ecological consultancy company. I’ve used a Google satellite layer inserted using the QuickMapServices plugin in QGIS. I’m going to insert the figure into a report for a client. What is the correct attribution/citation for the Google satellite layer please?


texts: Render or display only the boundary of a vector layer containing thousands of polygons

texts:
To have a cleaner map to print I want to display only the boundary of a layer composed of more than 200,000 features (all adjacent).

Is there something more straightforward than dissolving or merging all the polygons?

I'm using QGIS.


texts: Error 001143 and Error 99999 when using Locate Features Along Routes in ArcGIS10.1

texts:
Oddly, what I need to do has worked for about half of my data but not the rest.

I'm trying to use the Locate Features Along Routes tool in ArcGIS10.1. I have a smaller polyline layer as the input and another larger polyline routes layer as the input routes layer. Where they occupy the same geographic space, the layers overlap exactly. There is an attribute called "reach code" in both feature classes and they match, this tool will allow me to see "to" and "from" on the input layer when done. I was able to execute it once so I know it works.

Basically, I've got four large watersheds that I'd like to do this for. The tool ran smoothly for the first one but will not work for the other three. There should not be substantial differences between these datasets. I've obtained the data straight from the USGS NHD website so it is unaltered with fields and properties identical among watersheds. There was a problem at first and the tool did not work until I saved the output events table to the desktop instead of the network or the hard drive.

I have disabled Background Processing since I thought that was the issue. When Background Processing is disabled I get the 99999 error. When it is enabled I get the 001143 error, that says I should turn off background processing. I'm stuck in a cyclic zone of zero productivity. Hoping some of the experts out there can shed some light!


texts: Unable to create temporary GeoDatasets in g_g_g folders

texts:
I am converting a VBA macro that was written for ArcGIS 9.3 to a VB.NET project using the ArcGIS 10.0 .NET SDK. I am getting the following error whenever the code tries to create a temporary IGeoDataset in a "g_g_g" folder:

"(esriDataSourcesRaster.GdalDriver) Failed to copy raster dataset ERROR 010240: Could not save raster dataset to E:\temp\g_g_g2 with output format GRID." (with the g_g_g2 incrementing by 1 with each failed attempt)

It is able to create the "g_g_g" folder as well as create two files: dbldbnd.adf and hdr.adf before it fails. When it creates a "raster" folder, it creates these files as well as 5 other .adf files and a log file.

It creates a temporary IGeoDataset in a "raster" folder just fine. I have tried a number of things to get past this error without any luck.

Why am I getting this error and how can I fix it?

I have never used ArcGIS before, so if there is some important detail I have failed to add, please let me know.


texts: Using QGIS libraries to write standalone program in C#?

texts:
I have investigate some liberaries which can help me to write stand alone applications.

Is there any way to use qgis liberaries in an standalone application which is written by C#?


texts: Can I zoom the map with “z” and “a” in Openlayers3?

texts:
How can I zoom the map in Openlayers3 with "z" and "a" ? currently I use this function: map.getView().setZoom(map.getView().getZoom()+1).
 But I do not know how I can make it work when I press "A" or "Z".
Another problem is that when i zoom with this function the zoom not follow the mause


texts: How do I make a composer template that will display what is currently on the canvas in QGIS

texts:
When I load a saved template in the composer it always displays the canvas content it was saved with.  This seems counter intuitive to me.

Is there a way to save a template with an empty map item that gets filled with the contents of the current canvas so I don't have to delete the map and re-add it.


texts: how can we save vector files in openlayers

texts:
I'm using Postgis + tomcat + geoserver + openlayers for my application.

With the help of some tutorials, I have reached upto getting feature information of layers.

Next I want to edit and save the editable layers permanently.

I got the below code from the internet:

 var editable_layer= new OpenLayers.Layer.Vector("Editable Features", {
   strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
   projection: new OpenLayers.Projection("EPSG:4030"),
  protocol: new OpenLayers.Protocol.WFS({
      version: "1.1.0",
  srsName: "EPSG:4030",
  url: "http://127.0.0.1/cgi-bin/tinyows",
  featureNS :  "http://www.tinyows.org/",
  featureType: "frida",
  geometryName: "the_geom",
  schema: "http://127.0.0.1/cgi-bin/tinyows?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:frida"
  })
});

After that I have modified the code like this:

var editable_layer = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
styleMap: mystyle,
projection: new OpenLayers.Projection("EPSG:4030"),
protocol: new OpenLayers.Protocol.WFS({
    version: "1.1.0",
srsName: "EPSG:4030",
url: "http://localhost:8080/geoserver/wfs",
featureNS :  "http://localhost:8080",
featureType: "Test:ramcheck", **/*layer name*/**
geometryName: "the_geom",
schema: "http://localhost:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=Test:ramcheck" **/*i don't know how to modify this area*/**
})
});

This code is not working.

I can't see the layer contents on the map.

please help me with a sample code.

Thanks.

Edit

I got some featureNS, feature type and featurePrefix also.

then I changed my code shown below

// create three vector layers
var wfs = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.Fixed(), saveStrategy],
styleMap: sm,
projection: new OpenLayers.Projection("EPSG:4030"),
protocol: new OpenLayers.Protocol.WFS({
    version: "1.1.0",
    srsName: "EPSG:4030",
    url: "http://localhost:8080/geoserver/wfs",
    featurePrefix: "Test", **/*workspace name*/**
    featureType: "Test:ramcheck", **/*geoserver layer name*/**
    featureNS :  "http://localhost:8080/geoserver/test", **/*Workspace Namespace URI*/**
    geometryName: "the_geom"
})
});

But, this error is now shown when I try to save the edits in my layer:

 "An attempt was made to create or change an object in a way which is incorrect with regard to namespaces".

In openlayers.js below line

return data;},createElementNS:function(uri,name){var element;if(this.xmldom){if(typeof uri=="string"){element=this.xmldom.createNode(1,name,uri);}else{element=this.xmldom.createNode(1,name,"");}}else{element=document.createElementNS(uri,name);}

My geoserver workspace namespace URI is: "http://localhost:8080/geoserver/test". Is there any problem in this name?

Please give your suggestions.


texts: Creating DEM from vector contours using GRASS and R?

texts:
I want to convert vector contours to a DEM. From other posts, I wanted to use the Grass r.surf.contours tool.

Initially, I converted the vector contour layer to a rasterized contours using the rasterize (vector to raster) tool. The contours rasterized well but there was 0 values between them.

I have tried the Grass plugin but it isn't giving me good results.  I suspect it is because of the 0 values.

How do I strip these out?


texts: Merging 3 x, y csv into 1 and save to file geodatabase using ArcPy with ArcGIS Pro

texts:
import arcpy
sr = arcpy.SpatialReference(4326)
arcpy.env.workspace = "C:/GEO/EX1/EX1/"
arcpy.Merge_management(["Crimes_-_2010", "Crimes_-_2011","Crimes_-_2012"],
                       "C:/GEO/EX1/EX1/NEWDB.gdb")

How do I geocode 3 csv files create a new feature class crime_new?
I am just starting out with this, and I could not find anything in the docs/Google. The CSV has X Coordinate and Y Coordinate Columns.


texts: Turning off the scroll-to-zoom functionality in CartoDB

texts: I have the following post that has four embedded full width maps. When you scroll down the post and the cursor is over one of the maps, it stops the scroll to zoom in on the map. Is it possible to turn off that functionality?


texts: How to rotate a Contextily basemap in matplotlib and Jupyter notebook

texts:
I asked this question on Stack Overflow because I thought the Jupyter Notebook and matplotlib aspects were better suited for that forum, but I didn't have any luck; it is also a geopandas and contextily question, so I think it is applicable here, too.
I am making a set of figures with subplots in Jupyter Notebook using matplotlib and geopandas. The top plots (A & B) have geospatial data and use various basemaps (aerial imagery, shaded relief, etc.). How can I rotate the top two plots 90-degrees, so that they are elongated?
(I will need to redo gridspec layout of course, but that is easy; what I don't know how to do is: rotate the plots but keep the geographic information for basemap plotting.)
Repeatable code is below.
import pandas as pd
import geopandas as gpd
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import contextily as ctx
from shapely.geometry import Point
plt.style.use('seaborn-whitegrid')

### DUMMY DATA
long, lat = [(-118.155, -118.051, -118.08), (38.89, 39.512, 39.1)]
q, t = [(0, 70500, 21000), (0, 8000, -1200)]
df = pd.DataFrame(list(zip(q, t, lat, long)), columns =['q', 't', 'lat', 'long'])
gdf = gpd.GeoDataFrame(df, geometry=gpd.points_from_xy(df['long'], df['lat']))
gdf.crs = "EPSG:4326"

### PLOTTING
fig = plt.figure(figsize=(10,7.5), constrained_layout=True)
gs = fig.add_gridspec(3, 2)
ax1 = fig.add_subplot(gs[0:2, 0])
ax2 = fig.add_subplot(gs[0:2, 1], sharex = ax1, sharey = ax1)
ax3 = fig.add_subplot(gs[-1, :])

### PlotA
gdf.plot(ax = ax1)
ctx.add_basemap(ax1, crs='epsg:4326', source=ctx.providers.Esri.WorldShadedRelief)
ax1.set_aspect('equal')
ax1.set_title('Plot-A')
ax1.tick_params('x', labelrotation=90)

### PlotB
gdf.plot(ax = ax2)
ctx.add_basemap(ax2, crs='epsg:4326', source=ctx.providers.Esri.WorldImagery, alpha=0.5)
ax2.set_aspect('equal')
ax2.set_title('Plot-B')
ax2.tick_params('x', labelrotation=90)

### PlotC
ax3.scatter(df.q, df.t)
ax3.set_aspect('equal')
ax3.set_title('Plot-C')
ax3.set_xlabel('q')
ax3.set_ylabel('t')


texts: Removing raster values using a threshold in QGIS and interpolating

texts:
I have an imagery (plant cell density) comprising vine rows and grass inter-rows.I'm trying to permanently remove all the values of inter-row grass through setting up a threshold value. The vines mostly have higher values than grass.

After removing all the grass values, I want to interpolate a new map (krig) using only vine values.
Would someone know how to do that?


texts:
I have a problem in creating some polylines in one Shapefile with PyShp 1.2.
The plan is to read a GML file containing LineStrings and create a shapefile.

The theory is clear, but the realworld is different.
As I understand the syntax is as follows:

      w.line(parts=[[[1,5],[5,5],[5,1],[3,3],[1,1]]])

This one is a fixed line, but my lines are flexible.
My thoughts were, to extract the Coordinates from the GML file and concatenate it to a String which meets the PyShape Syntax.
My results are therefore:

[[[-94,-49.1152],[-94.45451,-49], .... ,[-93,-49.30391],[-94,-49.1152]]] <-- named "coords"

The idea in using s.line(parts=coords) failed due to needed float values.

The question here is, how to meet the syntax and stay flexible in the same way.
Maybe my Python skills are still too basic, but the following links did not help:

Using pyshp to convert .csv file to .shp? <-- used points

Unable to create shapefile using shapefile.py
 <-- used also points

Using PyShp to convert polygons in *.csv to *.shp files? <-- comes close, but is fixed due to rectangles

Long story short: How can i create a polyline shape with lines of different length, based on coordinates available in variables.

I know that there are additional lines nessecary, but those are not the problem.


texts:
I can load S-57 ENC vector files in .000 format and view the data. I would like to visualise them as the S-52 standard details.

These are nautical charts, some more detail here:
https://en.wikipedia.org/wiki/Electronic_chart_display_and_information_system_(maritime)

I have seen the OpenENV plugin for Grass but can't see how to get this working in QGIS, is it possible?


texts: Using ArcGIS to measure distance between two points along a line

texts:
I am trying to measure the distance between two bus stops along the bus stop route.    I've been trying to use Locate Features Along Routes to measure this distance, but I don't know if the resulting table is accurate - or I'm not sure how to interpret it.

I understand that Distance is the distance from each point to the line, but does Meas show the distance along the line?  I've measured it manually and is about 5000 feet.

Edit: I realized that the "Meas" column dictates the distance from the beginning of the line to the first and second points.  I also dissolved the line so it was not segmented.


texts: GDal problem "no suitable image found" when I run “ogr2ogr” command

texts:
I am trying to run "ogr2ogr" command

macbook$ sudo ogr2ogr -f "PostgreSQL" PG:"dbname=test user=postgres" /Users/macbook/planning.gdb

But I am getting this error:

dyld: Library not loaded: /Library/Frameworks/GDAL.framework/Versions/1.10/GDAL
  Referenced from: /Library/Frameworks/GDAL.framework/Programs/ogr2ogr
  Reason: no suitable image found.  Did find:
    /usr/local/lib/GDAL: not a file

I following this answer :
Error Updating GDAL with Homebrew

macbook$ export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH
macbook$ which ogr2ogr
/Library/Frameworks/GDAL.framework/Programs/ogr2ogr

But I am getting this error whenever I run the "ogr2ogr" command

macbook$ sudo ogr2ogr -f "PostgreSQL" PG:"dbname=test user=postgres" /Users/macbook/planning.gdb
dyld: Library not loaded: /Library/Frameworks/GDAL.framework/Versions/1.10/GDAL
  Referenced from: /Library/Frameworks/GDAL.framework/Programs/ogr2ogr
  Reason: no suitable image found.  Did find:
    /usr/local/lib/GDAL: not a file

When I run : macbook$ ls /usr/local/lib/
I can find the folder :

dtrace                  libopencv_highgui.dylib
gcc                 libopencv_imgproc.2.4.6.dylib
gdal                    libopencv_imgproc.2.4.dylib


texts: color point shapefile based on cell values

texts:
I am using QGIS.

After exporting a point shapefile from a raster file, I like to know how can I color the point shapefile with a cell values.


texts: Passing layer that caused signal to another function with PyQGIS?

texts:
I've been searching for a while to find a way to pass the layer that caused a signal to another function.   I have a list of layers that that I want to apply automated attributes to.   This has complicated this task a bit.
I've looked at some similar posts (1), but haven't been able to apply any solution to the code below.

Send signal when attributes modified - QGIS 2.6

enter

from qgis.core import *
from qgis.utils import iface
from PyQt4.QtGui import  *

list_editable_layers = [layer1, layer2, layer3]

def openProject():
    # list the layers to listen to for edits
    editLayers  = list_editable_layers
    for l in editLayers:
        # Update feature attributes when new features are added or geometry changes
       l.featureAdded.connect(updateFeatureAttrs)
        l.attributeValueChanged.connect(updateFeatureAttrs)
        l.geometryChanged.connect(updateFeatureAttrs)

def updateFeatureAttrs( fId, geom=None ):
    # how do you pass the layer that cuased the signal to this function?
    editLayer   = iface.activeLayer()

def saveProject():
    pass

def closeProject():
    pass


texts: Polygonizing distinct values using QGIS?

texts:
I am using QGIS 3.0.3 and I am trying to create simulated data through two sets random points distributed along two gradients of values (photo below).  Using the raster calculator I created two rasters with multiple bands that represent those values.  In reading about how to create random points, I found that I needed to have polygons to use the random point generator.  After a bit of futzing with some human error, I finally was able to polygonize the raster but there weren't any values associated with the polygons when the file was created (photo also below).

How can I preserve the distinct values of the raster in the polygon (i.e., the area that has a value of 1 in the raster having a value of 1 in the polygon file)?


texts: How to create a centerline from polygon in Arcgis 10

texts: In Network Analyst, I want to create a center line from a road polygon layer of an area for shortest path creation. How do I do this in ArcGIS 10?


texts: Methods for geotagging/displaying text documents

texts:
I'm wondering what methods folks are familiar with for geotagging/displaying text documents, or the text from a document. For example, it's easy enough to geotag a photo and display it in ArcGIS or Google Earth. But what if I have an extended textual description of a place? Is it possible to geotag that, export it as a shapefile, and display that text in a GIS? One possibility seems to create a text field, but that seems limited in characters.

Any suggestions would be much appreciated.


texts:
I am trying to write a sql to query one land parcel for intersections between itself. I can do this fairly easy in QGIS using topology checker but i don’t know why this does not produce the correct results.

    select * from land_parcel as a
join  land_parcel as b where
ST_Intersects (a.geom,b.geom) and a.gid <>b.gid


texts: Using arcpy to create a layer from business analyst dataset

texts:
I'm trying to automate several of our processes using Python in ArcGIS for Desktop 10.3. At least one of these tasks involves running a query against block group data provided by Business Analyst (BA). My problem is that I can't figure out how to bring the BA data in to do the query. My assumption is that I need to create a layer from the .bds file. Currently, my code looks like:

bg_file = r'C:\ArcGIS\Business Analyst\US_2014\Data\Demographic Data\esri_bg.bds'
bg_layer = 'bg_layer'
arcpy.MakeFeatureLayer_management(bg_file, bg_layer)

When I run this in a script (i.e., outside of ArcMap), I get:

arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Features: Dataset C:\ArcGIS\Business Analyst\US_2014\Data\Demographic Data\esri_bg.bds
does not exist or is not supported
Failed to execute (MakeFeatureLayer).

Meanwhile, inside the python window of ArcMap, if I run:

arcpy.MakeFeatureLayer_management(r'C:\ArcGIS\Business Analyst\US_2014\Data\Demographic Data\esri_bg.bds', 'bg_layer')

I get:

Runtime error  Traceback (most recent call last):   File "<string>", line 1, in <module>
File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\management.py", line 6520, in MakeFeatureLayer
    raise e ExecuteError: ERROR 000229: Cannot open C:\ArcGIS\Business Analyst\US_2014\Data\Demographic Data\esri_bg.bds
Failed to execute (MakeFeatureLayer).

which is a similar error, but seems slightly different.

Clearly, there's something I don't understand here. I'm able to use the MakeFeatureLayer_management function to create layers from other (non-bds) files. Is there something special about .bds files that prevents me from doing this? If so, what's the preferred method of creating layers from .bds files in arcpy?


texts: Python Delete point in a distance of x meters

texts:
I took this code from this source Select maximum number of points more than x meters apart

It seems to work for other users, but for me it's an endless loop. I do not understand why, though the code makes sense. The code itself gives me the result I want to get.

Can you help me out of this endless loop:

import arcpy, sys

feature = arcpy.GetParameterAsText(0)
distance = 500

arcpy.gp.overwriteOutput = True

#running NEAR analysis - every point gets attribute of a distance to the nearest point
#in same feature class
arcpy.AddMessage("running first near analysis")
arcpy.Near_analysis(feature, feature)

arcpy.AddMessage("inserting cursor")
cur = arcpy.UpdateCursor(feature)
row = cur.next()

arcpy.AddMessage("starting loop")

i=0
while row:
    i+=1
    #fids list will store list of deleted points so if any other point will have
    #deleted one as the nearest and distance < 150 will not get deleted as this
    #distance is no longer true
    fids = []
    while row:
        if row.NEAR_DIST < distance:
            try:
                #it seems I didn't know if .. in .. at the time ;) such a fun to dig
                #this script up! index throws an exception if element is not in the
                #list
                fids.index(row.NEAR_FID)
                arcpy.AddMessage("OBJECTID = " + str(row.OBJECTID) + " is listed!")
            except:
                arcpy.AddMessage("deleting OBJECTID = " + str(row.OBJECTID))
                fids.append(row.FID)
                cur.deleteRow(row)
                d = 1
        row = cur.next()
    del cur, row, fids
    try:
        #this idiotic test is to break the loop when no points will have
        #NEAR_DIST < 150, shameful - I know!
        if d == 1:
            pass
    except:
        sys.exit()
    d = 0
    arcpy.AddMessage("loop iteration " + str(i))

    #and again we go..
    arcpy.Near_analysis(feature, feature)
    cur = arcpy.UpdateCursor(feature)
    row = cur.next()

The functional CODE:

import arcpy, sys

feature = arcpy.GetParameterAsText(0)

def nearRoutine():
    #calculate the distances using the current dataset
    arcpy.Near_analysis(feature, feature)

    #iterate through any features which are within the distance
    cur = arcpy.UpdateCursor(feature, '"NEAR_DIST" < 500')
    row1 = cur.next()
    while row1:

        #this point is within the distance of its neighbor, so delete it
        cur.deleteRow(row1)

        #now re-run this routine on the new dataset
        del row1, cur
        cur = arcpy.UpdateCursor(feature, '"NEAR_DIST" < 500')
        row1 = cur.next()
        nearRoutine

#call the recursive routine. It will get progressively faster to run as it will loop through fewer points each time
nearRoutine()

Thanks @Stephen Lead


texts: How to update ArcGIS online metadata using the API?

texts:
I am trying to update metadata (XML file) for ArcGIS online items using the REST API but I am not quite sure how to do that.

It says in the documentation that I should be able to change the metadata  on the Add Item and Update Item operations, but not exactly how:

http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000009v000000

Here is my try which returns a success but doesn't actually change the metadata.

def update_metadata(user, item, token, metadata):

    d = {'metadata': (metadata, open(metadata, 'rb')),
         "token" :token,
         "f":"json"}

    url = 'http://www.arcgis.com/sharing/rest/content/users/{0}/items/{1}/update'.format(user, item)
    r = requests.post(url, data = d)

    response = json.loads(r.content)

    if 'error' in response.keys():
        raise Exception(response['message'], response['details'])

    return response

Did anyone already successfully updated metadata for ArcGIS online items using the REST API, and if yes how?


texts:
My dataset: a shapefile containing squares of 1km size. It's huge, this is just a sample:

My aim: divide each cell so that the end result would be the same grid with 500m each cell. Something like this:

Since the grid is huge I would need a way to make these squares smaller automatically. Any ideas on how to do it in ArcGIS 10.3?


texts: Loading label information from a QGIS syle file (.qml)?

texts:
When my homebrewed style for road symbology and labeling is saved to a qml file, I am unable to load the labeling information from the qml file onto the same shapefile. This is the case for both the same map document and a new map document. The saved style loads but the labeling is blank. Here is a tar.gz with the roads shapefile, qml layer, and interstate symbol.
Is this a bug or am I doing something wrong?

QGIS Info

QGIS version - 2.12.3-Lyon
Compiled against Qt 4.8.6 - Running against Qt 4.8.6
Compiled against GDAL/OGR 1.10.1 - Running against GDAL/OGR 1.10.1
Compiled against GEOS 3.4.2-CAPI-1.8.2 - Running against GEOS 3.4.2-CAPI-1.8.2 r3921
PostgreSQL Client Version 9.4.4
SpatiaLite Version 4.1.1
QWT Version 6.0.0-svn
PROJ.4 Version 480
QScintilla2 Version 2.8.4


texts:
What are the formats supported by OpenLayers 3?

I need open in OpenLayers a map with different colors, like the image below. So, which format should I export? I'm using QGIS and ArcMap to create the maps.

This map represents the Brazil population by regions (the darker the color, the greater the population). The data is coming from a shapefile where each row represents one different region (5570 regions in total).

Shapefile attribute table (example):


texts: Using fontawesome unicode with OpenLayers style?

texts:
I want to style a feature with fontawesome icons. When I define unicode icon hardly, The style work correctly. But when I want to get unicode from a text field, It dosn't work. See the sample in jsFiddle.

const map = new ol.Map({
    ...
});

const textInput = document.getElementById('textinput');

const vectorSource = new ol.source.Vector();
const vectorLayer = new ol.layer.Vector({
    source: vectorSource,
  style: function(feature, resolution) {
    return new ol.style.Style({
        text: new ol.style.Text({
        text: feature.get('text') + ' => ' + textInput.value,
        font: '20px FontAwesome'
      })
    })
  }
});
map.addLayer(vectorLayer);

const feature = new ol.Feature();
feature.set('text', '\uf0ac')
vectorSource.addFeature(feature);

In generally, I want to save the unicode in db, and then get It and show. How can I use fontawesome with unicode in OpenLayers?


texts: Rescuing Geopackage that appears corrupted with wal mode open QGIS

texts:
I tried to re-open a QGIS map document that referenced several layers stored in geopackages. These layers failed to load, with the "Handle unavailable layers" dialog.  I think they were open in -wal mode when QGIS crashed.  QGIS won't open these geopackages at this point, I tried opening them in R using the sf package, but this fails with the message that the geopackage is wal mounted.

I tried copying the geopackage and reopening, based on information that suggested that I'd potentially lose uncommitted changes, but after copying the file it still failed to load.  The .wal file appears empty (0kb and looked empty if I opened in a text editor).  I can see both the .wal and .shm files in my file explorer.

Edit- I copied the entire directory with my project onto another drive, but without the .wal and .shm files.  When I did so, I was able to open the QGZ file and load the problematic layers.  I then tried to delete the recent files from the working directory and replace them with the working copy from the backup drive, but they still didn't load the layers stored in the geopackage.

Is there a way to rescue these files, or do I just need to give up and roll back to my last backup?

Further, are there best practices to use to prevent this in the future?


texts: Efficient algorithms for recovering watershed boundaries?

texts:
This is somewhat related to a previous question I asked:
What Algorithm is used by ArcGIS Watershed tool?

I was wondering if there is a more efficient way to calculate catchment areas if you are interested only in the polygon defining the catchment area (rather than all cells contributing to the catchment area). Doing a recursive search seems very expensive and would return a lot of information we don't want (namely each cell within the area).

Assuming the same starting point - a raster grid and a pour point/outlet (I leave it open for now whether the raster is a DEM, Flow Direction or Flow Accumulation).

My first thought was to simply follow the 'steepest path' upstream of the outlet point, which would quickly take us to the 'edge'. But I could not think of a way to follow the 'edge' around.

Are there any other possibilities?


texts:
I have list of points. I am pushing these points to an array. Now when i draw polyline through esri map graphics.add then its not shwoing anything.

My code for drawing polyline on esri map is as follows:

  var Points = new Array();
            var PointsGoogle = new Array();
            for (VIndex = 0; VIndex < ItemList.Coordinates.length; VIndex++)
            {
             latlng = new  esri.geometry.Point(ItemList.Coordinates[VIndex].X,ItemList.Coordinates[VIndex].Y);

                Points.push(latlng);

                //  polyline.addPath([new esri.geometry.Point(10,10), new esri.geometry.Point(20,20), new esri.geometry.Point(30,30)]);
            }

      var polylineSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([204, 102, 51]), 4);
          var polyline = new esri.geometry.Polyline(esrimap.spatialReference);
      polyline.addPath(Points);
      esrimap.graphics.add(new esri.Graphic(polyline, polylineSymbol));


texts: Choosing data source when serving vector tiles from GeoServer?

texts:
I am about to set up a basemap with some 20-30 layers, served as a group layer in GeoServer. Output format is pbf vector tiles.

Should I stick with postgis or shapefiles if I want best possible performance?

Will use some attributes for styling but the attributes will be slimmed to a minimum.

The layer will be rendered by OpenLayers.


texts:
I need to use calculate field to carry a date of a table to another that has a field in common (MATERIALES). I need VALOR=Indice_R. I am trying with

def RecarI(tipo1,id,tipo2):
    tipo1=tipo2
    id=tipo1
    if ('id=0'):
        return  1
    elif ('id=1'):
        return  2
    elif ('id=2'):
        return  3
    elif ('id=3'):
        return  1
    elif ('id=4'):
        return 1
    elif ('id=5'):
        return  1
    elif ('id=6'):
        return 2
RecarI( !Recarga.MATERIALES! , !Recarga.OID!, !Geologia_LR.MATERIALES! )

but not working

.


texts: Querying & filtering raster data from PostGIS using GeoServer

texts:
I'm currently working with raster data and serving it to a web application using Geoserver. I want to be able to perform queries to retrieve the raster data from a PostgreSQL database with the PostGIS extension to a web application. One of the solutions was to use the ImageMosaicJDBC plugin but I haven't been able query or filter the raster data stored in the PostGIS database from either the WMS or WCS services in Geoserver.

I want to know is there is a standard way to perform queries or filters on raster data based on WMS or WCS requests through a front end such as OpenLayers. Do I use the ImageMosaic plugin instead of the ImageMosaicJDBC? Is WCS more appropriate for these purposes?


texts: Recording selection with and without .lyr file using ArcPy

texts:
I tried recording a selection using first arcpy.SelectLayerByAttribute_management and then 'arcpy.CopyFeatures_management' but since my input was a feature class I get an error. So, I converted my input into a .lyr and now my output is empty when I open it in Arcgis.

import arcpy
arcpy.env.workspace = "C:/Temp/PyData"
shpfile = 'building_split.shp'
arcpy.MakeFeatureLayer_management(in_features=shpfile,
                                  out_layer="bui_lyr")
lyr = 'bui_lyr'
arcpy.SelectLayerByAttribute_management(in_layer_or_view=lyr,
                                        selection_type= "SUBSET_SELECTION",
                                        where_clause= '"length" > 25')

arcpy.CopyFeatures_management(in_features=lyr,
                              out_feature_class= 'res_building_25')

Here is my code, I guess there is a simple mistake somewhere I just began writing scripts in Python. Also, how can I perform a selection on my feature class. I guess I am not obliged to go through the creation of a .lyr file.

Edit: I did another try with a simpler code below, the test.shp file remains empty

import arcpy
arcpy.env.workspace = "C:/Temp/PyData"
arcpy.MakeFeatureLayer_management("building_split.shp", "bui_lyr")
arcpy.SelectLayerByAttribute_management("bui_lyr", "SUBSET_SELECTION", "length > 25")
arcpy.CopyFeatures_management("bui_lyr", "C:/Temp/PyData/Test.shp")


texts: Handling "illegal data type (Float64)" error when trying to convert .tif to .bil?

texts:
Each time I try to convert (in QGIS 2.2) an elevation model from .tif to .bil format a get this error:

  ERROR 1: Attempt to create ESRI .hdr labelled dataset with an illegal
  data type (Float64).

The same error occurs when I use the clipper with .bil as output file format.

What does the error message mean?


texts: Embedding YouTube on CartoDB infowindows

texts:
I am embedding my CartoDb as follows

$('#map').ready(function(e){
    cartodb.createVis('map', '//internetadventureclub.cartodb.com/api/v2/viz/617ba774-fd8c-11e4-9e57-0e4fddd5de28/viz.json', {https: true});
  });

How can i enable sanitizeTemplate:false in the above so that the YouTube Video can be played in the infowindow of CartoDB


texts:
I have a set of rasters in DTED format which I load into PostGIS database using raster2pgsql command line tool.

Each of rasters is simply stored in a row and described by rid and a value of raster format.

Now, I want to create a database function which takes longitude and latitude of a point and returns a value of pixel corresponding to this point.

The problem I have is that it takes quite a lot of time to do that (3-4 secs) because the database works on Odroid board.

I know that the dataset I process is quite big (the rasters cover the whole UK area) but as I am not very familiar with PostgreSQL and PostGIS I suspect it can be done faster.

This is what I've done so far:

SELECT ST_Value(rast, ST_GeomFromText(CONCAT('POINT(', $1, ' ', $2, ')'), 4326))
FROM (
    SELECT * FROM rasters
    WHERE rast && ST_GeomFromText(CONCAT('POINT(', $1, ' ', $2, ')'), 4326)
) x;

$1 and $2 are long and lat respectively.


texts: How to give color to polygon border in leaflet map

texts:
I am using geojson-vt for genreating polygon on leaflet map.polygon which is genreated is having some color...here i want to give different color to polygon border ...below is my geojson

{
  "type": "FeatureCollection",
  "features": [
    {
      "geometry": {
        "coordinates": [
          [
            [
              74.276821428571402,
              20.089249999999982
            ],
            [
              74.267821428571402,
              20.089249999999982
            ],
            [
              74.267821428571402,
              20.098249999999982
            ],
            [
              74.276821428571402,
              20.098249999999982
            ],
            [
              74.276821428571402,
              20.089249999999982
            ]
          ]
        ],
        "type": "Polygon"
      },
      "type": "Feature",
      "properties": {
        "description": "This is crop value",
        "color":"#ffb6c1",
        "pixel": {
          "latitude": 20.093749999999982,
          "vci": 2,
          "longitude": 74.272321428571402
        }
      }
    }

what changes should i do to genreate polygon with different border color.

am using leaflet to display polygon and geojson vt for drawing the polygon

       tileIndex = geojsonvt(data, tileOptions);

    tileLayer = L.canvasTiles()
                  .params({ debug: false, padding: 5 })
                  .drawing(drawingOnCanvas)

    var pad = 0;

tileLayer.addTo(leafletMap);


texts: How to create a relationship without NULL tables?

texts:
I made a relation (1:n) between 2 tables. Not every element from the parent layer has a connection with features from the child layer. The relation is made between 'Tipo de Estrutura' Field and 'Est' Field like shown below.

The relation is made correctly. My problem is with the elements that have no relation (Example 'Rocha'). When I open the 'identify feature' of 'Rocha' Element is shown a relationship table with no elements. It is possible to only show relation when exist or hide this connection?


texts:
I have two raster surfaces that have the same resolution and footprint.

They represent two soil layers.  As such, one should always be less than the other because that soil layer can't cross above the other.

Grid1 should always be "above" Grid2.

But my raster data don't reflect that so what I want to do is identify all pixels of Girid2 where Grid2 > Grid1 and replace them with the Grid1 values.

The desired result is a modified version of Grid2 that will be equal to Grid1 where it used to be greater than Grid1. The two surface will "kiss" in those spots.

this is what I'm trying but it doesn't appear to work

Con("Grid2">"Grid1","Grid1","Grid2")

I want it to evaluate as:

Where Grid2 > Grid1, replace with Grid1, otherwise keep Grid2


texts: How to split epsg 4326 linestring in parts consisting of given length in meters in python?

texts:
I want to know linestrings (epsg:4326) length in meters instead of degrees.
I know that I can use proj4 for that.

Here is my code, if you interested.

project = partial(
    pyproj.transform,
    pyproj.Proj(init='EPSG:4326'),
    pyproj.Proj(init='EPSG:3395')
)

project2 = partial(
    pyproj.transform,
    pyproj.Proj(init='EPSG:3395'),
    pyproj.Proj(init='EPSG:4326')
)

def distance_in_meters(linestring):
    return transform(project, linestring).length

def interpolate(distance, linestring):
    current_ratio = 0
    points = []
    step = distance / distance_in_meters(linestring)

    while current_ratio < 1:
        point = linestring.interpolate(current_ratio, normalized=True)
        current_ratio += step
        points.append(point)
    return points

distance_between_points = 249.67
total_distance_in_meters = distance_between_points * 5

class TestInterpolate(TestCase):
    def test_interpolate(self):
        with open("linestring.json", 'r') as f:
            s = shape(json.load(f))
            points = interpolate(10, s)
            l = LineString(points)
            self.assertEqual(distance_in_meters(l), total_distance_in_meters)

And here is linestring that I use for tests.

{
  "type": "LineString",
  "coordinates": [
    [
      37.6232398,
      55.7615482
    ],
    [
      37.6262633,
      55.7606701
    ],
    [
      37.6232398,
      55.7615482
    ],
    [
      37.6262633,
      55.7606701
    ],
    [
      37.6232398,
      55.7615482
    ],
    [
      37.6262633,
      55.7606701
    ]
  ]
}

What I've done is I've taken coordinates of two points from google maps and measured distance between them also in google maps.
Than I've duplicated it several times creating a path that swings back and forth 5 times.

And the result of the test is

1864.394777794176 != 1248.35

Which is pretty far off from the actual distance of linestring.
I suppose that the reason is - I'm not using right CRS for meters projection.


texts: Esri storymap app deploy without AGOL login

texts:
I was wondering if anyone has tried to modify the source code of any downloadable esri storymap templates so that it doesn't require AGOL login?

After reading this blog post:
http://blogs.esri.com/esri/arcgis/2013/08/01/new-developer-subscriptions-for-arcgis-online/

"ArcGIS now supports OAuth so developers can build applications for organizations using ArcGIS Online. Developers can also expose ArcGIS Online functionality to users without ArcGIS logins and build consumer facing or B2B applications for wider audiences. Just create an app, register it, and it is assigned an App ID and App Secret."

it seems that it might be feasible, and I can generate the necessary IDs, but I am not sure how to modify the code to consume these IDs. Can anyone provide some guidance?

Ideally I would like to host the app on my server (with a proxy setting) and make it available to users with no AGOL subscription. Might be useful to mention that there will be no basemaps or feature layers in my app, just images and text.

Any ideas?


texts: r.in.gdal tries to create file in incorrect repository

texts:
I am trying to import a DEM in GTIFF format with:

r.in.gdal --overwrite input=$user_filename output=srtm_mosaik_utm -o

but I get the message:

Input contains an invalid SRS. WKT definition:
LOCAL_CS["Unknown",UNIT["metre",1,AUTHORITY["EPSG","9001"]]]
ATTENTION: Unable to convert input map projection information to GRASS format.
Over-riding projection check
Importing raster map <srtm_mosaik_utm>...
ERROR 4: Attempt to create new tiff file `/home/d-name/d-name/eclipse-workspace/Detection/inputs/Artificial/srtm_mosaik_utm' failed: Aucun fichier ou dossier de ce type (No file or repository of this type)
ERREUR :Impossible de créer le jeu de données <srtm_mosaik_utm> avec le pilote <GTiff>

Which is logical since the directory path '/home/d-name/d-name/eclipse-workspace/Detection/inputs/Artificial/' is incorrect (should be '/home/d-name/eclipse-workspace/Detection/inputs/Artificial/').

However, I don't understand how I can modify this output path?
I must have changed it since it worked before.


texts: Strange output of Kriging standard deviation

texts:
For my thesis I am interpolating some 4000 boreholepoints via Kriging to try and visualize a geological layer under the ground level. Since I know there is a strong trend in my data (SW-NE slope) I read that using a lineair detrend can be useful to get more detail in the result. I wanted to compare the results of applying a detrend and not applying one. And indeed, the detrended gives a more useful semi-variogram and shows more detail (whether this is useful for my case is still the question).
However, I also want to compare both standard deviation outputs, to view where the interpolation isn't working as well. For the detrend outpout it shows a clear map. But on the no-detrend one gives a rather strange output.

The two upper maps are the Kriging output and the two below are the standard deviations. Can someone perhaps clarify this output and why it has these holes in it?


texts:
I am looking for Melbourne shape file map (boundaries or suburbs or roads). Just for Melbourne.

Any one knows where I can download it?


texts:
I am using QGIS on Ubuntu, mainly to create maps for scientific articles. To get reliable colours at the end, I would like to use a colour managed  view inside QGIS. Is there a way to do this, i.e. by specifying an ICC profile, like in other applications such as GIMP or Inkscape?
Edit: As requested, here is a visual example of what I mean by unreliable colors. On the left side is an exported map in a image viewerthat has no support for color management. This is how I see it when working in QGIS. On the right side the very same file is opened in an image viewer with colour management (i.e. how others on average will see it). This is not a technical problem with the screen. High-end wide gamut monitors for graphic designers might show even more disparate colors. This is why most graphic programs offer colour management, not only for content that has to be printed but also for web content.


texts:
Objective: Convert different single part features with same attribute in a field (say 'Country') to a single multipart feature while retaining original geometries.

I have been looking for an ArcMap alternative of collect geometries tool available in QGIS 3.0+ but strangely enough, couldn't find it.

Closest match probably is dissolve tool which is identical to 'Collect Geometries' tool in QGIS as far as features (with same country name) are disjoint. For overlapping or adjacent features, it doesn't retain the original shapes and dissolve the shapes as well. I have also tried union and different other tools but no success.

I am open to ArcPy solutions as well. I hope that this image will help to understand the concept.


texts: Navigating a road network and avoiding u-turns

texts:
I've implemented a node-based A* search of a road network graph.

I would like to penalize u-turns a places where bi-directional streets join together again, which I identify successfully via a match on turn angle and street name.

Although I can add penalties to u-turns by duplicating nodes and creating distinct, expensive edges for the u-turn paths, these don't have the desired effect when running a node-based search.

The result is an effect that is localized to the immediate region of the u-turn. As the node-based A* walk continues to expand outwards from the region, any inward route evaluation is prevented. The optimum route is not found. The u-turn penalty is eventually overcome and the u-turn is chosen as the best route.

I do not have this problem if I walk edges rather than nodes, as inward routes are evaluated. But edge-based walking is noticeably inefficient.

Is there a known solution to this problem? Can I keep node-based routing and penalise difficult turns?


texts: Combine raster values for overlapping cells of multiple rasters

texts:
How do I combine the values of cells for 3 rasters for cells where they overlap. I want the output raster to cover only the area of the overlap for the 3 rasters and the output cell values to be a sum of the values of the 3 original rasters.

I am using arcmap 10.2. If this is possible through raster calculator it will be preferable. Or any of the spatial analyst tools


texts:
How can I open new Map?

I did the following steps:

Opened QGIS
Add Vector layer
Make Mar LQAS in csv file
Make Mar LQAS in shp file

The Map is still not visible.


texts:
Looking at a fairly old answer regarding exporting wikimapia data, there was a recommendation to use geodeg.com - it is indeed an easy interface. However, there doesn't seem to be an option of exporting en mass all the data but only the option to select 50 at a time.

Is there an option to export to KML or similar type all the information?

For example, all the schools in Albania - http://geodeg.com/search.php?q=school&language=&country=2