texts: Convert shapefiles in nested folder to geodatabase

texts:
I currently have approximately six hundred old .mxds, and all the data source links are broken due to an upgrade in the GIS computer.

In the past, all the spatial data was stored as shapefiles in nested folders ie 2009/2009-040-01/BurialSites.shp or 2005/J2005-022/J2005-022aoi.shp. The data was organized by year, and to some extent, by the associated project.

What I would like to do is import all the old data into a geodatabase and use a python script to repair all the broken data sources in an efficient manner.

The issue with the shapefiles organized in this manner is that certain projects from 2009 will reference past projects, which makes manually repairing the data sources a frustrating and time consuming process.

Ideally, I would like to do is organize the old shapefiles into a geodatabase so it is not quite so messy, and fix the map documents using this geodatabase.

The main issue I have is that there are multiple shapefiles with the same name (Export_Output.shp), and when these are brought into the geodatabase a number is attached as a suffix (Export_Output_1, Export_Output_2 etc). In many instances the data with the same name but in a different folder is completely unrelated, but in other cases it is the same feature, but with an additional field in the attribute table.

It appears as though there are three options -

1) Import the shapefiles into a geodatabase and attempt to repair the broken data links

2) Keep the shapefiles in the current folders and repair the broken data sources

3) Repair the data sources in each map document on an 'as-needed' basis

Does anyone have advice on importing shapefiles into a geodatabase and repairing the data links before I spend lots of time on it? How big of an issue is it that file names have had a number tagged on the end?

This is not a priority job, but it is something that I would like to eventually finish.


texts: Inconsistencies subtracting rasters in R

texts:
I am new in GIS.

I have two rasters Aand B, with A representing a "future" status and B a present status. I want to compute and visualiza the net increase in A with respect to B.

Approach 1: I compute the sumof all cells in each layer as follows:

A_sum <- cellStats(A,"sum", na.rm=T)
B_sum <- cellStats(B,"sum", na.rm=T)
A_sum - B_sum
16.37

Approach 2: I create a layer with the same idea: visualiza the result map of increase in A with respect to B:

ABDif <- overlay(A, B, fun=function(r1, r2){return(r1-r2)})
plot(ABDif)
cellStats(ABDif,"sum", na.rm=T)
29.81

How on Earth both approaches render different results?

What is the correct one?

How would you calculate the % increase in A respect to B?


texts: Adding row from non-spatial table to attribute table of shapefile

texts:
In QGIS, I have a shapefile containing about 200 polygons. The attribute table contains some variables. I created a excel file from the attribute table and edited some of the variables. Now I want to return the new values of the excel table to the attribute table of the shapefile. Perhaps I could use the unchanged variable "height" in order to identify each single polygon (I forgot to introduce IDs; however, there are no dublicates in "height").
Is there a practical way to update the attribute table?


texts: ArcMap Zonal Statistics not producing attribute table

texts:
I'm using the zonal statistics in spatial analyst ArcMap 10.2. The input zone is a feature (conterminous US states) and the raster (.tiff - signed integer) is biomass for the entire conterminous US. All data have been projected to albers equal area. I have selected "Ignore No Data"

The problem:Zonal Statistics does not produce an attribute table. What should I do?


texts: Significant performance issues with PostGIS UnaryUnion

texts:
I'm in the process of migrating a number of processes from an ArcGIS environment to PostGIS and have run into a signicant performance issue when using ST_UnaryUnion to emulate the ArcGIS dissolve function.

The process so far is:

Upload 3 datasets, each to a separate table (these are related data, but as most calculations are on each individual set it seems to make sense to keep them separate - note that the table structure is the same). These have been prepared in ArcGIS (including running repair geometry) and uploaded using QGIS.
Run ST_MakeValid on each table (missing out this part results in a GEOS exception, it seems PostGIS is pickier about self-intersections than Arc)
Run the following query (intended to be equivalent to merge/dissolve in Arc):

SELECT ST_UnaryUnion(ST_Collect(input_geom.geom_4326)) AS new_geom FROM

(
SELECT * FROM "input_table_1"

UNION ALL

SELECT * FROM "input_table_2"

UNION ALL

SELECT * FROM "input_table_3"
) as input_geom;

(input table 1 is 60 rows totalling 85K vertices, table 2 is 77 rows totalling 1.6M vertices and table 3 is 56 rows totalling 1.2M vertices, all WGS84)

The above query works, in that it provides the correct area (once projected and the area calculated), but it takes close to 2 hours to run - the equivalent in Arc is 2 minutes! PostGIS is running on a much slower machine, but spatial queries (including a Unary Union of the 3 tables individually) normally only take 1.5-3x longer.

If I perform the above with 2 tables, saving the output as an intermediate and then unioning that with the 3rd table it takes around 5 minutes (this is a possible solution, though it seems like it should be unnecessary with the cascaded union implementation).

I'm aware there are several similar questions to this, and I've tried many of the suggestions, including:

