texts: Use gdalwarp to crop area with simple coordinate system

texts:
I'm new to GIS and trying to cut image with gdalwarp

I need image projected like google map and I need to input coordinates of area of interest in latidute longitute system, like:

from 45.3 10.2 to 45.8 10.5

Source file as this info:

PROJCS["WGS 84 / UTM zone 32N",
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
    AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32632"]]
Origin = (501592.500000000000000,5215807.500000000000000)
Pixel Size = (15.000000000000000,-15.000000000000000)
Metadata:
  AREA_OR_POINT=Point
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  501592.500, 5215807.500) (  9d 1'15.54"E, 47d 5'44.79"N)
Lower Left  (  501592.500, 4979992.500) (  9d 1'12.71"E, 44d58'24.14"N)
Upper Right (  733807.500, 5215807.500) ( 12d 4'42.99"E, 47d 3'15.77"N)
Lower Right (  733807.500, 4979992.500) ( 11d57'47.40"E, 44d56' 5.69"N)
Center      (  617700.000, 5097900.000) ( 10d31'14.58"E, 46d 1'28.40"N)
Band 1 Block=15481x1 Type=UInt16, ColorInterp=Gray

I'm trying with command:

gdalwarp -t_srs "+proj=utm +zone=32N +datum=WGS84" -te 45.1 10.1 46.1 11.1 -ts 4096 4096 -overwrite source.tif output.tif

But the -te parameter has not read as coordinate. The output file is full black and as this info:

PROJCS["WGS 84 / UTM zone 32N",
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
    AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32632"]]
Origin = (45.000000000000000,11.000000000000000)
Pixel Size = (0.000244140625000,-0.000244140625000)
Metadata:
  AREA_OR_POINT=Point
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  45.0000000,  11.0000000) (  4d30'41.97"E,  0d 0' 0.36"N)
Lower Left  (  45.0000000,  10.0000000) (  4d30'41.97"E,  0d 0' 0.32"N)
Upper Right (  46.0000000,  11.0000000) (  4d30'42.01"E,  0d 0' 0.36"N)
Lower Right (  46.0000000,  10.0000000) (  4d30'42.01"E,  0d 0' 0.32"N)
Center      (  45.5000000,  10.5000000) (  4d30'41.99"E,  0d 0' 0.34"N)
Band 1 Block=4096x1 Type=UInt16, ColorInterp=Gray


texts: Integrate (or merge) raster with different resolution

texts:
I need to integrate two raster layers: the first is a land cover raster  (grid format) at 300m resolution and the 2nd is the Population raster (grid format) at 1km resolution. I need to integrate the land cover raster dataset with the information on population density from the second raster, which has a lower resolution and gets one output raster.

Do you think is it possible to integrate or merge them in one raster with the higher resolution?


texts: How to scrape/extract data from Esri ArcGIS from website

texts:
I was trying to extract data from an ESRI map embedded in a website. The objective would be by introducing geographic coordinates to be able to access the values present on the map.
I leave here a print of the map and the respective address. I just cannot understand which method I should use since the map is embedded in the site. What processes should I use?
*for academic purposes
https://zonamentopf.portaldasfinancas.gov.pt/simulador/default.jsp


texts: How do I open and edit a table in my geodatabase

texts:
I created a file geodatabase with some tables.  I created a new table and specified the field properties.
Now, how do I open the table to populate the fields?


texts:
We are using GeoServer 2.8, PostgreSQL 9.6 & QGIS 2.16 on our side. We have certain WFS layers.
As per documentation disabled Anonymous WFS access and looking more settings for Web part.

However in QGIS by adding our GeoServer IP details using URL like "http://123.456.789.25/geoserver/wfs?" can able to add WFS service connection and able to download data in shapefile format, but not able to 'edit data' that's good part.

How to disable 'save as to shapefile' option for WFS service? Is there anything more need to configure on GeoServer?

Please check following screenshot

Checking on Geo-server security links for reference


texts: What is the recommended way for team coordination in GIS (ArcGIS, QGIS, etc.)

texts:
I am preparing a team of around 18 GIS analysts to work on 12h/12h work cycle to attain 24h/day work rate. This means two 9-person teams, one for each period.

All analysts will have access to various types of raster data, where they will use them to essentially register line, point and polygon features. Some of these line, point and polygon vector layers have topological rules with themselves and each other.

I would like to have access to the work progress and efficiency of each analyst. A summarized report (visual and textual) should also be automatically generated as a handover report for the next time period's analyst. Furthermore, I would love to have the power to roll back certain analysts changes to the GIS map shared by all members. All this information should be enough for the manager to make the correct decision.

I know there are database solutions such as ArcGIS server and POSTGIS, but I am not sure how I can apply them to this problem.

I would love to read what you guys have used or thought of using in the past.


texts: Are there any tools available in any GIS environment for route alignment? To be specific, the tool should take a DEM and road-construction parameters -- distance and gradient, roadfill, drainage crossings, starting point and end point -- as input? I have used path distance in ArcGIS but it is very basic. Are there any tools which have been developed completely for this specific task in GIS environment. Or is there any better option for this task?


texts: Why does qgis become unresponsive when adding a .sid raster layer?

texts:
Can someone provide insight into why qgis becomes unresponsive when i try to add a raster layer? Specifically a .sid raster from NAIP imagery. I can no longer add these raster layers to projects, even to projects which already have raster layers from the same source (NAIP *.sid)added previously. The same .sid raster files that will not load now have been successfully added to qgis projects in the past.

What I have tried:
Uninstalled qgis 1.7 and replaced with qgis 1.7.4 using the OSGe04W installer.
Moved raster files from external to internal hard drive.
Freed up internal hard drive space (>25% of capacity).
Tried multiple raster files.
I only have 1Gb of RAM, but this has been sufficient in the past. The raster file sizes are on average around 750Mb.


texts: Query/force only certain geometry types returned from ST_Intersection?

texts:
I have ST_MultiLineString geometry records in table_a that I'm intersecting with ST_MultiPolygon geometry records in table_b.

Nearly all of the returned GeoJSON is of type LineString but a few are type Point (cases where the intersection results in an isolated point). The returned GeoJSON is styled as a line resulting in the point type geometry displaying default leaflet point markers.

I tried ST_AsGeoJSON(ST_MakeLine(ST_Intersection(a.geom, b.geom))) but it is connecting all of the lines/points in a way that's clearly incorrect.

Is there a way to only return intersection geometry of a specific type or otherwise correctly convert/force the intersection geometry to LineString?


texts: r.terraflow fails after using fill-sinks

texts:
I'm using QGIS 3.10.11 with GRASS 7.8.4, and the default SAGA version that's included with the QGIS standalone 3.10.11 installer from QGIS.com.
I'm having an issue where r.terraflow fails after using a fill-sinks algorithm.
Please try to see if you can replicate this problem in QGIS:

Start with a raster terrain ".tif" DEM, resolution 1x1m
Run r.terraflow on the DEM from step 1 (should not produce any issues)
Export a copy of the TIFF-file from step 1 to ".sdat"
From the processing toolbox, use "Fill sinks (wang & liu)" on the .sdat-file created in step 3. Save the filled DEM to .sdat (do not use "Temporary output") untick the other boxes in the dialog window.
Try now to use "r.terraflow" on the output from step 4. (this fails)
Try to export the output from step 4 to ".tif" (works fine), and the try to use "r.terraflow" on the ".tif" (this fails).

I cannot understand what happens to the raster during the "Fill sinks (wang & liu)" step that makes "r.terraflow" crash.
On a side note, if there is no workaround to this, are there any processing tools in QGIS that calculates a flow accumulation raster using the D8 algorithm? (The raster shoud be processed with "Fill sinks (wang & liu)" beforehand).


texts: Does MakeTableView work with field_info in ArcObjects?

texts:
gp.Execute(new MakeTableView()
                    {
                        in_table = $@"Database Connections\os@gisuat.sde\TESTGIS.SOME_POLY",
                        out_view = "SOME_POLY",
                        where_clause = "STATUS = 'INCLUDED'",
                        workspace = defaultSDEWorkspace
                    }, null);

Please consider the code above. I can run it perfectly and get my results in a temp view. However, there is another option - field_info which require an object type and I have tried to fit different types of instance into this parameter but it still fail...

The type I have tried: ESRI.ArcGIS.Carto.FieldInfoSetClass, ESRI.ArcGIS.Carto.FieldInfoClass

I don't see any standard doc about this method and option... Anyone can save me out? Provided a sample code snippet that I have attempted

                    var fieldInfoSet = new FieldInfoSetClass();
                    fieldInfoSet.Add("Drawing_number", new FieldInfoClass()
                    {
                        Alias = "DN",
                        Visible = true,
                        ValueAsRatio = false
                    });

                    var tableView = gp.Execute(new MakeTableView()
                    {
                        in_table = $@"Database Connections\os@gisuat.sde\TIS2GIS.XANTHUS_DATASET\TIS2GIS.XANTHUS_POLY",
                        out_view = "XATNHUS_POLY2",
                        where_clause = "Drawing_number = 'INCLUDED'",
                        workspace = defaultSDEWorkspace,
                        field_info = fieldInfoSet
                    }, null);

Also, I cannot get any useful information from exception message/error code.

H_RESULT: -2147467259
Message: Error HRESULT E_FAIL has been returned from a call to a COM component.


texts: Connecting point to another through 'road' node using Routing and OpenLayers?

texts:
In a routing application,probably using osm as base layer, how do I get a line-string that goes through the road and not directly from one point to another?

Is there any software,like an API?

I have seen pgRouting will it do the road?

Do I need to downlaod any data?

So for example I have this situation where point A is a starting geometry point and B is the ending geometry point and the black line is the road:

If I want to use a layer with a linesting feature from Point A to B it will look like this:
(the red line is the linestring and the black one is the road.)

But what I want is the linestring to follow the road like this:

Suppose that the red like goes exactly like the black line and completely follows the road without us adding any other geometry points other than A and B!

Note that I am using OpenLayers API and I am not asking for a whole routing package, I would like to know how to connect geometry point with 'road' or 'highway' nodes.


texts: How to create a population density heatmap from attributes

texts: I'm working with a point shapefile representing the municipalities of a country. Each point has an attribute that shows the population of the given municipality. Is it possible to map this attribute by a heatmap?


texts:
I am trying to understand this command:

ogr2ogr -f "MapInfo File" original.tab wgs84.shp -s_srs EPSG:27700 -t_srs EPSG:4326

I don't understand the s_srs and t_srs paramaters. The help file says that the commands "override the source srs."

I am new to GIS. What is SRS? Is this a map making term? It is hard to google.


texts: Why is torque not working with large polygons?

texts:
It seems that torque isn't working with a "big" polygon. By "big" I mean the size of a french department.
Could you confirm that?
I would like to show the evolution of jobless rate during the last 30 years.

Thanks a lot.


texts: Extract mean raster values by fishnet in ArcGIS

texts: I have a raster of 0.25m resolution. I created a fishnet with 100*100 m in ArcGIS. I want to extract mean values of the raster from fishnet squares(100*100). I tried zonal statistics in ARC but does not help.


texts: Is there a simple way to sort layers alphabetically in QGIS?

texts:
I am working on a big GIS project and not being able to sort the items in the Layers panel is giving me hard time. I can have up to 250 layers in the Layers panel.

I have a special naming scheme for all the TIFF raster files I import and geo-reference in QGIS. But when I import them I can't import them one by one in alphabetical order, because my co-workers are working on some of the files and I am working on others. So the items in the Layers panel are all over the place. The program is not intelligent enough to sort them in alphabetical order. Instead it sorts them in the order I import them.

Here, take a look at this screenshot.

Is there no built-in option in QGIS that would allow me to sort these items? If not, is there a plugin I can install that would allow me to do this?

Edit:
I found this and the first few lines of code seem to do the trick.

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

mw = iface.mainWindow()
lgd = mw.findChild(QTreeWidget, "theMapLegend")  # get ref to object by type/objectName
lgd.sortItems(0, Qt.AscendingOrder)  # sort first column (Qt.DescendingOrder to reverse)

But I'm not a fluent C++ or a Python programmer. Seriously?... Do I have to pick up a programming cook book to sort the layers in QGIS? Could it be any more difficult?...

Is there no plugin that can do the same job? I'm afraid to use code that I don't understand on an important project.


texts: I need to add to QGIS more than 3000 rasters tif (with pyramids). It works very hard and slowly. So I ask: There's a solution that give's them quickly?.


texts: How do I convert MULTIPOLYS into LINESTRINGS in PostGIS

texts:
I have a table with a geom column as a geometry(MULTIPOLYGON)

I would like to create an additional column of type geometry(LINESTRING)

How can I do this using a PostGIS Query?

I need to be able to use the linestring in Geoserver to style labels along the line.


texts: Maintain maps current state on server round trip

texts:
Hopefully a fairly straightforward question...

I have my GeoExt map displayed in a window on my page using a  Ext.Window(...) object.  The page in the background that the map is displayed on needs to do a server round trip when a form on the page is submitted.  Is there a way for the window and map to maintain its state (ie, window size and position & maps current cooridnates, zoom level etc etc).

Thanks for reading!


texts: ST_ConcaveHull recomposes polygon without much regard to concavity?


texts:
I'm trying to create DEM based on TIN from points layer that I have.
this is how the layer looks like-

when I try to use the TIN interpolation tool I fill it like that and I use the layer extent-

as you can see, for some reason, the number of rows and columns doesn't change.
 if I keep it like that, I get '' invisible'' raster. if I change it, I  get rastes that doesn't really have the extent I want-

how can I change that? what am I missing?


texts:
I'm trying to show OSM file which I exported from openstreetmap api.

However, layer I add with OSM file is displaying like just polygons, I cannot show markers (street names, names of buildings etc.) in the map.

Here is the map I'm seeing.

And here is my openlayers init function.

        var lat=18.9003124; //changed due to company policies.
        var lon=30.7738127; //changed due to company policies.
        var zoom=15;
        var map;

        function init(){
            map = new OpenLayers.Map ("map", {
            controls:[
                new OpenLayers.Control.Navigation(),
                new OpenLayers.Control.PanZoomBar(),
                new OpenLayers.Control.LayerSwitcher(),
                new OpenLayers.Control.Attribution()],
                maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
                maxResolution: 156543.0399,
                numZoomLevels: 19,
                units: 'm',
                projection: new OpenLayers.Projection("EPSG:900913"),
                displayProjection: new OpenLayers.Projection("EPSG:4326")
            } );

            map.addLayer(new OpenLayers.Layer.OSM());
            map.layers[0].opacity = 0;

            var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));

            map.setCenter (lonLat, zoom);

            //Initialise the vector layer using OpenLayers.Format.OSM
            var layer = new OpenLayers.Layer.Vector("Polygon", {
                strategies: [new OpenLayers.Strategy.Fixed()],
                protocol: new OpenLayers.Protocol.HTTP({
                    url: "mymap.osm",   //<-- relative or absolute URL to your .osm file
                    format: new OpenLayers.Format.OSM()
                }),
                projection: new OpenLayers.Projection("EPSG:4326")
            });

            map.addLayer(layer);

What am I doing wrong?


texts: Clip multiple .las files data to polygon shapefile using FUSION

texts:
I followed this thread in order to clip .las data based off of a polygon shapefile.  However I have over 100 .las files I need to clip based off of this polygon and merged into a single .lasd file and I would like to clip them all at once.

The FUSION manual says on page 114 that you can substitute a list of file names instead of a single .las file in order to run the command on a batch of files.  I have created a text file list based off of the directory where the .las files are located but I get an error stating that no points fall within the polygon.  When I run the command against a single file I do get valid output.

Here is my command:

C:\fusion\polyclipdata C:\_projects\LiDAR\WVC_boundary\WVC_boundary.shp C:\_projects\LiDAR\WVC.las E:\2013_LiDAR_Final\LAS_Final\LAS_StatePlaneFeet\tiles2.txt

Here is an example of my text file containing a list of the file names:

 Volume in drive E is PW_GIS
 Volume Serial Number is 74B7-6DCC

 Directory of E:\2013_LiDAR_Final\LAS_Final\LAS_StatePlaneFeet

07/15/2015  01:46 PM    <DIR>          .
07/15/2015  01:46 PM    <DIR>          ..
08/12/2014  02:46 PM       126,366,636 12TVK0400078000_SPC.LAS
08/12/2014  02:48 PM       209,419,456 12TVK0400079000_SPC.LAS

etc...

Can someone help me create a proper list of file names to be able to run this command against a collection of .las files?


texts: Why is pgRouting shortest route function complaining about wrong source and target IDs?

texts:
This question is somewhat linked to underdark post, but I think here it would more helpful:
https://underdark.wordpress.com/2011/12/18/osm2po-part-2-pgrouting-on-osm-the-easy-way/#comment-2636

I installed everything to enable the pgrouting, after that I did the extraction from an OSM (modified by me in JOSM) file, to PostgreSQL using Osm2Po but after trying to route it through QuantumGis and the Routing Plugin I had the following issue:

“No se puede ejecutar la consulta.
El mensanje de error de la base de datos fue:
ERROR: Start vertex was not found.”

Thing is that after I checked I notice that in my “spatial” table I have:

7,347 Nodes which are never sources
6,966 Nodes which are never targets
6,369 Rows which are never sources nor targets (including above)
(Note: I have 19,191 nodes)

So I would like to know if you know any reasons why this could had happened or how I couId fix it.

Aside of that I tried routing using existing targets and sources ids, but then I got routes which were not from nor to the nodes I had used… which like dont know why could had happened, but I guess is linked to wrong OSM to PostgreSql Translation.

Finally I tried routing with Osm2Po in the Localhost site and it do worked, so I dont know if the data is ok but some configuration is wrong.

EDIT:

Problem is NOT the missing sources or targets node ( @Carsten ).
Problem is using wrongs Source Id and Target Id, using the the Street Segments Id instead of the Vertex Id (I could see that double-checking the web routing process of Osm2Po)

BUT the question still remains: How can I find the right source and targets, what Osm2Po called findClosestVertexId?


texts: Writing EXIF coordinates to images based on common field?

texts:
we did a photo survey with a GPS equipped camera (1800 images), then to improve accuracy we did a survey with a total station and renamed images with points labels.
Now I need to write the new coordinates into the images EXIF data (re-geocode images), using the image name as the matching field. The only method I found is based on time matching of a GPS track but this is not the case.


texts: Letting user choose from 2 options for QGIS Processing script input parameter?

texts:
I want to make a drop down box that shows 2 or 3 options and let the user choose 1 from them?

I would like to let the user to choose from "millimeter", "centimeter" and "meter". These Options are not from the field of input.

It seems like none of them here is valid:


texts:
I download a cartography bike from the open data data link to Postgres then I convert it to osm using:

 python ogr2osm.py "PG:dbname=x user=x host=localhost" --sql="SELECT * FROM bike_network" --output=/home/vdm/bike_network.osm

But when I tried to extract the osm file using osrm-extract I had an error:

My question is it's possible to use osrm with other maps or it just works with openStreetMap maps?


texts: GIS 3.12.2 Error after installing; Could not load qgis_app.ddl

texts:
After installing QGis, I got the following error:

Does anyone have a solution to get QGis working?


texts: PostGIS: Syntax for ST_Collect into a multipolygon keeping internal boundries

texts:
I have a PostGIS table with many polygons representing islands these all form a common group
How do I create a new MultiPolygon  (keeping internal boundaries) and give it a new name?
CREATE TABLE multypoly_test
(
    id SERIAL PRIMARY KEY,
    name character varying(30),
    geom geometry(geometry,4326)
);

INSERT INTO multypoly_test (name,geom)

SELECT 'MyName', ST_Collect( SELECT * FROM geo_table_wgs84 WHERE file_name = 'MyFileName' ) );

From the Examples - Array variant in the manual
Error:
ERROR:  syntax error at or near "SELECT"
LINE 3: SELECT 'MyName', ST_Collect( SELECT * FROM


texts: Select By location QGIS 3.12 Not Selecting all Features within

texts:
I'm using QGIS 3.12, trying to do a simple select by location between two polygon layers.

However, once complete it never brings back correct results (does not select all polygons within selected layer). It either selects too many, or not all polygons that fall within boundary (red line).

I have tried multiple different choices (intersect, contain, and both selected together)... never getting it to work.


texts:
I am having issues while converting my layer from 4326 to 3395. My Qtiles does not make tiles.

I have a source mapinfo in 4326 with long, lat pairs. My goal is to show this on a maps.yandex (3395 mercator) as a tiles layer. I can make tiles only from 4326.


texts: Writing the where clause in IQueryFilter

texts:
Building a desktop application using C#.net and arcobjects. I'm trying to retrieve records from a shape file using IQueryFilter. Having trouble writing the where clause in my scenario.

The scenario is as follows.

I want to only retrieve records that are invalid and fall out side the below condition . The category field in the sample data should be matched with the category field in the "condition" and check the Limits in the "condition" with either "Limit-From" or "Limit-To" field. Either one of the "Limit-From" or "Limit-To" fields should match the limit in the condition.  Also both the "Limit-From" and "Limit-To" fields can match the limits in the "Condition ".( when both match also that is not an error).

I have inserted a comments field for each record stating the reason for validity/invalidity. According to the sample data, as I want only invalid records, I want just record 6 and 7 as the output from the query.

Any help in writing the where clause in the query will be greatly appreciated. (I need only the invalid records. So in this case it should be just 6 and 7)


texts: Automating row selection and update of attributes in ArcPy?

texts:
I'm looking for a solution to automate a process I have found myself re-doing manually quite often. I have a dataset that consists of one column named "quarter" that is formatted "2018 Q1" (or Q3, or Q4, etc, going from 2016 to 2050) and several thousand rows. What I need to do is to select only the numeric part of that field and put it in a new field called "year." Once this is done, I need to split the layer into new shapefiles; one for every year.

I've tried ModelBuilder but I just don't understand the workflow and can't get it to work.

If anyone has python script that does something similar to this I can try changing it.


texts: ArcGIS: deleting features with attachments

texts:
I cannot find this information anywhere on ArcGIS official documentation, but if a feature that contains attachments is deleted, will the attachments be deleted as well? Or will they be left orphaned?
Or simply put, when I call REST API to delete a feature and I don't want orphaned attachments occupying server space, do I need to delete the attachments first before deleting the feature itself?


texts:
A recent convert to QGIS, I have versions 2.8.5 and 2.12.2 installed on my PC.  The plugin Manager tells me I have v2,10.3 of the Processing plugin installed in the plugin folder of my local drive and v 2.12.2 is available in the official repository.  When I try to upgrade I get the following error:

Plugin installation failed: failed to unzip the plugin package. Probably it's broken or missing ftom the repository.  You may also want to make sure that you have write permission to the plugin directory: C:/Users..../.qgis/python/plugins

I have been able to successfully install other plugins and have manually tried copying the processing folder from a colleagues successful update into the plugin folder but the error persists.

Any idea what I'm doing wrong?


texts: gdallocationinfo behaviour from windows to linux

texts:
I used NETCDF for many years on windows (using GDAL ) now recently i
tried on Linux for netcdf data value.I  used gdallocationinfo on windows for retrieving
atmospheric parameter value from netcdf file. same i tried on Linux
but i am getting a fill value -999 for some files.GDAL 1.11 is used in both the
systems.On windows proper value is resulted for both the example files mentioned below from the file.Though same syntax is used on LINUX for one file (aerosol optical depth) it is working and for the other different result is observed.
gdallocationinfo -geoloc -valonly NETCDF:g4.timeAvgMap.MOD08_D3_6_1_Water_Vapor_Near_Infrared_Clear_Mean.20190514-20190514.180W_90S_180E_90N.nc:MOD08_D3_6_1_Water_Vapor_Near_Infrared_Clear_Mean 75.2 35.2
is resulting different
way.But i got a proper result (on linux) for aerosol optical depth variable

gdallocationinfo -geoloc -valonly NETCDF:g4.timeAvgMap.MOD08_D3_6_1_Aerosol_Optical_Depth_Land_Ocean_Mean.20190514-20190514.180W_90S_180E_90N:MOD08_D3_6_1_Aerosol_Optical_Depth_Land_Ocean_Mean 75.2 35.2

if variable name is wrong then it should give message, but output is coming as the constant value of -9999.


texts:
I have a layer with some points and I want to publish it using qgis2web. I have seen some exampes where the legend can be filtered such as in this webmap: https://ukerc.rl.ac.uk/TOOLS/EnergyDemonstrators/map.html#5/55.674/-2.490

What setting was used to make this filtered legend? The closest I can make is this where I can only filter the layers themselves.:


texts: Converting 10.5 mxd to 10.4 without ArcMap 10.5?

texts:
Is there any way to convert a 10.5 mxd to 10.4 without having 10.5 on the system?

I know ArcCatalog 10.4 - Data Sources allows me to see the datasets in the 10.5 mxd but then I don't have access to the layout/symbology etc.

All the processes I can find require 10.5 to be installed to use arcpy or save-as in arcmap.


texts: Perfect circle in ArcGIS, why I get a multiside polygone (plurigone)?

texts:
Using ArcGIS basic (10.3), I tried to make perfect circles in ArcGIS with the buffer tool. As you can see on the two print screens, the circle is not perfect when I use a radius of 7,5 meters in a MTM projection project. The circle is composed of small lines (see arrows in the 2nd image).
If I calculate a surface area of that circle, I get 175.81878 m² (area normal) and 175.846927 m² (geodesic area).
At least, I should get 176.71458676 m² using 7.5 m x 7.5 m x ∏ formula (∏xR²)
Why I get that? How can I have perfect circle with a radius of 176.71458676 m²?


texts: Why doesn't fTools Line to Polygon work?

texts:
I am working new with QGIS (Version 2.8.2 / Window 8.2) and try to make Polygon from Line (see example picture 1) with the fTool LineToPolygon, but it doesn't work (see picture 2).

I work with complex geological maps and should make PLG from Line like in ArcGIS.


texts: Sequential cloud mask closest to date in Google Earth Engine

texts:
I'm interested in transitions that occur on a date, such as bushfires. I want to get the closest (in time) cloud-free landsat image possible using as many images as necessary in the collection up until that date. It's easy to make a cloud-free collection of images using the map function but then I want the masked pixels of the image closest to the date to the filled (where possible) with the previous image and if that is also masked, the next previous etc.
I thought of using imagecollection.qualityMosaic with a layer of the deltadays from the final date to control mosaicing process but I cannot manipulate the image date in the imageCollection.map function as it is external. There also may be a much simpler way to do this. I'm new to Python and GEE (but not programming) which is certainly not helping. Any ideas?


texts: Parallel rasterizing with GetCover option?

texts:
I'm trying to rasterize a shapefile in parallel using the solution from this post: Processing vector to raster faster with R

However, this fails to give the correct answer when the GetCover = T in the rasterize`function.

Has anyone successfully rasterized in parallel with the GetCover option enabled?


texts:
I´m trying to use the complete descending dataset (VV and VH) for a location in Colombia and must got the same number of scenes by band but it does not; in fact, there are 3 missing years of data for the VH and not equal amount of data for the available years.
Something similar happens with the Ascending dataset. How can I get the complete dataset for both or at least one passing?


texts: Importing ALOHA plume .pas file in ArcGIS Server web API application

texts:
I want to import a .pas file (ALOHA plume file) in ArcGIS Server web API application (JavaScript/Silverlight/Flex). Has anyone tried this before?

I am looking for some directions to archive the same.


texts: Antipodal distance (or polygon fetch or polygon diameter) for concave polygons

texts:
I am working on some class examples in Python implemented within ArcMap to calculate the antipodal distance within a polygon.  This is fairly routine for convex polygons, however, for concave polygons, I wish to exclude solutions (formed by a ray connecting the boundary points), that aren't completely within the polygon and not on the polygon boundary or intersecting it.  Have I interpreted the definition wrong or is this beast go by another name.

Consider these two polygons

pnts = [ [0,0], [0,1], [1,4],[3,5],[5,4],[4,1],[0,0] ]  # a closed-loop convex

pnts = [ [0,0], [2,1], [1,4],[3,5],[5,4],[4,1],[0,0] ]  # a closed-loop concave polygon

In my interpretation, point 0,0 should not have an antipodal distance associated with it since the vector connecting it with the other points is either self intersecting the polygon or is on the polygon boundary.

If anyone has any clarification on the definition or potential solutions, I would appreciate it.

A visual of the convex polygon and the desired lines (shown in red) is enclosed (example vectors from point 0 are only shown).

In the convex example, the first point has no antipodal vectors, however, the second point does.

EDIT
I have had some success searching using "polygon fetch" or "polygon diameter" on the web, I suspect that this is what I am after.


texts: I am looking for an HTTP API to query for available StreetView Panoramas in a given location / bounding box. Couldn't find anything in Google documentation directly. Does this exist?


texts: PyQGIS reference to QGIS plugin UI in Travis unittest

texts:
I want to get unittesting under Travis to work with qgis2web. It works up to a point, but Python access within the plugin to the plugin's own UI seems not to be working. The unittest I am working on is here:

https://github.com/tomchadwin/qgis2web/blob/master/test/test_qgis2web_dialog.py#L86

An instance of the problem seems to be in populate_layers_and_groups():

https://github.com/tomchadwin/qgis2web/blob/master/maindialog.py#L133

The UI item layers_item is created here:

https://github.com/tomchadwin/qgis2web/blob/master/maindialog.py#L141

However, after this function should have added layers as children to this item, childCount() gives 0 in Travis:

https://github.com/tomchadwin/qgis2web/blob/master/maindialog.py#L175

Running the plugin in QGIS on my client gives the correct value for this childCount().

So, am I failing to pass a reference to, or inject, the plugin UI in the context of the unittest? If so, how do I fix it? If not, what is the issue?


texts: How to echo gdal process to screen and pipe to text file in Windows?

texts:
gdal_warp and similar give a nice progress summary when run and I want this output to show in the osgeo shell and also pipe to a text file. The issue is when I add the pipe the output doesn't show on the screen. How can I do both?

gdal_translate -expand rgba -of GTiff -a_srs EPSG:3857 -co TILED=YES -co BIGTIFF=YES %1 %2\%3\%3_translated.tif > %2\%3\%3_translate_log.txt

puts the output to a text file but then doesn't show the progress on screen.

I tried

Echo gdal_translate -expand rgba -of GTiff -a_srs EPSG:3857 -co TILED=YES -co BIGTIFF=YES %1 %2\%3\%3_translated.tif > %2\%3\%3_translate_log.txt

and

Echo.gdal_translate -expand rgba -of GTiff -a_srs EPSG:3857 -co TILED=YES -co BIGTIFF=YES %1 %2\%3\%3_translated.tif > %2\%3\%3_translate_log.txt

but neither works.


texts: Calculate distance between 2 points following a path in QGIS

texts:
I'm currently working on bird's data. I have coordinates of observation points and I'd like to measure the distance between points following a path. The given bird is probably moving from point to point therefore euclidean distance between 2 points is probably far from real distances.

Let's imagine I have 3 sites : A,B and C. B is between A and C: For going from A to C, the bird walk A → B → C so the distance AC is given by the sum of distances AB + BC.

I'm looking for the mean of getting quickly all possible distances: AB, BC and AC. I'm used to QGIS.

Of course, I could simply do the sum of euclidean distances myself but I have 15 points so it would be so long to get the distances for all points' couple.

Do you have an idea of how to do it automatically ?


texts: Qfield layers are not where they should be. CRS problem?

texts: I have created a basic QGIS project with a basemap and a point layer saved with CRS OSGB 1936/British national grid.  When uploaded to Qfield, my actual location and the layers I have uploaded don't match.  I presume this is a beginners CRS problem?


texts: I can't import qgis.core in a Python script and I don't know how to change the environment

texts:
I am trying to start using Python with QGIS but I cannot get Python to work right. When I try import qgis.code in the python shell, I get this:

Traceback (most recent call last):
File "<pyshell#0>", line 1, in
import qgis.core
ModuleNotFoundError: No module named 'qgis'

Then I go into Terminal and try this:
export PYTHONPATH=/Applications/QGIS.app/Contents/Resources/python
But my error message stays the same. Interestingly, if I try running python from Terminal and try to import qgis again, I get a different error code:

Traceback (most recent call last):
File "", line 1, in
File "/Applications/QGIS.app/Contents/Resources/python/qgis/core/__init__.py", line 25, in
from qgis._core import *
ImportError: dlopen(/Applications/QGIS.app/Contents/Resources/python/qgis/_core.so, 2): Library not loaded: @rpath/qgis_core.framework/Versions/3.18/qgis_core
Referenced from: /Applications/QGIS.app/Contents/Resources/python/qgis/_core.so
Reason: image not found

I have two versions of Python on my computer (Mac) which has caused so many problems for me; could that be the problem? How do I fix this? I tried following this: QGIS - ModuleNotFoundError but I don't know where to go from there. I am a programming noob so I don't even know what to fix there.


texts: How to specify boundary coordinates for raster layer in QGIS

texts: I am using QGIS for loading my raster image as raster layer. I want to combine it with my vector layer, which is GEOJSON file. When I load GEOJSON file, it's placed on its coordinates, but the raster picture is placed to coordinates 0,0. Is there a way, how to move the raster "under" my vector layer - I mean how to move it and scale it? Or better - I know its corners coordinates - can I anyhow assign these coordinates to the raster layer, so it's correctly displayed on its position?


texts: How to catch the event the mousePressEvent on Esri :: ArcGISRuntime :: Graphic?

texts:
All events mouse protected. I tried to do it via eventFilter and using QObject :: connect, but the result false. How do I catch a click event on Graphic?
What I tried:

...
    void ViewshedGeoElement::graphic3dMouseClicked()
    {
        qDebug()<<"m_graphic3d";
    }

    bool ViewshedGeoElement::eventFilter(QObject *obj, QEvent *event)
    {
        qDebug()<<obj<<event;
        if (event->type() == QEvent::MouseButtonPress)
        {
            graphic3dMouseClicked();
            return true;
        }
        return false;
    }
...

Esri::ArcGISRuntime::Graphic* m_graphic3d = nullptr;
m_model3d = new ModelSceneSymbol(QUrl(dataPath + PathModel), 1.0f, this);
m_model3d->setAnchorPosition(SceneSymbolAnchorPosition::Bottom);
m_model3d->setHeading(180.0f);
m_graphic3d = new Graphic(dp.m_pos, m_model3d, this);

m_graphic3d->attributes()->insertAttribute(HEADING, dp.m_heading);
m_graphic3d->attributes()->insertAttribute(PITCH, dp.m_pitch);
m_graphic3d->attributes()->insertAttribute(ROLL, dp.m_roll);

m_sceneView->graphicsOverlays()->at(0)->graphics()->installEventFilter(m_graphic3d);

...

the second way doesn't work either:

...
void ViewshedGeoElement::graphic3dMouseClicked()
{
    qDebug()<<"m_graphic3d";
}
...
QObject::connect(m_graphic3d,SIGNAL(mousePressEvent()),this,SLOT(graphic3dMouseClicked()));


texts: PostGIS Geography data type not displaying in QGIS

texts:
I am trying to display data held in the PostGIS Geography type on a map in QGIS.  Whatever I do I can't get it to work.

Here is the SQL that creates my data - a single point in London.

CREATE TABLE test_srid.world_points
(
  id serial NOT NULL,
  name character varying(150),
  geog_point geography(Point,4326),
  CONSTRAINT world_points_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE test_srid.world_points
  OWNER TO postgres;

CREATE INDEX idx_world_points_geog_point
  ON test_srid.world_points
  USING gist
  (geog_point);

INSERT INTO test_srid.world_points (name, geog_point) VALUES ('my_address', ST_GeogFromText('SRID=4326;POINT(0.1275 51.5072)') );

QGIS recognises this as a layer, but does not display any data:

I've spent a while looking through the documentation and can't find what I'm doing wrong.  I'd be very grateful for any help.  I have found this which seems to suggest that the geography type is supported.

Finally I've checked that the data in PostGIS is working correctly:  I've created two points using code similar to the above, and run the following query:

SELECT ST_Distance(a.geog_point,b.geog_point)

from test_srid.world_points as a,
 test_srid.world_points as b

where a.id = 1 and b.id=2

The result came back as expected (I double checked against google maps).

Is there a setting I need to change to get this to work?  I was initially working with QGIS Brighton, but upgraded to Wien to check it wasn't anything to do with my QGIS version.

Data in geometry datatypes displays with no issue.


texts: Load PostGIS layer/table to QGIS canvas using Python

texts:
I want to load a PostGIS layer to QGIS canvas. I am using the following code but it is not loading the layer in canvas.

sql = "(SELECT * FROM table WHERE id = 20)"
uri = QgsDataSourceURI()
uri.setConnection("host", "5432", "databasename", "user", "password")
uri.setDataSource("public","table", "the_geom", sql,"gid")
print uri.uri()
vlayer = QgsVectorLayer(uri.uri(), "test", "postgres")
QgsMapLayerRegistry.instance().addMapLayer(vlayer)
canvas.refresh()

But the layer is not loaded. I don't know what I am doing wrong here.


texts: How to separate journeys from GPS traces using ArcGIS/ QGIS?

texts: I am facing a GPS Data Preprocessing problem. I have GPS traces of buses which traveled from one place (bus station) to another. This file contains relevant (eg:- Data recorded between the starting bus station and ends with the destination stop) and irrelevant GPS traces (eg- traces recorded from bus station to the home of the bus driver). All the data of the month is in the same file. Looking for a efficient preprocessing technique to separate journeys from the file. The data fields in the files are "timestamp", "lat","lon". Can somebody suggest any techniques for this preprocessing step?


texts: fTools "Join Attributes by Location" missing in SEXTANTE/Processing Toolbox

texts:
I am working with the new Processing Framework in QGIS 2.0.1.
I really like the graphical modeler, because it allows my to make my own tools without having to be able to write pyhton or any other programming language.
But it seems like some of the fTools (the Vector-Tools in QGIS) are missing?
For example "Join Attributes by Location".
Is this an error, or is there a reason for that tool being missing in SEXTANTE?
To make things a bit more clear, I attached 2 Screenshots to show which tool I mean.
Here you see all the tools avaliable in the Processing Framework

Here you see the tool I am looking for..

So is there any way to get the Tool in the Framework?
If not, has anyone an idea how to get a similar result with another tool?

(Futher information on the task i want to accomplish:
I've got a .shp with landlot, and a .shp with 3 polygons, and I want to have a field in the attribute table of the landlots which shows which of the polygons is covering which landlot.)

Thanks in adavance!

Gunnar


texts: Joining attributes by location using QGIS

texts:
I have a dataset of around 15000 events (protests) with latitude+longitude coordinates, and I would like to know in which US congressional district each event occurred. I've found a shapefile of US congressional districts, and would like to use it to identify the congr. district for each individual point.
I understand I can use the "Join attributes to location" function in QGIS to do this, but I don't understand how to use it.
Do both files (my dataset file with the events and the congr. district file) need to be shapefiles (.shp)?
Is using this basically going to add another column to my dataset file with info about which district each point is located in?
Never used QGIS or any other geographic program before, so please be specific if possible.
The dataset can be found here: https://acleddata.com/download/22846/
District shapefiles here: http://cdmaps.polisci.ucla.edu/shp/districts114.zip


texts: Is it possible to use SELECT DISTINCT in a GeoServer CQL_FILTER statement?

texts:
I'm running a query on a GeoServer WFS layer, using a CQL_FILTER. This results in duplicates, whereas I only want to see one instance of each matching result.

The query I'm running is:

&CQL_FILTER=name=%27BLAH%27&propertyName=repairer_name

which returns multiple instances of "CITY MOTORS":

Is it possible to use a SELECT DISTINCT statement in the CQL_FILTER, so that only one instance of "CITY MOTORS" is returned?

For example, in PGAdmin this query returns the results I need:

I can't see anything in the Filter Function Reference or ECQL Reference pages showing the syntax for using SELECT DISTINCT, and the only other question seems unrelated.


texts:
I'm trying to apply a color ramp on a categorized render in QGIS 3.4 (via the Python console).

I started by adapting the solution for a catagorized symbol layer - to QGIS 3.4 but this applies a random color scheme. Since then i searched for how to apply a color ramp, which i have started to adapt from an earlier solution for applying a color ramp.

So far I've got his:

# Get the active layer (must be a vector layer)
layer = QgsProject.instance().mapLayersByName("t_zpbo")[0]

# provide file name index and field's unique values
field = layer.fields().lookupField('zp_capamax')
unique_values = layer.uniqueValues(field)

## get default style
myStyle = QgsStyle().defaultStyle()

## get a list of default color ramps [u'Blues', u'BrBG', u'BuGn'....]
defaultColorRampNames = myStyle.colorRampNames()

## setting ramp to Reds, sixth index of defaultColorRampNames
ramp = myStyle.colorRamp(defaultColorRampNames[9])

# set up an empty categorized renderer and assign the color ramp
renderer = QgsCategorizedSymbolRenderer('zp_capamax', [])
renderer.setSourceColorRamp(ramp)
layer.setRenderer(renderer)

Unfortunately this returns the follwoing error:

  TypeError: QgsCategorizedSymbolRenderer(attrName: str = '',
  categories: Iterable[QgsRendererCategory] = []): argument 1 has
  unexpected type 'int'

Which leaves me a little confused... as far as I can tell it doesn't seem to like the fact the values in my field are integers...

EDIT: I modified the original code i posted above to take into account the comments of Ben W (see below) - the code above doesnt return any error codes - but it doesn't seem to creates classes. When I look at the layer properties after I run the script I can see the styling is catagorized, and the right field is selected, and a color ramp is selected - but no classes appear.


texts: Merging line layer symbology where streets intersect using QGIS

texts:
I am working on a thematic map in QGIS 3.4 where I created a shp layer for lines to draw streets on top of a background map. The problem is individually drawn streets that intersect.

Is there a way to join or merge the streets that intersect?

Now they are just on top of each other, and it looks ok if using a simple fill color. I'd probably like to use the existing symbology for roads with black outline, so in this way the streets look awful and clumsy. I found a plugin for 'merge lines' but couldn't get this working.


texts: Getting rid of elevation difference between flat plane and designed DEM output

texts:
Does anyone know how to hide/ eliminate the height/elevation between the flat plane and the top of the DEM model (denoted with the red markup)?
I am thinking of either

just not showing the flat white plane, or
lower down the DEM z-value

But I am not sure how to realize any of them exactly.
Does anyone have any idea how to get around this issue?

Same sort of idea also to lower down the existing DEM so that it won't emerge/ swell up beyond the Proposed DEM model.
Please see the example below:
The Yellow-green part is the existing DEM and I want to let it go right under the proposed (gray) DEM but not way to low like the flat plane.


texts:
I want to change vector attributes values.

i could not get the command fet.setAttribute
indeed, it is mentionned in http://hub.qgis.org/issues/7223 that:

  "The QgsFeature instance now must be first initialized with initAttributes() to know how many attributes it will contain. Then there's setFields() call that allows doing name-to-index mapping in QgsFeature."

however, i could not get fet.initAttributes() and fet.setFields() working. (newbie...)

the error message I get is "AttributeError: 'QgsFeature' object has no attribute 'initAttributes'".

any help appreciated.

qgis version: 1.8.0

gis-python version: 1.8.0-8

python: 2.7.3-7.2

os: fedora17


texts: Get information of all open QGIS projects

texts:
I have build a QGIS Plugin which uses a layer with vector tiles (with an attribute location created with gdaltindex) as input to create raster files (slope, hillshades, ...) derived from a DEM for a distinct area. When I choose tiles from another area of interest I remove all raster files first. Logically I can't do this when another QGIS project is open which includes on of these raster layers. In my case I have two projects: an "online" (including network drives) and an "offline" project. With the plugin you have the possibility to update one project with the new created raster layer of the other project via a .qlr file.

So when I want to remove the raster files, there is the error: WindowsError: [Error 32] The process cannot access the file because it is being used by another process: (file-name)

I have solved this using:

try:
    filelist = glob.glob(os.path.join(raster_dest_data, "*.*"))
    for f in filelist:
        os.remove(f)
except:
    QMessageBox.warning(iface.mainWindow(),'Information', u'Quit all other QGIS projects')
    return False

Is this the best way to do this?

Is there the possibility to get information about other open QGIS projects with pyqgis?

I was thinking about a message: There are 2 more QGIS projects open. Please quit QGIS "Project_1" and QGIS "Project_2" first to proceed!


texts: Bold and Italic layer labels with Python in QGIS

texts:
I'm trying to apply some labeling properties to a layer using Python. Everything went fine, except the way I tried to apply the Bold and Italic settings. Here is a part of the code:

  layer.setCustomProperty("labeling/fieldName", field.name())
  layer.setCustomProperty("labeling", "pal")
  layer.setCustomProperty("labeling/enabled", "True")
  layer.setCustomProperty("labeling/fontFamily", "Arial Narrow")

  if self.dlg.pt6.isChecked():
    layer.setCustomProperty("labeling/fontSize", "6")
  if self.dlg.pt8.isChecked():
    layer.setCustomProperty("labeling/fontSize", "8")
  if self.dlg.pt10.isChecked():
    layer.setCustomProperty("labeling/fontSize", "10")

  if self.dlg.chkbold.isChecked():
    layer.setCustomProperty("labeling/weight", "Bold")
    layer.setCustomProperty("labeling/fontWeight", "75")
    layer.setCustomProperty("labeling/Weight", "Bold")

  if self.dlg.chkitalic.isChecked():
    layer.setCustomProperty("labeling/fontItalic", "True")


texts: Suggestions for open source command line resample algorithm that ignores nodata?

texts:
I am trying to automate the downsampling of elevation (and other) data using open source software at command line in an automated workflow via use of windows batch files. Currently the workflow uses only gdal utilities via osgeo4w.

I am looking for a command line resample method that will ignore the nodata that is present in the input tiff file during calculations. I need this so that output provides data values at dataset edges. Majority/mode and mean downsample options are preferred, rather than a simple nearest neighbour. Something similar to the arcgis block majority and aggregate tools would be nice.


texts: How to work on map created by using arcgisUtils.createMap

texts:
arcgisUtils.createMap(id,"map").then(function(response){
          //update the app
          dom.byId("title").innerHTML = response.itemInfo.item.title;
          dom.byId("subtitle").innerHTML = response.itemInfo.item.snippet;

          map = response.map;

        });


texts: Spatial Join Geospatial data returning empty data frame

texts:
I am trying to spatial join two GeoDataFrames.

This is how the dataframes look like:

I wanted to find the points within each region, but I got back an empty data frame.

east_region = gdf[gdf['REGION_N']=='EAST REGION']

north_region = gdf[gdf['REGION_N']=='NORTH REGION']

central_region = gdf[gdf['REGION_N']=='CENTRAL REGION']

west_region = gdf[gdf['REGION_N']=='WEST REGION']

northeast_region = gdf[gdf['REGION_N']=='NORTH-EAST REGION']

gpd.sjoin(data_geo, east_region, op='within')

The CRS is the same 4326 for both GeoDataFrames and when I plotted on the maps, it is clear that there are points within the north region etc.

I coded these in Google Colab.


texts: Is there a way to do a visual spatial dissolve of polylines that do not touch each other?

texts: I do not have the common attributes to do a regular dissolve. However I can see which lines are separate from another. Either QGIS or ArcGIS is fine.


texts: How extract TileMatrixSet from GeoServer in order to pass it to create WMTSTileService?

texts:
I am trying to mock GetMap requests and had an issue on how to create valid BBox values for the requests so they would HIT the cached layer. I got an answer from Ian Turton How properly calculate BBox for mocked GetMap request? on how to calculate valid BBox but I. However I need to automate this process and parsing WMTS capabilities document is not what I would like to do. Ian's suggested usage of WMTS instead of WMS has a drawback - I need to know rows and columns for each zoom level I want to hit and I want to hit specific area only. I see no easy way to automate correct zoom level/column/row combination selection.
  What I think is the best way to generate correct BBox parameters for GetMap requests is to call org.geotools.data.wmts.client.WMTSTileFactory.findTileAtCoordinate(...) with the random coordinates I can easily generate. Later I would get ReferencedEnvelope from the Tile and would ask for the lower and upper corner coords and that would be it but... findTileAtCoordinate(...) needs parameter of type org.geotools.tile.TileService and in order to create WMTSTileService object I need to pass a bunch of parameters among which is org.geotools.data.wmts.model.TileMatrixSet. Now I don't want to manually parse WMTS capabilities document to create TileMatrixSet object. I would expect there should be a way to create service which needs only GeoServer address and a layer name so it could fetch all the data about layer (BoundingBox, EPSGCode, TileMatrixSet and so on) so I could pass them to WMTSTileFactory.findTileAtCoordinate(...). Is there a such service? Maybe I am doing wrong approach?


texts: Join adjacent polygons of an SPDF using gTouches?

texts:
I'm trying to join adjacent polygons in a SpatialPointsDataFrame without merging the whole SPDF into one.
The SPDF is a glacier shapefile with some of the glaciers separated into different polygons. I want to merge these adjacent polygons.

I tried mergeand aggregate, but this merges every polygon together and results in a SpatialPolygon-object and the @data slot is lost.

Is it possible to merge just the adjacent polygons using for example the IDs of adjacent polygons (as given by gTouches) and keeping the whole thing as a SPDF with the @data slot?`

EDIT:
I've converted my data to an sf-object as proposed by Bernd and managed to merge the polygons.

My next question would be:
How to delete parts of a multipolygon inside an sf-object in R?


texts: ArcPy .csv to Shapefile Conversion Errors

texts:
I have scripted a series 10 files that are run daily in order to generate an interpolation of data. However, I periodically have encountered errors where not all of the .csv data is being translated into the .shp file. I have already verified that the data within the .csv file is correct by verifying it against the others I introduce into ArcPy by plotting the data in ArcMap using "Display XY Data".

The script is designed to be dynamic in the sense that all shapefiles are created and saved into a unique YMD folder. The script used to generate .shp files is as follows:

import arcpy
import sys
from arcpy import env
from datetime import datetime, timedelta

date0 = datetime.strftime(datetime.now(), '%Y%m%d')

# Set environment settings
env.workspace = r"C:/somepath/data/"+date0+"/"
#Overwrite Old Files (0=No, 1=Yes)
arcpy.env.overwriteOutput = 1

try:
    # Set the local variables
    in_Table = "C:/somepath/data/"+date0+"/"+date0+"00_d0_tempfile.csv"
    x_coords = "lon"
    y_coords = "lat"
    z_coords = "maxt"
    out_Layer = "d0points_layer"
    saved_Layer = "d0points.lyr"

    # Set the spatial reference
    spRef = arcpy.SpatialReference("WGS 1984")

    # Make the XY event layer
    arcpy.MakeXYEventLayer_management(in_Table, x_coords, y_coords, out_Layer, spRef, z_coords)

    # Save to a layer file
    arcpy.SaveToLayerFile_management(out_Layer, saved_Layer)

    #===============================================================================
    # Copy features to shapefile

    arcpy.CopyFeatures_management("C:/somepath/data/"+date0+"/d0points.lyr", "C:/somepath/data/"+date0+"/d0points.shp")
    #===============================================================================

except:
    print arcpy.GetMessages()

print 'd0 Data Conversion Complete'

sys.exit()

A key question as I sort this out is would it be beneficial to convert the .csv to a .gdb, then proceed with the conversion to .shp?


texts:
I recently asked a question about trying to calculate the slope over distance (manually) using QGIS, but then I came up with another way of solving the problem, but I would have to get some help for that as well (Sorry, new to open source GIS).

Can I calculate the value difference between adjacent cells, and if the condition is met (e.g. Cell A-Cell B => 1) the cell is given a value of 1, and if false, a value of 0? Or just a color map with intervals of values? This calculation would have to be repeated until every cell is compared with its connecting cells.
Does this make any sense? I have latest QGIS with GRASS and gdal, and I also use SAGA.
Thanks
Fredrik


texts: Return County name from address using PostGIS?

texts:
I'm using PostGIS to geocode address data like this:

SELECT pprint_addy(addy), ST_AsText(geomout) FROM geocode('Chicago, IL');

I've loaded all the TIGER data for each US state from the US census following this tutorial.

Everything works as expected and I can retrieve co-ordinates from parial text addresses.

What I'm wondering is: Is there a way to use a partial address to return a county instead of co-ordinates?

Ideally, I'd submit Chicago, IL as my input and return Cook

As you can tell, I'm a beginner.  Is there a tutorial that covers this?

Version Information:

PostgreSQL 11.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit


texts: Data Driven multiple photos from point layer

texts:
In Arcmap 10.5, I am trying to use data driven pages to display multiple pictures in a photo point layer based on an overlaying polygon index.
I would like to use the yellow polygon layer as the index, shifting between each field. And would like to display the attached pictures from the photo point layer that the index is currently showing.

The first image is 2 fields with a few photo points shown. Using data driven pages, I have selected the polygon layer as my index.

Image 1 – Photo points layer in pink, polygon index layer in yellow.

I would like to export a map book of each field with the corresponding photos. I have tried to use the photo points as the index but then end up with 3 maps per field.

Image 2 – Field 1 with 3 photos displayed

Image 3 – Field 2 with 3 photos displayed

I have tried spatial joining the layers, but it does not join the attachments or the paths, so I cant display the pictures. I have also tried to set up 2 data frames but using the polygon index does not shift the photo indexes.

Any ideas?


texts:
Are there any software packages/solutions that allow me to simulate the movement of sun or direction of sunlight over a period of time (e.g. 24 hours)?

My purpose is to determine the regions cast in shadow for different times of day, when used in combination with a DEM.


texts: PGR_CreateTopology maintain Source and Target ID's

texts:
Is there a way to set the 'source' and 'target' manually and not have it overridden in PGR_CreateTopology()?

I have a predefined node ID's (INODE, JNODE) in my table which is the same to a other tables in my database that I want to maintain for simplicity and consistency. This is happening:

GID  | INODE  | JNODE  | SOURCE  | TARGET
---- | ------ | ------ | ------- | ------
1    | 25     | 6      | 1       | 2

and I want this:

GID | INODE | JNODE | SOURCE | TARGET
--- | ----- | ----- | -----  | ------
1   | 25    | 6     | 25     | 6


texts: Collapsing parallel lines into a single line QGIS

texts:
I have a shapefile of the Washington metro area, but along much of the route multiple lines run parallel to each other (see picture 1) and I need to collapse them into a single line.

I've tried creating a buffer and dissolving the result, which visually achieves what I'm looking for but ultimately I need a single shapefile line representing the center line that I can then run the qchainage process on but so far haven't been able to achieve that.

Does anyone have a way to achieve this in QGIS?

I believe I'm essentially trying to replicate the 'Collapse Dual Lines To Centerline' functionality in ArcGIS.

Input shapefile:

Dissolve Buffer result:


texts:
I have problem with gxp print plugin.
I create new sdk project suite-sdk create ~/sdk. Next I do everything from Problems with gxp Print plugin via opengeosuite sdk but there is another problem.
But I don't know where. After I click on the print button in print preview modal nothing happens.
Here is a screen shot from firebug JPG

Anyone know how to fix that?


texts: Styling rendered mbtiles in offline web-map service

texts:
I am building a digital cartography tool that needs to run completely offline. As a basis, I downloaded a .mbtiles-file corresponding to the area I want to survey and I am running the excellent tileserver-php on a Raspberry Pi.

I couldn't make it work with the .mbtiles-file, so using mb-util I unpacked the contents of the .mbtiles-file to a folder structure. So far everything seems to be working fine and I get the map served on the browser, however, the resulting rendered tiles look like some kind of wireframe model of a map.

Not sure now how to get it to render in a nicer, more readable style. I am using OpenLayers in the index.html-file of my server, and I thought that's the API that took care of the actual rendering. Ideally, I would like to be able to see the streets, street names and what you would generally come to expect from a web map. What am I missing?


texts: vb.net arcobjects determine whether arcmap is in editing session

texts:
I have a vb.net arcmap addin which provide a function to validate geodb topology. But there is a problem, when I am not in editing session and use the function, arcmap will crash. In this case I intend to check whether the map is in editing session.

Is there a way to check whether arcmap is in editing session?

I am using vb.net and arcmap 10.2.


texts: Prevent user from creating self intersected polygons

texts: i'm working on a project in QGIS 3.4.1 Madeira. I want to prevent users from creating polygons with errors (like self intersection). When I digitize a polygon in QGIS i get a mark where the polygon self-intersects (see image), but I can continue and save my polygon without any further warning. Is there an option to prevent that and not ignore the topological error so that the user can redo his digitalization (e.g. pop up)?


texts: Finding the centroid of a merged polygon using shapely function

texts:
I have a polygon shapefile and I want to find the centroid of the polygon, and output the centroid as a new shapefile before I geocode. How I should do this with Python functions shapely and Fiona and not ArcPy or ArcMap?

with fiona.open(DESTINATION_FILE) as input:
    input.schema['geometry'] = "Point"
    with fiona.open('.cache\centroid.shp', 'w', 'ESRI Shapefile', input.schema.copy(), input.crs) as output:
        for elem in input:
            if elem['id'] == '0':
                geom = shape(elem['geometry'])
                elem['geometry'] = mapping(geom.centroid)
                output.write(elem)

With this code I don't get the x, y coordinate of the centroid, so what should I do to get that, because after getting the x,y coord I will still geocode it.


texts:
I have data that is XY coordinates (both origin and destination) in the CSV file. (example below, the last two-column is destination point)

Then, I want to count the number of points that start from polygon 1 (origin polygon) to polygon 2 (destination polygon) which is an administrative boundary.
I'm using ArcMap.
I would like to create a table like this below (just for example).


texts:
I have write the following code for displaying coordinates of a map.But coordinates are not displayed and getting error i.e "Uncaught TypeError: webMercatorUtils.webMercatorToGeographic is not a function". Please help me how to solve this issue.

<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
    <title>Simple Map</title>
    <link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">


texts: Changing orientation of all text labels at once?

texts: I rotated my extent -45 degree to make it look better. Problem is all the labels that I converted to graphics so I could rearrange them are also at -45 degrees. Any way to change that easily?


texts: How to configure web map data layer that can accept csv data uploaded by user?

texts:
I made this map: http://tinyurl.com/a368268 on arcgis online. How do I get the same map but instead you can upload a new csv every time? Instead of having to first add it as data layer on arcgis online and then configure pop ups after doing that. I basically want what I made but be able to upload a new csv with new data but in the same format. The fields I'm using currently are:

ImageName,Latitude,Longitude,PicURL


texts: Is there any automated process to download POI from Wikimapia?

texts: Is there any automated process to download point of intrest from Wikimapia. I want to download some features such as Schools


texts: Authorizing a user logged in via ArcGIS Online/Javascript in a Python server

texts:
So, let's say I have this application built via WebAppBuilder, the user is already logged in via a ArcgisOnline organization, but I have a separate python server that does some custom geoprocessing and need to be authorized.

Questions :

1) How do I retrieved an already logged in user information? I won't have access to his password but probably can get a token or something (Javascript API 3.X Preferably).

2) How do I authorize the information retrieved above in a python script?

Pseudo example (Python server code):

def authenticate(request):
  token = request.token #Or whatever other information is necessary
  valid = arcpy.isAuthenticated(token) #Just a pseudo example
  if valid:
    return Response.ok()
  return Response.fail()


texts: Adding values on reclassified layers using ArcMap?

texts:
I have reclassified the values on the layer I am using, however, I would like to  add extra values. The final values showed in the layer should be in a scale from 0 to 10. That means, in this case, I have to add somehow values for 1, 2, 3, 4 and 10.

Can someone help me with this ArcMap problem?


texts: I really need some help!  I am doing a k-LoCoH analysis in OpenJump.  The analysis is working, but I'm having trouble understanding the output.  There is a "density" column in the output, and I'm not sure what units this is in, or what it indicates.  I know by highlighting some of the polygons that the higher the number in the density column the more used the area...but I still would like to know what this number actually means before I continue with my results! Please help!!


texts: How to convert accuracy of DEM from 5 decimal places to 2

texts:
I had a csv dataset comprising of regular points containing elevation "z-values". I interpolated this using ESRI´s spatial analyst using the IDW method to produce a continuous raster surface. I set the resolution at 12,5 meters, because the points were 12,5 meters apart.

I now have a raster image which gives me values with 5 decimal places. The original data only had 2 decimal places.

My question is...should I round this up to 2 decimal places, because having this level of accuracy doesn´t reflect the absolute accuracy of the image. If I should round up the values, how/with which tool would I do it?

thanks,

Rob


texts: How to convert lat long to meters using Mercator projection in C#

texts: I have set of lat long values and I want their equivalent in meters using Mercator projection in C#. Can you please post some sample code or api example of some library that does exactly this?


texts:
I removed qgis 2.10 so i could install qgis 2.14. But when i try to install 2.14 i get errors on python .pyd packages. Every time it is a different pyd causing the error.
I had this problem with flapack, bestand_controls for example.

If anyone can help me out here?


texts: Easiest way to create a polygon from an unmarked municipality (using QGIS)

texts:
Is there any easier way to create a polygon from the white empty space in: https://ibb.co/JF0Mnpx? This space is associated with a municipality but the best i can do is this:
https://ibb.co/fxJYLBn using the add polygon feature in QGIS, which as you can see is not great. Is there an easier way to completely cover this blank area and assign information to it?


texts: Elevation maps from point clouds: TPS vs. other methods?

texts:
In the reply to another question, @thehealingprocess refers to

  "...a comparison of interpolation methods for interpolating elevation maps
  from LiDAR clouds, and in almost all scenarios thin plate spline
  interpolation was the most accurate method. IDW is good in some
  situations but it's quite primitive."

Does anyone have a reference to such a survey?


texts: Extracting temperature from Global Land Data Assimilation System (GLDAS) netcdf4 file using python?

texts:
I extract temperature data from the netcdf4 file using python I used these code but it returns only null values.

from netCDF4 import Dataset

nc = Dataset("GLDAS_NOAH025_3H.A20170102.0000.021.nc4","r")
for temp in nc.variables['AvgSurfT_inst'] :
    print (temp)

Output:

[[[-- -- -- ..., -- -- --]
  [-- -- -- ..., -- -- --]
  [-- -- -- ..., -- -- --]
  ...,
  [-- -- -- ..., -- -- --]
  [-- -- -- ..., -- -- --]
  [-- -- -- ..., -- -- --]]]


texts: How do you snap lines to the edge of the nearest polygon in bulk using QGIS?

texts:
I have shopping mall data with shops and doors.  I am trying to run 'join attributes by location' in order to match the shop names with the door. Some doors are located just within the shop polygon while some are just outside.  The 'join attributes by location' function doesn't work with the doors located outside the polygons.  Is there a way to snap all the doors to the edge of the nearest polygon in order to run the join attributes by location function?

Yellow lines are the doors outside the shop polygon.

Close up of door outside of polygon


texts: Clipping very large polygon datasets in ArcGIS?

texts:
I'm attempting to clip a large polygon dataset (~5gb, thousands of features) by a much smaller polygon dataset (~40 features). Is there a best practice or most efficient route for performing this task?

The standard geoprocessor clip runs indefinitely on a dataset of this size. Would some form of spatial selection and export be more efficient?

EDIT: Some great answers below. I selected what I view to be the most thorough response, but each answer provides unique insight into the issue. Thanks!


texts: Creating raster from polyline with the exact same resolution/extent as another raster

texts:
I'm trying to create a raster layer from a polyline layer (roads) that has the same extent as another raster layer (DEM)

What I've done so far is convert the second raster layer (DEM) with the extent I want to a polygon. This was then used to clip the polyline layer (roads). The polyline layer was then buffered, and converted into a raster layer with a resolution of 10x10.

However, the extent is different. Due to this, I can't do raster multiplication.

How can I ensure the extent is the same as the 'base' raster layer?


texts: Is it possible to create heatmap from layers of polygon geometry type?

texts: I'm new to GIS and my question is whether I can create a heatmap from a layer with polygon (multipolygon) geometry. As far as I know, it is only possible to create a heatmap from layers with point and line geometry. If this is the case, is there any way to export the data to a layer with point geometry without creating e.g. a CSV file with the coordinates?


texts: A mistake in very easy python code (Buffer 1 - Buffer 2- Erase 2 fom 1)

texts:
I need to make 500m rings (not full circle) around points (cities). I try to make 1. buffer: 2500 - 8500m (each 500m) and second buffer 3000 - 9000 (each 500m) and then erase  2500m from 3000m, 3000m (1.st buffer) from 3500m (second buffer), ... to get those 500m rings. But everytime i get an error.

import arcpy.sa
... k = 3000
... while k<=9000:
...     arcpy.Buffer_analysis("sidla","sidlaBuff"+str(k),k)
...     k=k+500
... l = 2500
... while l<=8500:
...     arcpy.Buffer_analysis("sidla","vyrezBuff"+str(l),l)
...     l=l+500
arcpy.Erase_analysis("sidlaBuff"+str(k),"vyrezBuff"+str(l),"vysledek"+str(l))

The error is something about that it can't do the layer sidlaBuff9500 and vyrezBuff9000, but those layers i dont want to do... but if i run that code WITHOUT the Erase, all buffer run correctly. Can anyone help?


texts: esri JavaScript Spatial Analysis Services: Select appropriate helper services url from Portal for requested operation

texts:
About 6 months ago I built a prototype JavaScript app which uses the spatial analysis service; FindNearest. Find Nearest. I've posted this on GeoNet but haven't had much joy there.

The app ran fine for a few months, prompting users to log in to ArcGIS online, before submitting a task and returning results.

Now my geoprocessing job is failing with: Select appropriate helper services url from Portal for requested operation","params". See below for full JSON response. You can also debug yourself at Rig Planner . Look at arcgis.js lines 215 to 255 to see me build my parameters object and submit the task. So what's changed? And what do I need to change to get my app returning results again?

{
jobId: "j1d25d7282f4b43fab8bd626a59908963",
jobStatus: "esriJobFailed",
results: { },
inputs: { },
messages:
[
]

{},
type: "esriJobMessageTypeError",
description: "{"error": {"code" : 0, "messageCode": "GPEXT_015","message": "Select appropriate helper services url from Portal for requested operation","params": {}}}"
{},
type: "esriJobMessageTypeError",
description: "{"messageCode": "AO_100030", "message": "FindNearest failed."}"
{},
type: "esriJobMessageTypeError",
description: "Failed to execute (FindNearest)."
{}
type: "esriJobMessageTypeError",
description: "Failed."
}

Steps to reproduce:

Go to http://www.deloitte-geospatial.com/rigplanner/
Open your browser's developer tools (I'm using Chrome) and show the network
tab
Search by Filter > Search. You do not need to change any of the
default filter values
Enter a valid ArcGIS Online username and password and hit OK. I've setup a temp account for debugging
You should be able to see the
api submit the gp task, then check it's status a few times before
failing. When I examine the output of the final output I see
jobStatus: esriJobFailed with an array of 4 messages. See the output
from my original posting the JSON object.

As I say this app was working fine up until a couple of months ago, and should return 2 objects when successful. i) The nearestLayer containing the 10 nearest points to the little rig marker, and also ii) the connecting lines from the marker to each point. It's a fun little proof of concept that we'd love to get working again.


texts: Relocate points added into a layer with different EPSG than the orthophoto layer using as reference

texts:
Thoundsans of points, representing singular trees in a region, were added manually into a shape layer with EPSG:23030, but it was done following visually the images from an orthophoto WMS layer with EPSG:23029.

I tried to reproject point layer from 23030 to 23029 but all points are misfit from its real position as I can see according the orthophoto WMS layer.

Is there any way to set points correctly in 23029 in QGIS?


texts: Finding all intersections of LineString and Polygon and order in which it intersects it using PostGIS

texts:
I would like to find out all intersections of a LineString (River) through Polygons (Municipalities). I would like to list the order of municipalities which the river crosses, using linear referencing. I already have found which municipalities are crossed by the river using st_intersects, but this is will not provide me the order and how many times municipalities are crossed. I am not expecting a full solution, rather a modus operandi that I will implement by my self.

I use PostGIS 2 extension with PostgreSQL 9.3

MWE:

WITH
A AS (
SELECT
    curves.gid AS cgid,
    shapes.gid AS sgid,
    curves.geom AS cgeom,
    shapes.geom AS sgeom,
    st_intersection(curves.geom, shapes.geom) AS mgeom
FROM
    curves, shapes),
B AS (
SELECT
    cgid, sgid, cgeom, sgeom,
    (st_dump(mgeom)).geom AS geom
FROM A),
C AS (
SELECT
    row_number() OVER ()::INTEGER as gid,
    cgid, sgid,
    cgeom, sgeom, geom,
    st_startPoint(geom) AS p0,
    st_endPoint(geom) AS p1
FROM B),
D AS (
SELECT
    C.*,
    st_Line_Locate_Point(cgeom, p0) AS r0,
    st_Line_Locate_Point(cgeom, p1) AS r1
FROM C
ORDER BY r0)

SELECT * FROM D

The query above find entry points and may be used in Linear Referencing in order to follow the original LineString through municipalities. I have to discriminate many use case and I am a little lost. This is my very first queries in GIS. Table shapes contains Polygons that have no intersections and curves contains LineString that pass through those Polygons.
The expected output is, for each LineString, the list of Polygons that it crosses (order and redondance matters).


texts: Is there a way to execute FME transformers from a PythonCaller script in an FME workspace?

texts:
I have a very large and complex Python/arcpy script that does lots of custom calculations, and I am trying to port it to an FME environemnt.  The script runs beautifully under ArcGIS.  The problem in porting is that some of the ESRI-specific functionality, especially geoprocessing tools, has to be replaced with similar FME functionality.  So, I would like to inquire if there is a way to run FME transformers, e.g. HullReplacer, from a PythonCaller script in an FME workspace.

True, the project could be rewritten completely in Workbench.  I have no doubt about that; however, that would take a lot of time and effort ... and to be completely honest, I am doing the port to FME for someone else who actually has the FME license.  I do not have access to FME myself.  Most of the functions of the existing script have ported almost without change to FME Workbench.  Works great.  There are a few places, though--right smack dab in the middle of the code--where some FME functionality is needed to replace some ESRI functionality, and "there's a transformer for that."  If I could execute a transformer in those places and continue processing the existing code with the output of the transformer, I could easily port the rest of the script.  I just don't know if it is possible programmatically to execute a transformer from Python.  I can't find any direct mention of this in online FME documentation or in online searches.  I have noted that a Python wrapper has been created for the IFMELibrary.  That provides a promising hint, but frankly I don't know what the IFMELibrary is or what it entails.  There is no documentation for it.

Can anyone shed any light on this for me?  Thanks, all, for the help.

ADDITION:  Hmmm.  I see in this post some sample code (in the first block) showing a transformer being called through Python.  Is this a valid and supported syntax?  If so, is there an online documentation set that covers the Python/fmeobjects syntax for calling each of the transformers?

CONCLUSION:  After a lot of searching, testing, and -- finally!-- being able to submit a question to Safe Software, my conclusion is that one cannot call FME transformers from within a Python script in a PythonCaller transformer.  This is disappointing.  I must proceed with chopping the scripts into little pieces and redoing the whole process in FME Workbench.


texts:
We have a CartoDB Coronelli account with 300MB of spare space.

I need to get a shapefile loaded that is 85MB in its .zip package. The file is sitting in a publicly accessible dropbox.

1: When I try to connect via Dropbox, the .zip file is simply not shown. I can't locate it via the little file browser modal window that CartoDB provides.

2: When I feed the Dropbox share/download link to the File Upload>URL field element, CartoDB thinks about it for 10secs and then reports that there was an error decompressing the archive.

How do I get my shapefile into CartoDB?


texts: How to automate 'downstream' and 'upstream' manhole ID field in a pipe line feature

texts:
I have been digitizing a drainage network and now have been supplied attribute fields to add to the features I have digitized.

Two of the fields for the pipe features are 'upstream manhole ID' and 'Downstream manhole ID'. All pipe lines have direction. Most pipes are snapped to a manhole at some point, but not directly. This is due to each line of pipe being a separate segment. For example a pipe segment ends when it reaches a manhole, same for when it reaches an inlet from a gully.

How could I populate the two manhole ID fields in the pipe feature?

I have considered dissolving the pipe network completely and then splitting the result by the manhole points but this hasn't been successful so far.


texts:
I'm trying to do some slow migration from a MS SQL Server 2008 R2 to a PostgreSQL 9.5 + PostGIS.

I created a FDW in PostgreSQL to access my MSSQL data and I imported most of my tables, but a few didn't make It.

Here is an exemple:

CREATE  FOREIGN TABLE ms_table_name(
col1 varchar (64), col2 date, geometry geometry
) SERVER mssql_db_server OPTIONS (query 'SELECT col1, col2, cast(geometry.STAsText() as varchar(max)) "geometry" FROM ms_table_name',
row_estimate_method 'showplan_all');

 CREATE TABLE pg_table_name AS (select * from ms_table_name);

 ALTER TABLE pg_table_name ADD oid serial PRIMARY KEY;

 CREATE INDEX pg_table_name_gix ON pg_table_name USING GIST (GEOMETRY);

I can't use binary because it returns two invalid characters, that's why I need to convert it to text.

As I said, it works for most geometries but for long/big geometries that have a large number of coordinates, it gets truncated.

  ERRO: parse error - invalid geometry SQL state: XX000 Hint:
  "...65032851836 8268588.7680116147, 6129" <-- parse error at position
  64513 within geometry

This geometry has 138280 chars, I confirmed all chars are being sent from MSSQL but PosgreSQL only reads 64512. I tried varchar, text, but still I get this 64512 char limit!

How do I work around it?


texts: Distribute points respect to features using Quantum Gis

texts:
I want to know if there is any tool to make points with respect to selected features in a theme?
Using: vector, investigating tools, regular points you can do it but not with respect to a selected feature - You obtain a square grid point.

Thanks, Cecilia


texts:
I have a .asc file from the german DWD, which displays the sunshine duration in Germany.

through an older post I already figured out that in order to be able to work with the .asc file i have to change the header.

Now I can project the file, however the projection is off.

The picture displays a state in germany, so the raster-layer projection of germany should be much bigger and actually match with the state.

I am also sure that slecting the correct coordinate-reference-system would be able to fix the problem. However, i have only given a .prj file with which I should work.

The .prj file reads:
PROJCS["DHDN_3_Degree_Gauss_Zone_3",GEOGCS["GCS_Deutsches_Hauptdreiecksnetz",DATUM["D_Deutsches_Hauptdreiecksnetz",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Gauss_Kruger"],PARAMETER["False_Easting",3500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",9.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

I would like to know how to project the .asc file correctly and if i will need the .prj file for it. If so, how do I set up the KBS to use the .prj projection for the .asc rasterlayer.

I am using QGIS Desktop Version 3.4.1


texts: Calculating areas of different raster classes in R?

texts:
I have generated a raster as a *.tiff file in R, with four classes. I'd like to calculate the area occupied by each raster class. Each class has a value (-5, -4, -3, -2) - I expect that I could also count the number of pixels in each raster class and multiply it with the cell size (0.23, I believe).

How can I calculate the area per class?


texts: Unexpected performance for OpenFileGDB driver compared with PostGIS

texts:
I am using GeoTools with OGR plugin to read .gdb data, and I found that the performance is rather horrible:
Test code:
    public static void main(String[] args) throws MalformedURLException {
        String gdb = "/data/x.gdb";

        Map<String, Object> params = new HashMap<>();
        //geotools pg
        params.clear();
        params = new HashMap<>();
        params.put("dbtype", "postgis");
        //other connection string omitted

        //ogr gdb
//        params.clear();
//        params.put("DriverName", "OpenFileGDB");
//        params.put("DatasourceName", new File(gdb).getAbsolutePath());

        try {
            long start = System.nanoTime();
            DataStore dataStore = DataStoreFinder.getDataStore(params);
            SimpleFeatureSource sfs = dataStore.getFeatureSource("Water");
            System.out.println("total count " + sfs.getCount(Query.ALL));
            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
            ReferencedEnvelope bbox = new ReferencedEnvelope(x1,x2,y1,y2, sfs.getSchema().getCoordinateReferenceSystem());
            Filter bboxFilter = ff.bbox(ff.property(sfs.getSchema().getGeometryDescriptor().getLocalName()), bbox);
            Query query = new Query();
            query.setFilter(ff.and(Arrays.asList(bboxFilter)));

            System.out.println("filter count " + sfs.getCount(query));

            long end = System.nanoTime();
            long used = end - start;
            System.out.println("used:" + TimeUnit.NANOSECONDS.toMillis(used) + " ms");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

The test result for OpenFileGDB driver:
total count 821328
filter count 1803
used:11710 ms

Then I exported that data to PG, and got the following result:
total count 821328
filter count 1805
used:1259 ms

PostGIS is much, much better than OpenFileGDB.
Did I miss anything?


texts: Finding minimum value of different columns using QGIS?

texts:
I'll try to calculate the minimum value of four different columns in my QGIS table like:

The min. value would be 1,50286 in the first row.

Is there any expression or tool to find the minimum value and write it into a new field?


texts: What are ui.Chart.image.doySeriesByRegion Arguments?

texts:
The function ui.Chart.image.doySeriesByRegion has been used on Google Earth Engine document, but it is not clear what are the arguments.

e.g. from the page:

var series3 = ui.Chart.image.doySeriesByRegion(
    collection, 'NDVI', regions, ee.Reducer.mean(), 500, ee.Reducer.mean(), 'label');

What is NDVI or what is 500. It seems when it is not specified what they are like so: band: "NDVI", the order of arguments is important.

The reason I am asking is that when I change the order of inputs/arguments, Google Earth Engine throws different errors at me.

What are those arguments?
How can I specify crs and 'crs_transform' and scale in there.

Error generating chart: Collection.first: Error in map(ID=64):
Image.reduceRegions: The default WGS84 projection is invalid for aggregations. Specify a scale or crs & crs_transform.

Collection.first: Error in map(ID=64):
Image.reduceRegions: The default WGS84 projection is invalid for aggregations. Specify a scale or crs & crs_transform.


texts: Memory error when unziping a file using PyQGis

texts:
I wrote a python script that download a .zip file from internet, then opens it in memory, and write all files I need in a new .zip stocked on hard drive.

But a MemoryError is raised with the biggest file, (300MB uncompressed), could someone help me find out what is wrong?

QGIS version : 2.18.16 - 32 bits

The script :

import requests, zipfile

def getZipFromUrl(url):
    data = requests.get(url)
    unzipped = zipfile.ZipFile(StringIO.StringIO(data.content))
    del data
    return (unzipped)

def copyZFile(name, origin, dest):
    data = origin.open(name, "r")
    dest.writestr(name, data.read())
    data.close()

def getFile(sdep):
    dir_out = "PLACE OUTPUT PATH HERE"
    dest = zipfile.ZipFile(dir_out+u"/01.zip", "w")
    source = self.getZipFromUrl("http://bano.openstreetmap.fr/BAN_odbl/BAN_odbl_01-shp.zip")
    for filename in bano.namelist():
        if (filename[-4:] != '.txt'):
            self.CopyZFile(filename, source, dest)

The error :

in copyZFile
    dest.writestr(name, data.read())
File "C:\PROGRA~2\QGIS2~1.18\apps\Python27\lib\zipfile.py", line 626, in read
    data = self.read1(n)
File "C:\PROGRA~2\QGIS2~1.18\apps\Python27\lib\zipfile.py", line 680, in read1
    max(n - len_readbuffer, self.MIN_READ_SIZE)
MemoryError

I don't understand why I get it, as it works well using python2.7, or smaller files.


texts: How to classify shapefile values in QGIS?

texts: I would like to classify shapefile values using graduated style in QGIS, but instead of using the default mode of classification (e.g.natural breaks with values range 0-10, 10-20, 20-30), I would like to set the values range to 0-10, 11-20, 21-30. Is it possible?


texts: In QGIS, how do you place horizontal label outside polygon border?

texts:
I am attempting to recreate a layout from ArcGIS in QGIS.  One of the advanced label options in ArcGIS is to force horizontal labels outside a polygon.  You can optionally choose which quadrant the labels fall in.

This question is related, but the labels are parallel with the polygon perimeter:  Labels outside polygons in ArcMap

The answer to this question is basically what I'm looking for, but my polygons aren't circles:  Upright/Horizontal labels when labeling polygons at perimeter in QGIS
That question was asked in 2014, so perhaps a solution has been found in ensuing years?  I am fine with prioritizing a quadrant for location, if that would help.


texts: cartodb Feature Click with two overlapping layers

texts:
We are using Google MAP API V3 and CartoDB. I am trying to create the custom info box window as user clicked on CartoDB points marker. We have two layers on Google map first one for UK wide ward area polygon layer and other one is represent to the homes in each ward area by points marker on the ward layer and both the layers has individual feature click events(i.e. ward area polygon zoomed in on click and points marker will show the info box on click). But whenever I click on the points marker ward area layer which is behind that points marker also trigger feature click event with that. So I just want to trigger the points marker feature click events to show info box when user clicked on that.

function drawWardOnMap() {

var sqlWhere;
cartodb.createLayer(map, {
        user_name: username,
        type: 'cartodb',
         sublayers:[{
            sql: "SELECT * from table",
            cartocss: $('#ward_heatmap_index').html().format('units'),
            interactivity: "units, cartodb_id, the_geom_webmercator, wd13nm, wd11cd, govtid, localarea, geometry "
        }]
})
.addTo(map)
.done(function (layer) {

    layer.setInteraction(true);
    GLOBAL_WARDS_HEATMAP_LAYER = layer;
    layer.getSubLayer(0).on('mouseover', function(e, latlng, pos, data, layerIndex) {
    });

    layer.on('featureClick', function(e, latlng, pos, data, layerIndex) {

        if(layerIndex == 1 ) {

            getUnitDetailsInfoBoxStats(data, "yes-show-it");
            return;

        } else if(layerIndex == 0 ) {

            getPointsOnMap();
        }

    });

    layer.getSubLayer(0).on('featureOut', function(e, pos, latlng, data, layerIndex) {
    });

})
.error(function (){
    console.log('problem adding 2nd layer');
});

}

function getPointsOnMap() {

var _numSublayers = GLOBAL_WARDS_HEATMAP_LAYER.getSubLayerCount();
console.log("_numSublayers: " + _numSublayers);
if( _numSublayers == 1 ) {

    GLOBAL_WARDS_HEATMAP_LAYER.createSubLayer({

    sql: _SQLString,
    cartocss: _CartoCss,
    interactivity: "rslid, non_pi_name, lrdid, lat, lang, postcode, district_name, unit_type_desc, wd11cd, wd13nm, govtid, localarea, ward_centroid_lat, ward_centroid_lang, total_mile_s_count"

    })
    GLOBAL_WARDS_HEATMAP_LAYER.getSubLayer(1).setInteraction(true);

} else if( _numSublayers == 2 ) {

    var _subLayer = GLOBAL_WARDS_HEATMAP_LAYER.getSubLayer(1);
    _subLayer.setSQL(_SQLString);
    _subLayer.setCartoCSS(_CartoCss);
    _subLayer.setInteractivity('rslid, non_pi_name, lrdid, lat, lang, postcode, district_name, unit_type_desc, wd11cd, wd13nm, govtid, localarea, ward_centroid_lat, ward_centroid_lang, total_mile_s_count');
    _subLayer.setInteraction(true);
}

}


texts: Enrich a dataset of POIs with OpenStreetMap

texts:
I have a list of POIs, some with a full description and some with only a few data entries, like the following:

6.9441000   50.9242000  [50677] (Ital) Casa di Biase [Köln]
6.9373600   50.9291800  [50674] (Ital) Al Setaccio [Köln]

However, I need the full dataset. Can I get this somewhere? If I have all the position data, is it possible to find the rest?

a. name of the street
b. name of the town

So for example, the data should finally look like this:

10.5346100  52.1613600  [38300] (Chin) Wanbao Kommissstr.9 [Wolfenbüttel]
13.2832500  52.4422600  [14167] (Ital) LaPergola  Unter den Eichen 84d [Berlin]
13.3177700  52.5062900  [10625] (Chin) Good Friends  Kantstr.30 [Berlin]

Can I do this with OpenStreetMap? Should I parse OpenStreetMap data? Or OpenBabel?


texts: Why does myRaster[1] <- 5 takes a very long time for a large raster?

texts:
I have a raster, which is not very big, only a few hundred megabytes compressed, but it has about 10 billion values, each stored in 1 byte (0..255). Uncompressed it would take about 10gb (lots of empty cells). I had a different issue when I realized that something like

library(raster)
myRaster <- raster("myRasterFile.tiff") # <--this file is not more than a few hundred mb
myRaster[1] <- 5

takes a very long time, without even using the disk, or the RAM too much. Just one core of the CPU is maxed and that's all.
I guess the raster is not loaded into memory, since I don't get a 10Gb spike in RAM usage when I do myRaster <- raster("myRasterFile.tiff"), and I would also guess that R knows where my value is located, since it shows me the value of  myRaster[1] instantly.

I thought that maybe the raster package might not want to mess with my file before I use writeRaster, so then for any write operation it would load the whole file into memory, but since there's no spike in the memory (it actually uses very little), it means it probably doesn't do that.
After that I thought that maybe it first uncompresses the whole file to the disk, bit by bit to a temporary location, and then it either loads it into ram, or use it from the disk. The CPU usage would make sense for uncompressing, although how does it get the first value to begin with without uncompressing. Anyway, this can't be true either since rsession doesn't even touch the disk and it doesn't increase the memory usage.

Any ideas of why this is happening and maybe solutions so that it doesn't happen?


texts: Dissolve of polygons leaving internal lines

texts:
I have been trying to produce an outline of a stylised island using dissolve however there are internal "lines" that remain after I use dissolve?
The hexagons that are being merged were created with the grid function so there shouldn't be any gaps present between them. I have tried "delete holes" however QGIS does recognise the lines as holes. QGIS is also showing the output as one large polygon too.
I'm a bit stumped as to why this is occurring. Alternatively is there is a different way to easily produce the outline of the polygons?
The below photos show the grid created input and the dissolve output with lines on it.


texts: Configurable Map Viewer Documentation Broken Links

texts:
The documentation page at

http://docs.cmv.io/en/1.3.4/

has broken links

For instance if you click viewer.js here:

http://docs.cmv.io/en/1.3.4/configure/viewer/

The links do not work (or at least I have an issue)

Is there a way to download an offline version of documentation?