Upping the available memory for PostGres (currently - shared_buffers: 768MB, work_mem: 768MB, wal_buffers: 128mb - server has total of 2gb ram, around 3/4 is free for postgres. I've tried various memory settings, these are just the largest I've experimented with. Running top suggests that postgres doesn't need more than c. 500MB memory for the query)
Each table has a spatial index, and I've tried reindexing
I've run VACUUM ANALYZE on each table prior to running the query

Any suggestions?

Other information:

Server is Ubuntu 14.04

Postgres is 9.3.13

PostGIS version data : "POSTGIS="2.1.2 r12389" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER"


texts: Vectorizing from raster image with discontinuities or breaks in polygons?

texts:
I am new to this site, so I have explained much as i don't know proper terminology.

I am using ArcGIS Desktop 9.3, in which I am trying to create vector polygon shapefile. But the raster image i have is of low quality (means there are some breaks) which is creating problems in vectorization of polygons.
   I have tried "Raster to Polyline" (so that later it can be converted to polygon), "Raster to Polygon", also Using ArcScan tool (snapping to raster), still the lines are discontinuous, or in case of the polygon, they are mismatching.

So what i really want to know is, whether there is an option to extend or connect the nearby lines, so that the exact shape of the polygons is preserved for large number of polygons...?

In the image, you can see some gaps of which the vectorization is incomplete. My problem is to automatically connect those gaps, so that polygons are created.


texts: Creating Feature Class in ArcObjects and C# says X Y domain on spatial reference system not set or invalid?

texts:
I'm trying to create a Feature class. It shows the error

  X Y domain on the spatial reference system is not set or in valid

Here is my code attempt:

      IWorkspaceFactory wsf = new  FileGDBWorkspaceFactory();
      IWorkspace ws = wsf.OpenFromFile(@"D:\ARC OBJECTS\Newgdb.gdb",
                       ArcMap.Application.hWnd);
      IFeatureWorkspace fws = ws as IFeatureWorkspace;
      IFields flds = new FieldsClass();
      IFieldsEdit fldsedit = flds as IFieldsEdit;
      IField fld = new FieldClass();
      IFieldEdit fldedit = fld as IFieldEdit;
      fldedit.AliasName_2 = "Shape";
      fldedit.IsNullable_2 = false;
      fldedit.Name_2 = "Shape";
      fldedit.Type_2 = esriFieldType.esriFieldTypeGeometry;
      IGeometryDef gdef = new GeometryDefClass();
      IGeometryDefEdit gdedit = gdef as IGeometryDefEdit;
      gdedit.GeometryType_2 = esriGeometryType.esriGeometryPolygon;
      gdedit.SpatialReference_2 = new UnknownCoordinateSystemClass();
      fldedit.GeometryDef_2 = gdedit;
      fldsedit.AddField(fld);
      IFeatureClass feacls= fws.CreateFeatureClass("Error", flds, null,
                          null,esriFeatureType.esriFTSimple, "shape", "");

Where did I go wrong?


texts: How to get the selected features - javascript api

texts:
I am totally new to geocortex.
I am using Geocortex HTML5, javascript api
After using identify tool to select features, how can I get the selected featureset in code?


texts: adding line breaks to labels in ArcGIS Online

texts: I'm using the new labeling functionality in ArcGIS Online. My question is how do I add a line break to the label if I want to use more than one field?


texts:
I have created the QGIS plugin in version 3.4 and trying to run the same in QGIS 3.10.12. The plugin is just about digitizing rules. I am able to save the data to PostgreSQL in QGIS 3.4 but in QGIS 3.10.12 for saving the data after Plugin execution, I am getting error with the error message stating something like below messages:
"['ERROR: 1 attribute value change(s) not applied.', '\n  Provider errors:', '    PostGIS error while changing attributes: ERROR:  syntax error at end of input\n    LINE 1: ...llength"=6,"undegroundroute_id"=NULL,"usedfiber"=NULL WHERE \n^\n    ']"

while checking log messages, under PostGIS tab I am getting below message.
WARNING    Erroneous query: UPDATE "web_gis"."underground_utility_box" SET "additional_info"=NULL,"authority"=2,"construction_status"=12,"ownership"=1,"condition"=NULL,"installed_date"=NULL,"landmark"=NULL,"make"=NULL,"owner"=NULL,"uub_type"=3,"uub_depth"=1,"uub_length"=1,"uub_width"=1 WHERE returned 7 [ERROR: syntax error at end of input
             LINE 1: ...ub_type"=3,"uub_depth"=1,"uub_length"=1,"uub_width"=1 WHERE
              ^
             ]

I am not understanding what is this error message.
The image of error message is attached for reference

The image for field name and field types attached.

Update: I tried my plugin in Qgis 3.10.5 version and it is working fine without any error whereas in Qgis 3.10.12 the error arises as mentioned above.


texts: Terminal connection error when running v.net.steiner

texts:
I am using GRASS 7.6.0 on a CentOS server. I've attempted to run the v.net.steiner function on the map layer with the following properties:

Layer/table: 1/network
type       count        min        max
point          0          0          0
line       33893          1      32592
boundary       0          0          0
centroid       0          0          0
area           0          0          0
face           0          0          0
kernel         0          0          0
all        33893          1      32592
Layer: 2
type       count        min        max
point       3440          1       3461
line           0          0          0
boundary       0          0          0
centroid       0          0          0
area           0          0          0
face           0          0          0
kernel         0          0          0
all         3440          1       3461

When running v.net.steiner I recieve an error as follows:

v.net.steiner input=network arc_layer=1 node_layer=2 terminal_cats=0-3461 output=steinerout
Number of terminals: 3437
Number of Steiner points set to 3435
Building graph...
Registering arcs...
 100%
Flattening the graph...
Graph was built
ERROR: Terminal at node [30981] cannot be connected to terminal at node
       [2269]

Wondering why this might be happening.


texts:
I would like to build an offline routing engine to compute route distance between two coordinates.
I found osm2po but I didn't found any sort of documentation. As far as i understood osm2po can be used as java library.
Where can I find it?
Because I didn't found any way to use osm files to find a path.
There's others valid offline engines that I can use? Or there's some sort of input paramenters to use with osm2po to get the distance?
Thanks


texts: How to clip roads to exclude those within a flood zone?

texts:
I have OSM road network data in QGIS along with a shapefile showing the possible extent of a flood.

My question is: is it possible to exclude all of the roads that are in the flood zone (so as to pretend that they are flooded/impassable) and generate a road network that can then be used for routing?

My initial thought was to use the clip function but it simply clips the road network shapefile to the same overall shape as the flood shapefile, not just the sections that would actually be flooded.

This screenshot may help explain a little more...


texts: How can I transfer shape or database files to Terrasync without Pathfinder office?

texts:
I have point data in ArcGIS that I need to get onto my Trimble GeoXT (with TerraSync Standard).

I don't have Pathfinder Office.

Is there a way to transfer the data over so I navigate to the points?


texts: Sorting a table based on if-then statement

texts:
I have a large table with two attribute fields "layers" and "Meas" both contain numbers, I would like to sort "Meas" in the odd numbered "layers" in ascending order, and "Meas" in the even numbered "layers" in Descending order. This would be part of a larger model in modelbuilder.  I am using Arc Desktop, so "If Value Is" tool is not available.

This feels like it should be easy to do, however I have tried unsuccessfully to code something in python and am at a loss about how to approach the issue, any suggestions?

What I have:

[ID,  Layer,  Meas],
[1,     1,     3],
[2,     1,     2],
[3,     1,     1],
[4,     1,     5],
[5,     2,     3],
[6,     2,     2],
[7,     2,     5],
[8,     3,     3],
[9,     3,     2],
[10,     3,     1],
[11,     3,     5]

What I want:

[ID,  Layer,  Meas],
[3,     1,     1],
[2,     1,     2],
[1,     1,     3],
[4,     1,     5],
[7,     2,     5],
[5,     2,     3],
[6,     2,     2],
[10,     3,     1],
[9,     3,     2],
[8,     3,     3],
[11,     3,     5]


texts: ArcGIS - Export raster keep color scheme

texts: I have a *.flt raster loaded in ArcMap.  I would like to export this raster as a georeferenced tiff file keeping the color scheme I have provided in the symbology.  I right click in TOC, Export Data and export that raster data as a tiff file.  The problem is the color scheme does not carry over.  I have tried variations of "use rendered" and "force RGB" with no luck.


texts:
I have a shapefile of a line feature created using GPS. The coordinate system and projection info on the original is:

NAD_1983_UTM_Zone_10N (this is in meters)
WKID: 26910 Authority: EPSG
Projection: Transverse_Mercator
Geographic Coordinate System: GCS_North_American_1983

Extent:
Left: 511231.976300 m
Right: 512950.095100 m
Top: 4210505.853400 m
Bottom: 4207483.315300 m

The result looks like this:

where there is an offset of 200-300 meters. I have tried various projections in the data frame and have used the define projection tool to get the path to line up, but this is as close as it will come. What should my next steps be to get this to line up? Here is a download link for the shapefile (it's very small): https://drive.google.com/drive/folders/0BxJnXRpaO3M2TUJiVU85SGhkd1k?usp=sharing.


texts: Distance between latlongs varies in different projection systems?

texts:
I have shapefiles with correct projections. The SRS is EPSG 32735 (WGS 1984 UTM 35S)

Now, I have these two coordinates from this projection system:

(31.3751,-23.4388) and (31.3779,-23.4355).

Obviously the coordinates (format and value) will vary on different projection systems, and there in lies my confusion.

I used the following link to calculate the distance between the two points:
http://www.movable-type.co.uk/scripts/latlong.html

I copy pasted the lat/longs exactly as shown above and the distance it gives me is 0.313 meters. But I'm not sure if this is correct at all, since the calculator didn't ask me for any projection system? So:

Does this mean the projection doesn't matter to calculate the distance?
Does it differ between different projection systems?
Is the tool I'm using incapable?

Thanks,

Kaushik


texts: How to find records using a distance filter, in a table of Points?

texts:
My table fields are: POSIC (id, geom, dt_inclusion).
DB is PostGIS.
Data comes from a GPS Source, then i can create a route ordening the points by Date_Inclusion.

So, lets say i have registries A,B,C and D, with a start point A and end point D.
With distance from each other: [A->B 250meters] , [B->C 250meters] and [C->D 600meters].

I need a query that with a 1 KM filter, would return points A, B and C, the last 1KM covered from point A.

Im trying to do this using recursive a query. Execute a st_distance from A->B and save the result, check if its greater than 1KM, if not, execute another st_distance, from B->C + (last_result) and check it again.
But maybe there is a better aproach. Or any help on this recursive query would be great too.


texts: Using one polygon from feature class as clip feature in ArcGIS for Desktop?

texts: Using ArcMap 10.3, I am trying to clip some features using a polygon containing many census boundaries. I only want a specific census area as the clip feature, so I only have that specific shape showing. However, when I run the clip tool, it clips for the entire polygon and not just the small area I have selected. Is there a way to do this other than extracting that particular area as a separate shapefile?


texts: QgsVectorDataProvider.createAttributeIndex() fails in QGis 1.8

texts:
Adding an Attribute Index to a Shapefile fails for a Python Plugin in QGIS:

For example - the following python Code in a Plugin

ly = QgsVectorLayer(data_source, layer_name,"ogr")
prov = ly.dataProvider()
prov.createAttributeIndex(i)

results in the error Message:

  'QgsVectorDataProvider' object has no attribute 'createAttributeIndex'

Whereas Adding a Spatial Index works without any problem

ly = QgsVectorLayer(data_source, layer_name,"ogr")
prov = ly.dataProvider()
prov.createSpatialIndex()

Is this a bug?


texts: Updating contrast enhancements for raster layers using bandStatistics in PyQGIS?

texts:
Found this function to update statistics for a raster layer :

rlayer.setContrastEnhancement(QgsContrastEnhancement.StretchToMinimumMaximum,
                          QgsRaster.ContrastEnhancementMinMax)

Which works great for minmax and cumulative but stddev is hardcoded to 1 standard deviation. For cumulative it reads the lower and upper values from the settings but no setting for stddev.

So I have looked at the C++ code in the api and tried to convert that into a QGIS script.
The only problem is that the band statistics and cumulative cut functions are returning "nan". Take a look at my code segment below and see if you can help:

       myEnhancement = QgsContrastEnhancement(myType)
       myEnhancement.setContrastEnhancementAlgorithm(ContrastEnhancement,True)

       if Limits == 0:
          myRasterBandStats = rlayer.renderer().bandStatistics( myBand,
                                     QgsRasterBandStats.Min | QgsRasterBandStats.Max)
          myMin = myRasterBandStats.minimumValue
          myMax = myRasterBandStats.maximumValue

       elif Limits == 1:
            myRasterBandStats = rlayer.renderer().bandStatistics( myBand,
                                   QgsRasterBandStats.Mean | QgsRasterBandStats.StdDev)
            myMin = myRasterBandStats.mean - ( StdDev * myRasterBandStats.stdDev )
            myMax = myRasterBandStats.mean + ( StdDev * myRasterBandStats.stdDev )

       elif Limits == 2:
            myMin,myMax = rlayer.renderer().cumulativeCut( myBand, CumulativeLower,
                                                          CumulativeUpper)

       raise GeoAlgorithmExecutionException( str(myBand) + " " + str(myMin) + " " + str(myMax))
       myEnhancement.setMinimumValue( myMin )
       myEnhancement.setMaximumValue( myMax )

       if renderType == "singlebandgray":
          rlayer.renderer().setContrastEnhancement(myEnhancement)
       elif renderType == "multibandcolor":
          if Band == 0:
             rlayer.renderer().setRedContrastEnhancement(myEnhancement)
          elif Band == 1:
             rlayer.renderer().setGreenContrastEnhancement(myEnhancement)
          elif Band == 2:
             rlayer.renderer().setBlueContrastEnhancement(myEnhancement)
       rlayer.triggerRepaint()

Heres the full script using the first function which works great but does not enable you to have more than 1 standard deviation

##[Example scripts]=group
##Limits=selection "MinMax";"StdDev";"Cumulative"
##Stretch=selection "NoStretch";"StretchToMinMax";"StretchAndClipToMinMax";"ClipToMinMax"

import os
from qgis.core import *
from qgis.gui import *
import qgis.utils

layers = qgis.utils.iface.legendInterface().layers()

for layer in layers:
    layerType = layer.type()
    if layerType == QgsMapLayer.RasterLayer:
       if Stretch==0:
          ContrastEnhancement = QgsContrastEnhancement.NoEnhancement
       elif Stretch==1:
            ContrastEnhancement = QgsContrastEnhancement.StretchToMinimumMaximum
       elif Stretch==2:
            ContrastEnhancement = QgsContrastEnhancement.StretchAndClipToMinimumMaximum
       elif Stretch==3:
            ContrastEnhancement = QgsContrastEnhancement.ClipToMinimumMaximum

       if Limits==0:
          layer.setContrastEnhancement(ContrastEnhancement,QgsRaster.ContrastEnhancementMinMax)
       elif Limits==1:
          layer.setContrastEnhancement(ContrastEnhancement,QgsRaster.ContrastEnhancementStdDev)
       elif Limits==2:
           layer.setContrastEnhancement(ContrastEnhancement,QgsRaster.ContrastEnhancementCumulativeCut)
       layer.triggerRepaint()


texts:
I installed the Terrain Tools 1.1 in my ArcGIS 10.4 and ran several scripts (MDOW, etc), but the SkyModel failed a bunch of times with the pre-built points.
The Sky Model is a quite unusual script, because it uses a text file archive to orient several light spots to create a hillshade, and this light spots can be create in a small app called SkyLuminance.
After testing several groups of points and receiving a lot of error messages I realized that script was only working with a minimal amount of points, 90 more or less, insted of the 150-300 that the app can generate.
With 350 points I receive this error message:

Traceback (most recent call last):   File
"D:\Documents\ArcGIS\TerrainTools_v1_1\Scripts\SkyModel.py", line 81,
in
skymodel(*args)   File "D:\Documents\ArcGIS\TerrainTools_v1_1\Scripts\SkyModel.py", line 63,
in skymodel
prevRaster.save(outRaster) RuntimeError: ERROR 010240: Could not save raster dataset to D:\Default.gdb\Sky4 with output format FGDBR.
Failed to execute (SkyModel). Failed at Tue Jun 16 05:13:14 2020
(Elapsed Time: 17 minutes 28 seconds)

I have no idea how to solve this issue. Can someone help?
If you going to use the Sky Model for the first time, read the manual.


texts: Export shapefile of a flow map with arrows indicating their direction in R

texts:
How can I insert arrows on flows and export flows map with arrows indicating their direction in R?

I know that I can use the arrows command of the maptools library to "print" an arrow in line with the flow indicating its direction, but unfortunately, the command arrows only works after the command plot("object that contains the map") run. When I export the map, of course the arrows are not exported because they are not part of the shapefile that is generated by writeLinesShape command.

So, is there any way this be done?


texts: How to use European Environment Agency Land Cover Data in ArcGIS for Desktop?

texts:
I am new to ArcGIS for Desktop and I have downloaded some land cover data from the European Environment Agency. the data comes in 3 separate files, A tiff file, which is the data source for the raster, a layer file which has all the symbology, and then the attribute table is an excel file.

How can I get ArcGIS use the table and the tiff file with the layer file?


texts: Using ctypes for QGIS Python plugin to bind DLL

texts:
I'm trying to build a Python plugin in QGIS which does some raster image processing. The processing itself is done via a .dll. Hence, I'd like to bind it with ctypes. First of all: is it possible to use ctypes with a Python plugin in QGIS? Secondly, if yes, what am I doing wrong if I am getting the following error?

OSError: [WinError 126] The specified modul could not be found

The plugin was created using the plugin builder and following this tutorial. It's a dock widget and is besides the processing function vanilla.
What I tried so far:

Checked if the .dll exists in the specified location
Ran a mwe only loading the dll and doing the processing in both a conda environment and using the Python executable in c:\Program Files\QGIS 3.14\apps\Python37\ -> Both worked without problems
Used os.chdir and changed to directory where the .dll is located -> No effect
Tried different things with the directory string (raw, forward slash, double backward slash)
Added the directory containing the dll to the Windows PATH

I've read that it could be related to a missing dependency. However, I'm not sure how to pin-point the problem as it seems to run in both tested Python environments.


texts: Spatial join of multiple different point layers keeping all attributes in ArcGIS

texts:
I have 28 fairly large point data sets (1/6 degree global grid), all of different extents but with the same point location (previously extracted as centroids from raster pixel).

Each point layer has a unique value (grid_code in example below) per point but as the spatial extents for each point file vary, FID and pointid do not match, i.e. there is no common value to join on.

Using ArcGIS Desktop (10.5) I'd like to combine all 28 files to one by location as the Spatial Join tool does (a reverse one-to-many), but create one file that contains the full spatial extent of all files combined and the respective values attributes (preferably with the origin layer names) per point:

I have tried all varieties of merge, join, relate and spatial join but they either do not combine the attributes, do not join by location or there is no possibility to do it as a batch function.


texts: How to narrow raster features to single cell width?

texts:
Are there any tools or existing workflow which convert raster features (such as roads, rivers, electric lines etc.) which are (or can be) multiple cells wide to a single cell widht (i.e, center line).

For simplicity, lets say that we have binary data: 1 = feature (whatever it is) and 0 = NoData.

Like this:

Now that's already pretty good, but how could I narrow all of those features to single cell width (using 8 node connectivity)?
Looking a solution for some of the following softwares:
ArcGIS, QGIS, SAGA GIS.


texts:
I have GPX trails of vehicles/bikes of a particular city. Meaning, lat/lon, timestamp of bike trails from where a particular bike started and ended at different hours of the day. I have sets of these trails for different bikes roaming around the city.

Now, I want to know if it is possible with PostGIS+pgRouting+any other combination to know how much time it takes to go from point A to point B in a particular range of hours by using the data I already have. Assume I have enough data for the city in terms of bike trails.

I do not want to use OSM data. But, if it is required, I am fine with using it.

Sample data:

  BikeID, Lat, Lon, timeStamp
      1234,13.9845583,77.6052433,1431849998287
      1234,13.9846133,77.6052366,1431850069237
      1234,13.9846333,77.6051566,1431850102429
      95,13.9845683,77.6050683,1431850138314
      95,13.9845683,77.6050683,1431850172455


texts: Convert CRS for spatial join for GeoDataFrame

texts:
I have the following 2 GeoDataFrame variables in GeoPandas.

# shp.csr
{'init': 'epsg:2953'}

# line.csr
{'proj': 'sterea',
 'lat_0': 46.5,
 'lon_0': -66.5,
 'k': 0.999912,
 'x_0': 2500000,
 'y_0': 7500000,
 'ellps': 'GRS80',
 'towgs84': '0,0,0,0,0,0,0',
 'units': 'm',
 'no_defs': True}

When I do a sjoin of the 2 variables directly, a warning occurs:

/Users/jeff/.pyenv/versions/3.7.2/lib/python3.7/site-packages/geopandas/tools/sjoin.py:44: UserWarning: CRS of frames being joined does not match!
  warn('CRS of frames being joined does not match!')

How do I convert the CRS so that I can do a sjoin() correctly?


texts: How do I use ReorientObject() in an SQL Server 2012 UPDATE statement?

texts:
I'm trying to UPDATE a Geography field in an SQL Server 2012 database using the output of a web mapper.  I got the dreaded "The specified input does not represent a valid geography instance because it exceeds a single hemisphere," error when running the command. I found that by reversing the order of the vertices the UPDATE command works as expected.

I see that SQL Server 2012 includes a ReorientObject() method that does this task, but I don't know how to incorporate it into my SQL UPDATE command.  The following returns the same "single hemisphere" error.

UPDATE tblProjects
SET tblProjects.Boundary = geography::STGeomFromText( 'POLYGON ((-93.30388806760311 27.994401411046173, -94.62224744260311 33.37641235124676, -79.70281384885311 31.80289258670676, -93.30388806760311 27.994401411046173))',4326).ReorientObject()
WHERE tblProjects.ProjectID = 1 ;


texts: Changing popup position on Leaflet marker?

texts:
I want open a popup on bottom of my marker icon in Leaflet.

my code:

var mymap = L.map('mapid').setView([51.505, -0.09], 13);

L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw', {
    maxZoom: 18,
    attribution: 'Map data &copy; OpenStreetMap contributors, ' +
    'CC-BY-SA, ' +
    'Imagery © Mapbox',
    id: 'mapbox.streets'
}).addTo(mymap);

var lati = 51.51;
var longi = -0.09;

var popupLocation1 = new L.LatLng(lati, longi);
var popupContent1 = 'This is a nice popup';

popup1 = new L.Popup();
popup1.setLatLng(popupLocation1);
popup1.setContent(popupContent1);

var m1 = L.marker([ lati, longi ]).addTo(mymap);

m1.bindPopup(popup1);

m1.openPopup();

So I get a popup on top of my marker.

I want get a popup on bottom like:


texts: Aggregate Willmott and Matsuura Temperature Climate Data on Country Level

texts:
I'm looking for monthly mean temperature data on the country-level since 1900, or at least 1950, with temperature weighted according to population density.

The common database for the spatial temperature is by Willmott & Matsuura

The population data typically comes from Gridded Population of the World

I downloaded the Willmott & Matsuura temperature data, which is a single gz-file.
How can I aggregate the Willmott-Matssura temperature data at the country-level using R?

Is there an open code for this? Or has someone else maybe done it
(as it is a commonly used dataset in the literature)?


texts: I want to display an Overview map - I know how to do it using a separate PageLayout or MapControl - but I noticed ESRI has an OverviewClass - how do I make use of this with the AxMapControl?


texts: Changing spatial resolution of Landsat image

texts:
Is it possible to convert different spatial resolution (pixel size) of satellite images into similar ones?  What technique should I use?
I'm using QGIS software.


texts: Clicking Details in Result Window in Geoportal Modifies Address to Local IP

texts:
I'm using ESRI's Geoportal Extension 10.0. The issue I'm having is when the preview or details is selected in the results window after a search the outside web address is reverted back to the local IP address. The metadata and open options don't change the outside web address to the local IP. Any ideas? I'm sure I'm missing something simple here.

Three photos are attached. The first screenshot is the options to click on after a search result. The second is the outside web address after a search. The third is what happens when clicking on details or preview.


texts: Can I create a geospatial PDF in Python without using GIS software?

texts: I have a Django web app that produces a couple different PDFs. One just displays tabular data, but another one needs to display geometries out of a PostGIS database, along with tabular data. In my web search attempts, all I can find are solutions that use ArcGIS (ArcPy) or QGIS (PyQGIS). I would like to avoid having to install additional software (not to mention licensing ArcGIS), and was wondering if there is a purely Python solution that is available? If there are solutions that utilize GeoDjango or GeoPandas, I haven't been able to find them.


texts:
I am just beginning as a QGIS user, and I have used ArcGIS mostly in the past. I am in the position of having to defend QGIS as a viable solution for many, if not most, GIS needs for Country and City Planning (GIS for Urban and Regional Planning).

Is anyone aware of specific communities (small or large) or companies that are using QGIS for commercial-grade Planning GIS? Any in the US? Southeast US is even better...

Thanks in advance!


texts:
I'm trying to open this shapefile with CartoDB or http://geojson.io, but I keep getting different kind of errors.

I can open it with QGIS, but then I tried exporting it to GeoJSON, KML, ESRI shapefile, and others, and I always get lots of records but nothing on the map.

I'd like to just convert it to GeoJSON so that I can open it with any tool.

Am I missing anything?


texts: Distance from settlements to major roads: Network analyst, OD Cost Matrix

texts:
I am trying to identify the closest driving/walking distance to major roads. I have settlements (points), the road from OSM (polylines), and major roads (polylines).

I have tried Network Analyst but it only works for few settlements because most of the settlement points are not located right on the OSM roads. I have tried Integration tool (Data Management) to put them on the roads but it messes up the settlements data.

What would be the easiest way to find the shortest driving/walking distance from settlement points to closest point of major roads' polylines?

I am using ArcGIS Desktop 10.3.


texts: Determining the center of a gradient in OL shape

texts:
I am trying to draw a circle on an OL map and

have the center of it a particular color,
have the color fade out to transparent as it gets closer to the edges of the circle.

I have been looking at the docs for the createRadialGradient function (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createRadialGradient), but I'm unsure of the correct numbers to plug into there.

Code looks something like this:

const circle = {center: [myLon, myLat], radius: myRadius };
const context = document.createElement('canvas').getContext('2d');
// How do I get the correct points from OL or circle object?
const grad = context.createRadialGradient(?,?,?,?,?,?);
grad.addColorStop(0, 'transparent');
grad.addColorStop(0.5, 'someColor');
grad.addColorStop(1, 'transparent');

UPDATE:

Code has been updated to this after getting help on this post by TomazicM:

const context = document.createElement('canvas').getContext('2d');
const pixels = map.getPixelFromCoordinate([myLon, myLat])
const grad = context.createRadialGradient(pixels[0],pixels[1],1,pixels[0],pixels[1],0.05);
grad.addColorStop(0, 'transparent');
grad.addColorStop(0.5, 'someColor');
grad.addColorStop(1, 'transparent');

const fill = new Fill();
fill.setColor(grad);

const style = new Style({
  fill,
  stroke: new Stroke({
    color: 'someColor',
    width: 2,
  }),
});

const f = new Feature(new Circle(center,radius));
f.setStyle(style);


texts: Differences between imported Landsat-8 images in Erdas Imagine

texts:
What is the difference between the images created after importing with USGS Landsat 8 dialog, in particular, the suffixes _msi and _msitir? I understand that they stand for multispectral image and multispectral image with thermal image, but why are there 2 different versions? What uses are there for each one of them that makes it important to have one file with TIR and the other without?

Thanks


texts:
I'm trying to build a raster attribute table since my DEM file does not have one. But I can't because the file is using a floating point.

How do I convert the floating point into an integer?

I'm using the elevation data to do a least cost path analysis afterwards.


texts: setting model workspace from script (and saving the setting)

texts:
I made a model using ModelBuilder. User must be able to specify output featureclasses by basename, I do not want to expose the workspace. The workspace therefore needs to be specified in the model environment.
The workspace can be derived from the other specifics.

A savvy user can do this in the toolbox window, however, I want to make it automatic.
So, I'm looking for a way to set toolbox environment variables by means of python script.
My ArcGIS version is 9.3.1. However, I'm interested in advice pertaining to version 10+ as well, since it just might put me on the right track.


texts: Creating temporary sketches for editing in ArcMap

texts:
I administer an enterprise geodatabase consisting of building and parcel data. It's crucial that no schema changes are made and that no additional feature classes are added to the database as that might interfere with regularly patching of the databases.

The users says they're often in need for guidelines to facilitate construction, editing or staking and find themselves annoyed by the constant switching of edit sessions to an temporarily database as they're generally more used to work with cad based software.

It is not suitable to use existing lines or points in the database as guidelines and simply delete them as multiple attributes need to be filled in and also there are some topology rules preventing certain geometries.

I thus wonder if there is any way to construct temporary sketches or to create graphic with the existing construction tools like tracing or to create some kind of versioned and editable database view in the database to prevent the user from switching database. I know there are some addin for guidelines but it is unsupported and far to unstable to use.


texts: Need to draw a map with Multipolygon coordinates using OL3


texts:
I need to georeference an image. I had QGIS 3.2 installed. When I clicked on "Plugins -> Manage and Install Plugins" QGIS froze. So, I tried installing 3.8 and the same things happened.  Tried 3.4, same result. Tried uninstalling old versions, restarted computer...same result.  There is an old bug report referencing this problem: https://issues.qgis.org/issues/19526

Is there a known solution to this freezing, or alternatively, a workaround that will allow me to georeference in QGIS without needing to use "Manage and Install Plugins"?

For instance, could I manually install a georeferencing plugin?


texts: ArcObjects in ArcMap 10.2.2 UpdateCursor refer to a calculated field value in the same Cursor

texts:
Is it safe to calculate a field value inside an update cursor and refer back to this calculated value to change another field value of the same row?

I think some code will actually explain my question:

ICursor _updateCursor = selectedTable.Update(myQueryFilter, false);
IRow row = _updateCursor.NextRow();
while (row != null) {
            row.set_Value(fieldColumn, (double)row.get_Value(fieldColumn) * 2);
            row.set_Value(fieldColumn+1, (double)row.get_Value(fieldColumn) * 2);
            updateCursor.UpdateRow(row);
            row = _updateCursor.NextRow();
}

The effect I'm looking for is the column at position fieldColumn will have its values doubled and the column next to it will have the original value quadrupled.
But is this safe to do? Will I always get the doubled value in my second expression or is there a chance the value will not be written until i flush the cursor object, thus will end up having just the doubled values in the adjacent column?

I did some tests on a really small table (10 rows) and it works the way I want but I have to ensure this will work in tables of tens of thousands of rows


texts: Extracting value of each pixel of a tiff file

texts:
I have a aggregated tif file, and I want to extract the value of each pixel in the tif file. Here is my code to read values of each pixel, but all the values I got were nan. I do not know why.
import rasterio
band_id = 1

raster = rasterio.open('MODIS_stats_output/Alb_BSA_VIS/mean_Alb_BSA_Vis_2000_183.tif',masked=True)
band_arr = raster.read(band_id)  # band_arr is a numpy array of shape (raster.width, raster.height)

px_vals = []

for x in range(band_arr.shape[0]):
    for y in range(band_arr.shape[1]):
        px_vals.append({'x': x, 'y': y, 'value': band_arr[x, y]})


texts: Importing Shapefile into PostGIS and EPSG of created table is different from Shapefile?

texts:
I'm trying to import a Shapefile into PostGIS using the ogr2ogr, but it seems that the OGR is not automatically getting the EPSG from Shapefile.

My Shapefile has EPSG 4618, but the table created by ogr2ogr has EPSG 900914.

The code I'm using is as follows:

ogr2ogr -append -f "PostgreSQL" PG:"host=x dbname=x user=x password=x" points.shp -nln points -skipfailures -lco FID=id -lco GEOMETRY_NAME=geom

Anyone has any idea what's going on? Because the files (* .dbf, * .shx and so on) are in the same folder of the * .shp file.

I send below two print screens: one from shapefile and the other from PostGIS, showing the EPSG of each one, that are different, but they should be equal.

Shapefile:

PostGIS:

The content of .prj file is:

GEOGCS["SAD69",DATUM["D_South_American_1969",SPHEROID["GRS_1967_Truncated",6378160,298.25]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]


texts: Is there a way to filter geoserver vector tile on request?

texts:
I am using Geoserver 2.11.1 with the vector tile extension to render data in mapbox-gl. I'm able to pull the vector tiles in no problem, but I also need to filter the data on the server side.

        map.addSource('testLayer', {
            "type": 'vector',
            "scheme": 'tms',
            "tiles": ["http://localhost:8080/geoserver/gwc/service/tms/1.0.0/dashboard%3Atest_layer@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf"],
        });

        map.addLayer({
            "id": "testLayer",
            "type": "circle",
            "source": "testLayer",
            "source-layer": "test_layer",
            "paint": {
                "circle-color": "#3887be"
            },
            'minzoom': 12
        });

I've tried adding a cql filter as a parameter in the request, but it doesn't seem to work.

 CQL_FILTER=account_no%20%3D%3D%202

Is it possible to filter vector tile data is geoserver using this kind of tms request? If no, is there a way to use WMS request with cql filter for vector tiles?


texts: Get the 2 points immediately before and after a given point in PostGIS

texts:
In the picture below:
The given point is C, I would like to select A and B, but not Z (which is closer to C than B but it's not immediately after in the LineString).

Note that C is always ON the line but not a vertex of the line.


texts: How do I get the country codes from polygons in my "grid data" polygon dataframe?

texts:
I am relatively new to working with spatial data in R.
I have two spatial polygon data frames.
The first one is a shapefile which has a grid structure of a resolution of 0.5*0.5 for the whole world.
The second one is a shapefile which has the boundaries for Africa as the polygons including the state names .
Both have latitude-longitude coordinates.

I would like to overlay the two files and drop every cell that is not in the Africa file, thus I would like to have only the cells that belong to Africa.
In a second step I would then like to assign each grid cell the country it belongs to.
Does anyone have an idea how I would do that?
intersect() or over() didn't work for me.


texts: Exporting image from imageCollection.reduce

texts:
I'm trying to export to an asset an image containing a single band, the 90th percentile of LST of 1 year of MODIS. I'm using this script :

var inColl = ee.ImageCollection('MODIS/006/MOD11A1')
inColl = inColl.filterDate('2000-02-24', '2001-02-23')
print(inColl.first())
inColl = inColl.map(function (img){return img.select('LST_Day_1km').multiply(.02)})
var yrPrcntl = inColl.reduce(ee.Reducer.percentile([90]))

var pt = [9.15, 42.0742];
Map.centerObject(ee.Geometry.Point(pt), 10);

var palette = ['00008F', '0010FF', '0060FF', '00FFFF', 'CCFFCC', 'FFFF00', 'FF8000', 'FF2000', '800000'];

print(yrPrcntl);
Map.addLayer(yrPrcntl.select("LST_Day_1km_p90"), {min: 280, max: 315, palette: palette});

var bounds = ee.Geometry.Rectangle([-180, -90, 180, 90]);
//var bounds = ee.Geometry.Rectangle([0, 40, 15, 40]);

Export.image.toAsset(
  {image: yrPrcntl,
   description: 'modis_p90',
   assetId: 'users/lorenzomentaschi/modis_p90',
   scale: 926.6254330555, // this is the scale of modis
   region: bounds,
   maxPixels: 1e9})

If I launch the script the layer is correctly visualized in the GEE environment, and the export proceeds without errors, but when I try to load the exported asset it appears uniformly null.
If I try to export to a much smaller area (e.g., over the rectangle [0, 40, 15, 50], commented line in the script) the exported image looks correct.

The same thing happens if I use a similar python code.

Am I doing anything wrong?


texts: Is there a way to auto populate a Lat and Long field in a feature service in ArcGIS online. I have the newest version of collector and 10.4.1 ArcGIS. I'm pretty new to the online aspect of GIS so a walk-through would be very helpful.


texts: QGIS 2.4 print composer map extent does not sync with main window

texts: I'm using QGIS 2.4 and got some issues with the print composer. First thing is that the "update preview" button reloads the map, but does not change the view when I move to another place in the main window.


texts:
I'm trying to implement QgsGeometry.smooth() in my plugin as according to the API specifications.

API Link here

Here is my code:

def lineSmooth(self, line):
    ''' Takes a line geometry and applies smooth
    '''
    iterations = int(self.dlg.smoothIterations.value())
    offset = float(self.dlg.smoothOffset.value())
    minDist = float(self.dlg.smoothMinDist.value())
    maxAngle = float(self.dlg.smoothMaxAngle.value())

    return line.smooth(iterations, offset, minDist, maxAngle)

I am getting this error:

TypeError: QgsGeometry.smooth(int, float): too many arguments

When I print the parameter values I'm sending to the method:

(1, 0.25, -1.0, 180.0)

Now, I'm pretty new to Python and programming in general, and this is my first QGIS plugin, so I might be doing something silly.


texts: Duplicating layer in memory using pyqgis?

texts:
I have a layer in QGIS, and I want to duplicate it through a plugin so I can use the copy of it as I want, without modifying the original.

Of course layer2 = layer1 will not work, because everything that happens to layer2 will also happen to layer1, as it is the same object behind all this.

The only way I found to do it is as such :

QgsVectorFileWriter.writeAsVectorFormat(layer1,r"C:\Users\ABC\AppData\Local\Temp\NewLayer.shp","utf-8",None,"ESRI Shapefile")
layer2 = QgsVectorLayer("C:\Users\ABC\AppData\Local\Temp\NewLayer.shp","New vector","ogr")
#do something with layer2

Is there a simple way to duplicate the layer in memory, without having to write a new file ?


texts: Qgis 2.10 unable to add a new feature in spatialite via sql function "GeomFromText"

texts:
Using Python code in my plugin the function in sql language "GeomFromText(POINT(X Y))" gives the following error:
"OperationalError: no such function: GeomFromText"
Plugin functions in previous versions of QGIS.


texts: Calculating percentage of pixels in polygon with specific value using Google Earth Engine?

texts:
I have polygons over a dataset of tree cover pixels (Hansen 2013 dataset). I calculated the total number of pixels per polygon (X) as well as the number of pixels that show tree gain (Y). This works well.

I now want to see what percentage of total pixels in the polygon show tree gain (so: Y/X *100). But I am struggling to implement this in GEE. Hope someone can help...

Some code for polygon 44 (treemask is the gain dataset):

var pixels44 = treecover.reduceRegion({
  reducer: ee.Reducer.count(),
  geometry: ID44.geometry(),
  maxPixels: 1e12
  });

var gainpixels44 = treemask.reduceRegion({
  reducer: ee.Reducer.count(),
  geometry: ID44.geometry(),
  maxPixels: 1e12
  });


texts: Struggling to clip raster to vector in IDRISI. Windows do not overlap

texts: I am trying to clip my raster to my vector in IDRISI. When I try to convert the vector to raster using my blank, it says vector and raster windows do not overlap. How do I fix this. I know I should use reformat - window, but I don't know what min and max x and y values I should use.


texts: Does anyone know the easiest method to create a form in ArcMap 10.6 similar to that available in QGIS for collecting data on a particular feature? (Is it even possible in ArcMap?) My example is inputting data about a line which represents a section of a bank along an estuary. Each line segment might have 40 attributes about it. I would like to be able to allow a user to input field data into an ArcMap form. From what I've researched so far this function isn't as readily available in ArcMap compared to QGIS? Is that correct?


texts: trying to calculate volume using r.volume GRASS - error message

texts:
I am trying to calculate volume using GRASS plugin in Qgis using module r.volume however the attached error message keeps appearing.
Any ideas?


texts: Including geoidgrids when initializing projection via EPSG

texts:
It's not clear to me how you're intended to initialize a pyproj.Proj() object with both an EPSG code and geoidgrids.

For my specific use case with the grid file downloaded from here:

epsg = 3162  # NAD83(CSRS) / Ontario MNR Lambert
grid_path = CGG2013an83.gtx  # CGVD2013(CGG2013a) height --> NAD83(CSRS)

Using all keyword args works, but init=epsg:xxx triggers a deprecation warning:

proj = pyproj.Proj(init=f'EPSG:{epsg}', geoidgrids=grid_path)
>>>    FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method.
>>>      return _prepare_from_string(" ".join(pjargs))
proj.crs.is_vertical
>>> True

Using the suggested syntax appears to make it silently ignore geoidgrids (and in fact all other keyword arguments):

proj = pyproj.Proj(f'EPSG:{epsg}', geoidgrids=grid_path)
proj.crs.is_vertical
>>> False

I'm not seeing any relevant examples in the docs.

Using pyproj 2.4.2


texts: Extruding polygon "below" base height in ArcScene?

texts:
I am creating some animations and short movies in ArcScene showing how a number of disparate datasets relate to one another.  In one of these movies my "big finish" is to extrude a number of polygons "negatively".  In other words, I have a number of data layers stacked on one another in space (in some cases naturally as a function of z-coordinates, in some cases as a function of using a layer offset, and both where I need an exaggerated space between layers) and I want to show relationships between the different layers by using extrude to drop polygons on "upper level" layers to lower layers.

I can't get polygons to extrude below their base heights...  It seems weird to me as it's possible to drop layers below their base heights using negative numbers as layer offsets.  When I put negative numbers in the Extrusion Value Or Expression box in the Extrude tab in Layer Properties nothing happens.

Is there a specific expression I need to use?

Also, if negative extrusions are possible, I'd like to be able to cleanly clip the bottom of each extruded polygon to it's final intersecting surface.  In other words, when the intersecting surface has texture, my extruded polygons (when I've tried extrusion "going up") the entire extent of my tops either don't sit flush with the surface or go through to the other side.  I envision a "3D Extract by Mask" kind of thing.

I've seen a few non-ESRI tools that may do this stuff, but I'm limited to ArcGIS (in that I'd prefer not to have to learn a whole new software to deal with my other layers.


texts: Preventing ArcMap from Clipping Neatline when Exporting Map

texts:
I cannot seem to keep ArcMap from clipping off a fraction of an inch on the edges of the maps I am exporting:

I would like the 1.5 point border that is set for the legend to be uniform around the corner of the exported image.  I've tried setting my maps inside the margins a bit and I've experimented with using much larger margins and the 'Clip Output to Graphics Extent' option on the export dialog, all to no avail.
I know this must be an easy fix, I just can't quite get my head around it.  Can anyone point me in the right direction?


texts: I am using QGIS 3.4 and I want to change all my 0 values to NULL. How can I do that in the attribute table?


texts: Creating dynamically filtered layers using Tilestache/Mapnik?

texts:
I'm using Tilestache to generate two layers with the mapnik and mapnik grid providers, and it's working great!

However, I want users to be able to filter the data over many (more than ten) dimensions, and only show the features that match the user's filters. Creating a mapnik and mapnik grid layer for each of these dimensions--and each new one that comes up--seems like the wrong way to do this. And there are too many features to simply use GeoJSON.

Is there a way to do this filtering dynamically?

Intuitively, I'd like to pass parameters via GET request to Tilestache, which then passes the parameters along to the layers' providers, which tweak their queries.


texts: OpenLayers forEachLayerAtPixel doesn't get actual pixel color when the layer's opacity is not 1

texts:
I recently upgraded OL 4.x to 6.4.3 and got a problem with forEachLayerAtPixel. Previously forEachLayerAtPixel returned actual pixel color regardless of the layer's opacity though, it returns rendered color on the map instead of the pixel color when the opacity is 1.
Currently it's getting rgb of the faded color due to the opacity.
Is there any way that I can get actual pixel color regardless of the layer's opacity?
Here is my code;
map.forEachLayerAtPixel(
      evt.pixel,
      (layer, pixel) => {
        if (pixel) {
          layerRgb = { r: pixel[0], g: pixel[1], b: pixel[2] };
        } else {
          layerRgb = null;
        }
      },
      {
        layerFilter: function (layer) {
          return layer.get("name") === "county";
        }
      }
    );


texts: Layer from PostGIS view with dissolve slower than without in GeoServer

texts:
I created a view of a table containing line segments, where many lines may be part of the same project (and not necessarily adjacent) in PostgresSQL/PostGIS. The segments are joined to another table containing text attributes for that project.
I dissolved these lines in a 2nd view, so that all lines in a project would be one row, using st_union and group by (see below). Both  the source table and the view are published as layers in GeoServer. There are many less rows in this view that the original table (700 from 17,000).

The problem is, the dissolved view layer loads only marginally faster (in GeoServer preview and in the webapp), and when I click on this new layer (to see a popup with attribute info) in my webapp using OpenLayers 3, the popup response is much slower than the original table layer - that is, it takes several seconds for the popup to appear when clicking on the dissolve view layer, while it appears quickly when clicking on the original view layer.

Is my dissolved view created correctly?

dissolved view:

CREATE OR REPLACE VIEW projects_dissolve AS
  SELECT projects_geo.id,
  st_union(projects_geo.geom) AS singlegeom
FROM projects_geo
    LEFT JOIN projects ON projects_geo.id = projects.id
GROUP BY projects_geo.id,


texts:
I am attempting to use MCC-LiDAR to reclassify points (.las) originally classified using TIFFS. However, I seem to either be misunderstanding what the parameters really mean or where to get the information I need. Two parameters are needed. First, scale parameter which I have set to 0.75 since the point spacing (which is the same as post spacing?) is 0.75cm. Second, the threshold parameter which I have set to 0.5. Additionally, I set MCC-LiDAR to output an .asc grid at 1m resolution.

The environment is forested with a mixed canopy, in leaf off conditions and the ground environment is karstic. Can anyone recommend what I should input for the parameters? I'm really having a hard time understanding them.

Hillshade -- Azimuth: 135, Altitude: 15, dpi: 100


texts:
I want to use Geotools in Android Studio but get this error:

Could not resolve org.geotools

This is part of build.gradle

allprojects {
repositories {
    maven { url "http://repo.boundlessgeo.com/main" }
    maven { url "http://download.osgeo.org/webdav/geotools/" }
    google()
    jcenter()

  }
}

Geotools library

implementation group: 'org.geotools', name: 'gt-api', version: '20.3'

Can anyone help me?


texts:
The last weeks I ran into many problems with CRS in QGIS. The behaviour seems completely weird to me and it is hard to reproduce the problems / bugs. There is a chance of getting completely different results even if I follow the exact same steps. I use QGIS 3.14.0 but had similiar problems with QGIS 3.10.6 or 3.10.7 with PROJ 6.3.2 GDAL and OGR 3.0.4
But anyway, I give it a try:
I downloaded osm-data from quickosm plugin into my QGIS Project, which is a virtual layer in EPSG 4326. It is projected correctly in East Germany. The project CRS is 25832. I export the layer (save features as) into a geopackage layer and choose EPSG 25833 (not 25832) as coordinate system (zone 33 instead of zone 32). When I add the exported 25833 layer to my 25832 qgis project (or another project) the data is shown near the equator and not in East Germany where it should be. But when I export the virtual 4326 layer to EPSG 4326 or EPSG 25832 it is shown in the right place.

This is already strange, but when I change the project coordinate system from 25832 to 25833, the 4326 and 25833 layers are incorrectly projected near the equator. This time, the 25832 layer is correctly projected.


texts: How to insert google maps lat/lng into postgis in geometry datatype

texts:
I came across:
https://developers.google.com/maps/articles/phpsqlinfo_v3
I've changed the code a bit and all process is well done for postgis database. I get the data from infobox when user clicked.

..

 var map = new google.maps.Map(document.getElementById("map_canvas"), options);
      var html = "
" +
                 "
Name:	 <input type='text' id='name'/>
" +
                 "
Address:	 <input type='text' id='address'/>
" +
                 "
Type:	 <select id='type'>" +
                 "<option value='bar' SELECTED>bar</option>" +
                 "<option value='restaurant'>restaurant</option>" +
                 "</select>
" +
                 "
	<input type='button' value='Save & Close' onclick='saveData()'/>
";
    infowindow = new google.maps.InfoWindow({
     content: html
    });

I get the data from another php via url;

// Insert new row with user data
$query = sprintf("INSERT INTO markers " .
         " (id, name, address, lat, lng, type ) " .
         " VALUES (DEFAULT, '%s', '%s', '%s', '%s', '%s');",
         pg_escape_string($name),
         pg_escape_string($address),
         pg_escape_string($lat),
         pg_escape_string($lng),
         pg_escape_string($type));

$result = pg_query($query);

But the problem is i want to store google maps lat/lng not as float, but as geometry(propably point) data type  in a column. How should i change the code or philosophy ?


texts: Extracting values from rasters with different size in R

texts:
I have 10,000 raster files with different sizes. I need to extract values based on a list of points.

I have used the following using the raster pckg:

library(raster)
library(ncdf4)
library(data.table)

files <-list.files(path='/media/ambra/sea_levelss', pattern='*.grd', recursive=TRUE, full.names=TRUE)

st <- stack(files)
#Testing one file only:
ncfile <- brick('L1.grd', varname = "z")

pts= read.table("/Documents/ambra/sea_levelss/data/Ptos.xy",sep="\t",head=F)
extractedData <- extract(ncfile, pts, method = "bilinear")

 #Then for the 10k in loop:

for(i in seq_along(files)) {
extractedData = extract(raster(files[i]), pts, method="bilinear")
}

So far, the latter worked for one file, but not when I need to go through all 10k files. I tried with loop but I failed -no error but goes long and only stores 1 column.

Any ideas on how to create a fast solution to read these rasters?

And merging the 10k and merging those values to my pts files (that contains x,y coordinates).

I have checked for a solution to my problem. Similar problems are around but none has led me to my solution. E.g Extracting values from raster stack and aggregating results using R.


texts: Adding information tabs to Google Earth locations

texts:
I was wondering how is it possible to create something like the attached picture. It is a screenshot from Google Earth: as you can see, by clicking on a dot on the map, a tab pops up that contains some information. For instance, some links are available, as well as a short description, and an embedded Youtube video.
I am wondering if it is something that can be done within Google Maps/Earth, or if a third party tool is needed.


texts: QGIS 2.6.1 Brighton/ Grass pluggin r.stream.xxxx

texts:
I just updated my OSGeo4W and now have QGIS 2.6.1 and GRASS 6.4.4 and am trying to get strahler stream order.

I am figuring out GRASS 6.4.4 GUI by itself but GRASS is easier withing QGIS, however, I opened the GRASS GUI & used "FETCH" to obtain all the latest tools needed and I have found 'help' files that state people are using the r.stream.xxx tools through QGIS, however I cannot find them in the GRASS Tools modules list with in QGIS? I have not been able to use them. I have a process down that runs fast, but only up to the WATERSHED tool, I have not figured out how to get Strahler order from those outputs withing QGIS?


texts: batch filter (r.mfilter) raster time series, keep original file name

texts: I want to apply a filter (r.mfilter) to a raster time series while keeping the original filenames. For a similar problem when batch converting file formats in QGIS, I entered : - as file name when selecting save directory, and then "autofill with parameter values". This worked in another function, but not with batch processing in r.mfilter.


texts: ArcCatalog won't close/exit normally, toolbars disappear instead or it crashes

texts:
I've had this problem since v10.2 of ArcGIS Desktop, I recently upgraded to 10.3 and it still exists. The problem is that ArcCatalog cannot be closed normally. If I try to close it using the Windows close button (red X in Windows 7), instead of closing, all my toolbars disappear, including the menu toolbar. If I try to close it using File > Exit or by pressing Alt-F4, it crashes with the message:

  ArcGIS for Desktop has encountered a serious application error and is
  unable to continue.

On the bright side, at least that closes the program. This problem doesn't affect ArcMap.

So if I use the Close button in ArcCatalog, I go from this:

To this:

The only way to close the program at that point is to kill the process in Task Manager or crash it using Alt-F4. Has anyone else had this problem and solved it? The only info I could find about it online concerned an issue in ArcGIS that was fixed in v10.1 SP1.


texts:
I’m trying to crop a vector contour layer using the instructions given at http://lists.osgeo.org/pipermail/qgis-user/2012-February/015294.html . I created a polygon in a newly-created vector layer, outlining the area I want to keep. (My polygon layer has the same CLS as the contour layer I want to crop.) However, when I finish I get a shapefile with nothing left in it. All of the contour lines get cropped out, inside the polygon and outside of it.

Any idea what the problem might be?


texts: How to add "0" to multiple parts of text value in Field Calculator with Python

texts:
I have values in a text column that are as follows:

000_100

100_200

...

1000_1100

1100_1200

I want it to read:

0000_0100

0100_0200

...

1000_1100

1100_1200

I want all values to have the same number of characters, for example 9. The numbers in the hundreds separated by the "_" need a "0" infront for this to be accomplished. I saw that I can use zfill to add a "0" to the beginning, but is there a way to specify where to put a second "0"?


texts: Arc Collector offline map - Copies of a map layer not downloading correctly

texts:
I have an Arc Collector project on the go and everything is working great except for one part of the offline mode. I encountered an issue with the offline version of the map displaying the layers correctly.

The map contains an unfiltered layer of a dataset and it also has additional layers of the same dataset but they have been filtered to display only certain portions of that data.

When working with the map in Collector in online mode everything works great. You can make changes to the unfiltered and filtered layers and the changes display correctly in both.

In offline mode, the layers are downloaded and show up correctly in the layer selection screen. The problem is that all of the versions of the layer, filtered and unfiltered, do not display on the map properly and display randomly as one of the versions of the layer.

For example I have layers A,B, and C. A,B and C all show up in the layer selection list but they all display as C on the map.

I'm trying to avoid having separate files for each set of data in the filtered layers if possible.

Is there any way of having multiple layers referencing the same dataset display properly in offline mode?

Are there filtering options within Collector that I missed?


texts: Creating a rectangle using leaflet / turf.js

texts:
I have written some code which creates a rectangle at the position of the user's cursor. There does not seem to be any method to do this in turf.js itself. And of course using the latlong-based coordinates of leaflet, it becomes difficult to do so since it requires mixing geographic & projected coordinates.

But I still have to do this. Ignoring effects from extreme polar distortion (the map will not allow the user to zoom out far enough, nor allow them to pan to regions where these effects will become significant), this is the method I have come up with. In broad strokes:

Get the latlng of the cursor (via a mousemove event listener on the map).
Use the destination method to "throw" a point in all four cardinal directions to get points which represent the left, right, upper and lower limits.
Calculate a rectangle using the envelope method

Is there a simpler way of doing this? It seems like it is rather roundabout

This is the code. Obviously it could be made more compact but I have left it stretched out across multiple var declarations for the sake of readability.

var offsetX =  $("#rectangle-width-input").val()/2; // User input for rectangle width
var offsetY =  $("#rectangle-height-input").val()/2; // User input for rectable height

var topLimit = turf.destination(
    [ev.latlng.lng, ev.latlng.lat] // Mouse cursor location (in latlng),
    offsetY,
    0,
    {"units": "meters"})

var rightLimit = turf.destination(
    [ev.latlng.lng, ev.latlng.lat] // Mouse cursor location (in latlng),
    offsetX,
    90,
    {"units": "meters"})

var bottomLimit = turf.destination(
    [ev.latlng.lng, ev.latlng.lat] // Mouse cursor location (in latlng),
    offsetY,
    180,
    {"units": "meters"})

var leftLimit = turf.destination(
    [ev.latlng.lng, ev.latlng.lat] // Mouse cursor location (in latlng),
    offsetX,
    -90,
    {"units": "meters"})

mouseShape = turf.envelope(turf.featureCollection([ // Resultant rectangle
    topLimit,
    rightLimit,
    bottomLimit,
    leftLimit
]));


texts: Retrieving attribute's domain using ArcIMS ActiveX Connector?

texts:
I have an ArcIMS Image Service that's consuming data stored in an ArcSDE database (both v9.3.1).

Many of the layers have attribute columns that use coded value domains defined in the SDE database, and I'd like to be able to display the values defined in the domains.

Is it possible to retrieve the all values in the domain associated with an attribute column via an ArcXML request to the ActiveX connector?


texts: How precise is a volumetric calculation made with satellite stereo par imagery?

texts: If I had an stereo par from Worldview-2  or GeoEye-1, how precise would be the calculation of mine's materials in cm3?


texts: Write vector tiles in QGIS 3.16 (writevectortiles_xyz)

texts:
QGIS 3.16 offers a processing-tool writevectortiles_xyz
(My project contains a simple test-polygon-layer with just one feature, with default-style.)
I used following settings (extend from layer):

After running this tool, the directory was created as expected with xyz-subdirectories containing pbf-files. Exploring them by text-editor show, that they are not empty.
I established a new vector-tiles connection to the local directory "file://C:\DATEN\Temp\kacheln\test{z}{x}{y}.pbf" and used following settings:

and added the new vector-tile-layer.
Layer was added to layer-tree without problems. Marked it as "visible"
But no result is rendered in QGIS, the screen stays empty.
Tried several CRS (ESPG:28532 and ESPG:3857).
Zoomed to several zoom-levels/zoom to layer.
Used-default style-settings.
Sample-data/project from https://www.lutraconsulting.co.uk/blog/2020/06/10/vectortiles-part1/ worked without problems.
How can I create vector tiles from a QGIS-project and use the tiles in QGIS (or other apps).


texts: Hansen Global Forest Change - Forest Loss Year - Dates Clarification

texts:
I have scoured both the GFC website, research papers and Stack Exchange, but haven't been able to find a clear and reliable explanation of what the "Year of gross forest cover loss event" pixel values represent.

Using V1.6 as an example, if I download the "lossyear" dataset, I see values in the range of 0-18:
Assuming 0 equals no loss, does 18 equal a loss event between 1st January 2018 and 31st December 2018? Or does 18 equal a loss event between 1st January 2017 and 1st January 2018?

People I have spoken to regarding this have assumed that pixel value 18 equals a loss within the year of 2018, so 1st Jan 2018 to 31st Dec 2018. But looking at a chart from the paper has confused me.

According to this, I would expect loss between 2000 and 2001 to be value 1, so therefore in my dataset a pixel value of 18 would represent loss that occurred between 2017 and 2018.

Can anyone clarify this for me?


texts: Viewshed analysis plugin MemoryError in QGIS

texts:
I am very new to using GIS, and I am trying to do a viewshed analysis in QGIS 2.16.1.  I have tried two different methods, one using the plugin for Viewshed analysis and the other using the GRASS (r.viewshed) method

The steps I am following is:

Select new project Open raster (Ascii format for South
Africa)
Change the projection to EPSG 32734 (WGS 84 / UTM zone 34S) by clicking on the CRS button at the bottom right (OTF enabled)
Then I reproject the image.  I'm not sure if this is necessary as
well after I've changed the projection in the previous step, but I
figured a double reprojection won't harm if the two processes are
exactly the same.
Drop pin where observer is.  I do this using the
plugin Pin Point
Select Viewshed, fill in details (range 2000,
binary viewshed) and click ok
ERROR: MemoryError

Traceback (most recent call last):
  File "C:/Users/Andre/.qgis2/python/plugins\ViewshedAnalysis\viewshedanalysis.py", line 197, in run
    Algo)
  File "C:/Users/Andre/.qgis2/python/plugins\ViewshedAnalysis\doViewshed.py", line 409, in Viewshed
    mx_vis = numpy.zeros((full_window_size, full_window_size))
MemoryError

From many other comments and posts here it seems like the memory issue can be related to projections, but I've tried just about every combination and have still not been able to get it to work. While I see there are similar problems posted (with less details), I still have not been able to find a solution.  Is there a way to check the projections on all your layers (I only have 2), and are they all managed separately?


texts: QGIS/OGR shp to tab export - crashing Mapinfo due to number format issues

texts:
I created a vector grid in QGIS and it exports as SHP -no issues. When I save as tab and try to open the file in MapInfo it crashes.

According to https://groups.google.com/forum/#!topic/mapinfo-l/sO-wcp9bnuQ this is due to MI only allowing  (20,16) for the decimal where QGIS had it as (23,15).

When I copied the data to a new (20,16) column and deleted the (23,15) column and then saved as tab, it worked fine in MI.

Is there some option to choose so that this would happen automatically in the save as tab process?

PROCESS - QGIS-Vector-Research Tools--Make Grid (I did 10000 ... 10km). Then save-as Tab. This file crashes MI.

Looking at the details of the tab I see it is 23,15 for one of the columns. If I create a copy with 20,16 and then save the tab, it works fine in MI.

So here is the shp file that won't work when it's converted by QGIS Save-as but works when converted in FME or Global. It is autogenerated using the QGIS steps mentioned above.

https://drive.google.com/file/d/0BxjBqNsSHofKOFZJUVFiZGN0aHc/view?usp=sharing


texts: Calculate field based on other two added fields in ArcGIS Model Builder

texts:
I have a model in model builder where I add 2 fields, "field 1" and "field 2". For each field I calculate their values using the calculate field tools. Afterwards I add a third called "Field 3" of which the calculation is based on the calculations done in field 1 and field 2.

My questions is if it possible to add the third field directly from my feature class without first calculating field 1 and field 2. If I would calculate field 3 as shown in my picture below, I cannot refer to field 1 and field 2; not even if I use preconditions (without first running the first part of the model until adding field 3).

I realize that this would be possible if I add field 1, calculate field 1, add field 2, calculate field 2, add field 3, and then calculate field 3. In this case 'field 1'and 'field 2' will be shown in my field 3 calculation tool. The problem is that the model visually becomes a very long model that lacks overview (as I need need to do this for more fields before I calculate the last field).

Is there a way in ArcGIS Model Builder to calculate a field based on two other fields without that field 3 is directly linked to the two fields?


texts: How to print ActiveView to printer in ArcEngine 10

texts:
I am following a printing tutorial, but it's not working.

The tutorial is here:
http://edndoc.esri.com/arcobjects/9.2/NET/ViewCodePages/025b5da7-9b10-4623-a51e-c038c348ce29.PrintActiveViewCS_NetPrintActiveViewCS_Net.cs.htm

Maybe printing in ArcEngine 10 is different.  The initial problem is that the PageLayout is null.

//I tried this like in the sample
docPaper.Orientation = m_hookHelper.PageLayout.Page.Orientation;

//Then I tried passing in my own ActiveView obj and casting to PageLayout
 IPageLayout pageLayout = docActiveView as IPageLayout;

But in both cases they are null.

Does anyone have a good link for printing in ArcEngine 10?


texts: I have a slope dataset. I have a polygon shapefile with territory within the extent of the slope map.  I have to calculate the real surface area of this shapefile using the zonal statistics as table tool, which I have done and selected the Statistic Type "All" for results.  Having these results, how do I know what the raster cell in square meter if for this extent? (ArcInfo 10.1)


texts:
We're looking for an equivalent of "The National Waterway Network" dataset but for the entire world.  Essentially vector data of all non-ocean waterways including major rivers etc, that can be used for ships.  So this would exclude waterways like streams and drainages shown in typical hydro data.  Anyone aware of a source for this data either as a whole or a compilation of the sources for each specific country?

Ideally the worldwide data would have some sort of uniformity between countries.


texts: LAS file bounding box is oversized after using lasnoise?

texts:
I have a few .las files that I am trying to use further. They have some far away noise points that I removed using LAStools lasnoise. It seems like the noise points are removed, but the bounding box for the files stays as big as they were.

Lasnoise settings here:

I created a LAS dataset out of the files, and you can see the big bounding boxes compared to the point locations. How do I make the bounding box smaller for easier usage. Or should lasnoise automatically scale the bounding box and something is not working right?


texts: Make Graph (Data Management), Changing item names in legend

texts:
I'm having python produce a multi-series graph. How do you change the series name in the legend, the default being Vertical Bar, Vertical Bar1, Vertical Bar2....

arcpy.MakeGraph_management(graphTemplatePath,'''SERIES=bar:vertical DATA={0} X=ParkUnit Y=Coverage LABEL=ParkUnit SORT=ASC;
                                             SERIES=bar:vertical DATA={1} X=ParkUnit Y=Coverage;
                                             SERIES=bar:vertical DATA={2} X=ParkUnit Y=Coverage;
                                             SERIES=bar:vertical DATA={3} X=ParkUnit Y=Coverage;
                                             SERIES=bar:vertical DATA={4} X=ParkUnit Y=Coverage;
                                             GRAPH=general TITLE={5}, Total Coverage by Unit;
                                             LEGEND=general TITLE=Year Total Coverage;
                                             '''.format(scratchReport + str(year), scratchReport + str(year-1), scratchReport + str(year-2),
                                                        scratchReport + str(year-3), scratchReport + str(year-4), exoticPlant),"graphTemp")


texts:
I try to install MapServer on Ubuntu by follow this tutorial. I was installed libraries and apach. But have a problem with last command:

libtool: install: /usr/bin/install -c /home/user/mapserver /usr/local/bin/mapserv

I have libtool library in system. But its says that directory /home/user/mapserver not exist. When i try:

    libtool install /usr/bin/install -c /home/user/mapserver /usr/local/bin/mapserv

I get:

/usr/bin/install: omitting directory '/home/user/mapserver'

Whats wrong?
PS: first time see Linux OS.


texts:
I have two geocoded aerials from the Las Vegas valley from different years. The newer aerial has an area missing from the Northwest part of town. The older aerial has the missing area I need.

My question is, Is there a way to tile the new and old aerials and fill in the missing area from the older one and combine the two into one composite that I can export from QGIS? If not is there free software that would tile the two and output a composite geocoded aerial?


texts: Way to find minimum value from a group of values - QGIS?

texts:
I'm wondering if there is a way to find the minimum value of a group within QGIS? Basically I need to find the minimum distance of each unique value in a table of about 5000 records.

I can do the analysis in excel using vlookups, etc, but wondering if there is a method in QGIS that will allow me to miss out the excel stage and avoid joining tables. I can't figure out what I need in the field calculator.

I need to find the minimum value for each TOID and remove anything that is not the minimum. Hope that clarifies.


texts: Grouping points by location in ArcGIS Desktop?

texts:
I am using ArcGIS Desktop.

I have surveyed points (sections). There will be 200 sections, each section 20-30 points. I want to create polylines (sections) out of the points. In order to do so, they have to be in right sequences (ordered from right to left or so) so program (ie. ETWizzard) would know how to connect the dots. Points in sections do have random IDs.

I want to write script, where logic is: assign points from .shp for each section to specific group (ie. S1, S2...). Then try to give names (sort) to points in section based on x,y.

Preferably, I want to do this in Python. I guess the most important question at this stage is: Is there a tool to select and group points based on the location/proximity or any one would hear about any similar solution? There has to be one, since sections are quite commonly used.

Any thoughts?


texts:
I'm trying to make a buffer around each polygon in my data. At some point I get:

  Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_lower_td, unaryUnion_if_byid_false,  :    TopologyException:
  Input geom 1 is invalid: Ring Self-intersection at or near point

I tried to repair the shapefile with

land1 <- gBuffer(land1, byid=TRUE, width=0)

but didn't work.

How can I find the polygons that are problematic?
I tried which(!gIsValid(land1, byid=TRUE)) but didn't get the right answer.


texts: Web Map not defaulting to original extent

texts:
I built a webmap in ArcGIS Online using the ArcGIS Web AppBuilder and deployed it to my organizations web server, here.

Everything seems to be working except for one thing. If I refresh the map or go browse somewhere else on the internet and come back to the web map URL is doesn't default, or reset, the initial extent of the web map (which was configured to in the webappbuilder on arcgis online). the map remains focused wherever I left off even after a refresh or clearing of the browsers cache.

How can I fix this?


texts: How to select the highest points in overlapping point features?

texts:
I have a point featureclass with multiple overlapping features. The figure shows two sets of overlapping points--the first set of 2 has values 4 and 6 and the second set of three has values 5, 6, and 7.

How can I select the point with the highest value in each set of overlapping points? I am using ArcGIS and arcpy with the basic license.


texts:
I've put a 20m buffer on all of my points (144,000 observations), dissolving all overlapping buffers.

How do I then take the centroid of the dissolved buffers in QGIS?

I want to reduce all overlapping areas to one point.


texts: QGIS split all polygon features by dimensions

texts:
I have a shapefile of 16370 polygon features (see below). I want to split all features in features with a maximum size of 25x25 meters (still including all attributes).
I am aware ArcGIS Pro is currently having such an option (https://pro.arcgis.com/en/pro-app/latest/help/editing/divide-a-polygon-by-a-value.htm), but I have no access to the program. Does anyone have an idea to achieve something similar?


texts: QGIS select by location doesn't use selected features only

texts:
I'm using QGIS 2.14.3 - Essen (but have also tried 2.18.12 Las Palmas)

Using 2.14.3, if I select one feature in a vector layer, and then use [Vector][Research][Select by Location], I have the option to check the 'Only selected features' option (this feature is not available in 2.18.12). The analysis behaves as one would expect if only the selected feature is used.

In newer releases, the dialogue box doesn't have an option to only analyse selected features and the outcome is different to case 1 above (in that all features in the layer are processed, irrespective of how many may be selected)

I can see that in [Processing][Options][General], there is an option to 'only use selected features' but it appears to me that this is not used - irrespective of whether this box is checked or unchecked, the select by location algorithm uses all features, not selected features.


texts: Adding legend to canvas in standalone PyQGIS application?

texts:
I am trying to develop a standalone PyQGIS application.

The map display does not pose any problems, but I do not know how to add a legend to the canvas.


texts: Zonal statistics 2 ends up causing a fatal error. Is there an alternative?

texts: I have recently switched to using the "zonal statistics as table- 2" supplemental tool instead of the regular "zonal statistics" because I have overlapping polygons which zonal statistics does not deal with. However, I have attempted running zonal statistics 2 a couple of times now and after running for many hours through the night it ends up encountering a fatal error and will not finish. I am not sure how to ameliorate this issue. I am trying to calculate mean elevation within over 100,000 buffer polygons, and will need to do this multiple times with other raster layers. Is there an alternative or a way to get the tool to complete the command?


texts: How to get appropriate CRS for a position specified in lat/lon coordinates?

texts:
I have a set of city networks whose coordinates are specified in lat/lons. I wish to run an algorithm on each network that treats them as a planar graph. I'm using python and can use pyproj to project the network appropriately, the problem is that I don't know the appropriate CRS for each city, e.g., for my test case, Harare, I define the variable:
 zimbabwe_reference='epsg:20935'.

What I'd like to do is call a function like crs=getCRS(lat, lon) and get the relevant string to pass on to pyproj.


texts: Create Raster based on extent of shapefile and with resolution of another raster

texts:
I have a shapefile in R.

Simple feature collection with 1 feature and 1 field
geometry type:  POLYGON
dimension:      XY
bbox:           xmin: 11.59136 ymin: 50.91873 xmax: 11.65639 ymax: 50.94862
geographic CRS: WGS 84
  id                       geometry
1 NA POLYGON ((11.59136 50.94859..

I want to create a raster of the same extent as the shapegile and with a resolution based on the resolution of another raster, namely this one (dem):

class      : RasterLayer
dimensions : 8067, 9767, 78790389  (nrow, ncol, ncell)
resolution : 20, 20  (x, y)
extent     : 561762, 757102, 5562496, 5723836  (xmin, xmax, ymin, ymax)
crs        : +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
source     : /geodata/dem.tif
names      : DEM

What is the best way to achieve this?

I tried

ras = raster(shp, res = res(dem))

but this apparently not the best option...


texts:
I have uninstalled and re-installed QGIS on my 64-bit Windows 10 Pro work computer.  I added the program into environmental variables and tried running it.  I received the following error message:

Could the issue be because I don't have rights to install as a user?

The files folder looks like this:


texts: QGIS - Use polygon orientation to rotate texture inside polygon

texts:
I'm trying to fill entities (polygons from 3 to x points) with a texture that I want to align with the 'general' orientation of each polygon, ie, I need a formula to assign to the Rotate field of the polygon style (red circle on the image).

I guess the function would have to determine global polygon orientation by reducing the polygon to its box and calculate the ration height/length.

Unfortunately, I'm not skilled enough with programming.
How would you do that?


texts: Filtering on point geometry not working on feature collection of Google Earth Engine

texts:
I have a feature collection with point geometries and a few properties, which I have displayed on the map. On clicking at a point on the map, I try to obtain the corresponding feature by a filter:
fc.filter(ee.Filter.bounds(point,20000))

This filter has zero elements while I have confirmed that there is a feature with the exact point I am clicking at.
What am I doing wrong here?


texts: How to export a unique ID field of a geopackage

texts: When I am converting my geopackage file in shapefile, the unique ID field is not exported. I could duplicate it before exportation, but I wanted to know if it could be done in one step, in order not to modify my geopackage. I am using ogr2ogr to make the conversion.


texts: Update ArcGIS Online map from ArcGIS Pro

texts:
I know I can create a map using hosted features from my ArcGIS Online account, and eventually publish it as a web map. But what I can't find is how to open one of these existing maps (this step is easy), make modifications to it, and then save it back to Online.

Is it possible?


texts:
I'm working on a project to highlight LiDAR terrain on the web and part of the idea is to show the detail of the data at large scales. I've already read through the excellent Mapbox guide and I've got the process of mixing color shading, hill shading and slope shading together down.

The problem is the certain areas of our county have vastly different terrain and the color ramp that works for the county as a whole doesn't work very well when zoomed in.

For example here is the county as a whole:

Zooming into the red box which is part of the Illinois Beach State Park, you can see how little detail is shown:

But if we tweak the ramp for this particular area you can see a great amount of detail:

I already have a Flask backend using mapnik to dynamically stretch the color ramp for a given area and return it to the client but it seems like I should be able to do some sort of localized stretch and generate static tiles which would be much easier to maintain.

I've tried a few things but I keep coming up with hotspots or blown out areas, does anybody have experience or maybe some ideas I could try?


texts: how can interior basins be modified in the r.watershed GRASS function?

texts:
This is a follow up question to

How does "Minimum Size of Exterior Watershed Basin" work in r.watershed command in qgis 2.18.12?

I understood that the threshold parameter is used to define the exterior basins, but how can i modify the interior basins using the r.watershed function in GRASS?

There seems not to be any parameter that can be adjusted for this (max_slope_length) seems to be used only for the length_slope output, but i just want the basin delineation.

Does anyone has any idea?


texts:
I currently use an excellent set of printed topographic route maps for mountain biking. I would like to scan the maps, georeference them, and upload the maps to a handheld GPS device.

Does the etrex series (10, 20, 30) support raster maps? Can I georeference the JPEG image using open source software?


texts: Converting linear unit to string for adding to file name in ModelBuilder?

texts:
In ModelBuilder I have a 'search distance' parameter that is a linear unit data type that I am trying to convert to a string so that it can be added to the end of a file's name so the user knows what the selection parameters were for future reference.

I have the file output name set up with in line variables that successfully pass the string parameters along , but not this linear unit type. I also have a calculate values tool that will find and replace the spaces the linear unit outputs. I've tried a simple str(search distance) conversion, but I haven't tried passing the first few characters yet into another variable.


texts: ESRI JS API 3.3- setExtent, when called twice, same code, different behavior, jumps

texts:
Our map has a toolbar 'home' button with code that grabs extent values from a config file, creates an Extent object from those values, and passes the Extent object to the map's setExtent function. We also call this same code when the map is initialized, by calling the click function for the button. So if we load the map, then click the home button, the map image shifts about 30 or 40 pixels upward. Makes no sense, we are calling the exact same code twice in a row, with the exact same input.

Toolbar.prototype.OnFullExtentClick = function () {
    var viewModel = registry.get('viewmodel');
    var initial = config.Map.InitialExtent;
    var extent = new esri.geometry.Extent(initial);
    viewModel.Map.setExtent(extent);
 };

We call it once via code in the Init function:

ViewModel.Toolbar.OnFullExtentClick();

And we execute it again when home button is clicked, via Knockout.js as below

+

-

It doesn't seem to matter what values we set for the extent, the "jump" is always the same distance and direction (30 to 40 pixels upwards). My question(s): What are we doing wrong? How can we get it to stop doing this?

-- EDIT --
This problem is specific to IE, does not do this in Chrome. Also, still does it when the setExtent code is replaced by centerAndZoom.

Toolbar.prototype.OnFullExtentClick = function () {
    var viewModel = registry.get('viewmodel');
    var center = new esri.geometry.Point(717714, 972786, new esri.SpatialReference({ wkid: 2223 }));
    viewModel.Map.centerAndZoom(center, 1);
 };


texts: FME Data migration for Feature class with Attachments

texts:
I want to migrate data from one point feature class to another point feature class in same Database schema using FME job.  I can easily do this task without using any transformers.
But now both point feature classes (reader and writer) has attachment tables. Attachment table has created by using arc catalog. The feature class and its attachment table have some relations.
Can anyone please let me know how i can migrate data for attachment tables while I do data migration between feature classes?


texts: Extracting a single value to a new raster from a singleband pseudocolor raster image

texts:
I have a large raster image depicting land use. It's a singleband pseudocolor image whose values are contained in a text file. There are 5 classes.

Following the example of this question I thought I could just use the Raster Calculator tool like this (where 1 is the desired class):

filename@1 = 1

Unfortunately, whenever I do this, QGIS just returns a raster with only missing values. Any idea what I'm doing wrong?

EDIT:

Here is what my color ramp looks like, as well as the raster once the colors are applied:

Let's say I want to extract all the dark blue pixels containing water values. These have a value of 4, but they are within Band 1. I wonder if this is where I'm having trouble.

Here's the Raster Calculator operation I'm performing.

But instead of receiving a raster with the dark blue areas, all I get is a raster covering the entire area with missing values.


texts: Using ArcMap API to find coordinates of points in shapefile?

texts:
I need to find some reference or even C#.Net example code of how to use the ArcMap 10.2 programmers API.  I have got a CSV file with X, Y and elevation coordinates of soil samples and I want to write an extension to import the point data and save it as a shapefile in a project.

I have been through the current API documentation and I am a bit lost.


texts: Arcpy problems regarding convertToMSD() Function

texts:
I am having trouble getting the ConvertToMSD Function to work. Technically it works, but not in the long run of my script.

I use the converttomsd function to create an msd. I then publish this msd as a web service. However, the webservice does not show the map. But.. I can save the mxd to an msd in ArcMap, and then publish from my python script and it works. So the snag seems to be the converttomsd function,

I originally thought it was the publishmsdtoserver function, but I was wrong. Any ideas..... I can provide my code if necessary.


texts: Implementing version control system for geospatial data?

texts:
Not that I am in any immediate need of a right answer here, but I've lately seen some efforts to introduce the concept of "(distributed) version control systems" for geographic data. Some examples (that I know of) are the three whitepapers from OpenGeo (1, 2 & 3) and the "Geosynkronisering (geosyncronization)" project by Norwegian GIS Software vendors and the Norwegian Mapping Agency. I've also found Distributed versioning of geospatial data?, which mentions GeoGit (by OpenGeo), and Applying version control to ArcGIS ModelBuilder models? about version control in ArcGIS.

Being a developer I know (at least enough to be able to use them) how version control systems for source code (like SVN and Git) works, and my background in geomatics tells me that there are some unique challenges with geographical data that makes the approach not completely similar to the way source code (which is basically text) are handled.

What are the challenges when dealing with (d)VCS'es for geographical data, how would you solve them, do we need them and are there other attempts to solve these issues than the ones I have mentioned?

I know that the OpenGeo whitepapers will answer some of my questions, but what I'm really is after is a more "pedagogical" answer, in the style of "tell me like I'm a 10-year-old", so that I can refer people to a great explanation of the challenges and solutions that geographical data brings to the mix.

I hope that someone with some insight will take time to provide some thoughts on the matter, as I said I'm not currently looking to solve a particular problem, but this topic is one that interests me.


texts: Create raster in QGIS using categorical attribute

texts:
I have been trying to create a grid, or raster, from point data which has a variety of classes (ie, I am trying to grid a categorical attribute).

Strangely (to me) using Interpolate (SAGA, cubic spline) creates a continuous numerical variable when I use my categorical attribute (no idea how it is converting a string to a float).

'Multilevel b-spline interpolation for categories' (SAGA) seems like the function I want, but it produces an error (Unknown option: SHAPES).

What would be a good way to produce what I want?


texts: How to change rule-based Layer Styles all at once in QGIS?

texts:
Let's say I have a layer with buildings which is only shown when the scale is higher than 1:10000. When the scale is higher than 5000, I want them to show its function color (retail, residential, ...) and otherwise remain grey.
I found the option to do that in Layer-Properties > Style > rule-based, either by typing in the scale in the Min. scale column or by multiselecting the attributes and then clicking Refine current rules where I can enter a scale value.

Is there no other possibility to change the scale or appearance of the selected lines than going through them one-by-one?


texts: Calculate print extent in arcgis from screen extent?

texts:
I am printing with preserveScale set to false as I need the extent on paper to match what is displayed on screen as closely as possible. Unfortunately the print server does need to fill the paper and takes some liberties here.

So basically I'm currently fighting with ARCGis on trying to calculate what the extent would be that is printed, depending on what is displayed on the screen.
Obviously the aspect ratio of the screens is different as opposed to the one from the print.

Anyone can point my in the right direction?