texts: Update sde.st_geometry M values to cumulative distance (geometric length)

texts:
I'm trying to write a query to update sde.st_geometry M values to the cumulative length of a line.

The M values in my route feature class are purely based on the geometric length of the line. The lines/routes have not been calibrated or anchored using referents.

Here's what I've tried:

I've successfully made a query that almost does this. It replaces the shape column with a new shape. The new shape is a copy of the existing shape, except the start point M value has been set to 0, and the end point M value has been set to the geometric length of the line.

UPDATE OWNER1.ROAD_ROUTE_EVW

SET SHAPE=
     --CONSTRUCT A WKT LINE: 'LINESTRING M ( X Y M, X Y M )', SRID
     SDE.ST_GEOMFROMTEXT('LINESTRING M('
     || sde.st_x(sde.st_pointn(SHAPE,1))
     || ' '
     || sde.st_y(sde.st_pointn(SHAPE,1))
     || ' 0, '
     || sde.st_x(sde.st_pointn(SHAPE,2))
     || ' '
     || sde.st_y(sde.st_pointn(SHAPE,2))
     || ' '
     || SDE.ST_LENGTH(SHAPE)
     || ')', SDE.ST_SRID(SHAPE))

The catch is that this only works for lines with  two vertices (start point and end point). But, of course, my lines(roads) have more than two vertices (the number of vertices varies). So the SQL above is useless.

Ideas

What I think needs to happen is that I would somehow need to loop through each vertex, using the st_pointn index position, and set the M to the cumulative length of the line. I don't believe there is a way to do this with sde.st_geometry functions (the sde.ST_NumPoints function might be of use though).


texts: Is it possible to name polygons in ArcMap attribute table using my native language?

texts: now I am using ArcMap 10 to modify a land use map and i also would like to use my own native language to name those edited polygons instead of using English one because some users cannot read English. If anyone knows how to do that please help.


texts: I would like to sum the total area of my attribute table to reflect in the print setup

texts: I have the following attribute table and I wish to show the total area in hectares seperate to my attribute table on the print setup. I currently have to add these values manually. Is there a way to get QGIS to calculate this automatically?


texts: Calculating NDVI using Landsat ETM+ band values

texts:
I have sample points (shape file converted from a .xls file which contains XY coordinates,nnx,nny and canopy density) and a landsat etm+ image. First I applied 'SpatialAnalyst Tools>Extraction >Sample' in ArcGIS in order to extracted spectral signatures of all sample points from Landsat image. I then exported output to a DBF file and opened it in Excel. The DBF file has XY coordinates of sample points and NP_2001102,NP_2_30513,NP_2_30514,NP_2_30515,NP_2_30516 and NP_2_30517. I assume e.g. NP_2_30513 is band 3 and NP_2_30514 is band 4.

So the question is: 1), are they really band 3 and band 4? 2), if they are, and if I want to calculate NDVI values and then do linear regression between canopy density and NDVI in Excel, what should I do to get correct reflectance values before the calculation?

Examples of values of NP_2_30513 are 11, 9, 13, 8...etc., examples of values of NP_2_30514 are 10, 7, 7, 4, ...etc.

I know these values are not really reflectance values, but how can I get the correct values for my calculation and regression?


texts: Returning end of string up to certain character using Python Parser of ArcGIS Field Calculator?

texts:
I am trying to accomplish this task:
https://stackoverflow.com/questions/15851568/how-to-get-the-last-part-of-a-string-before-a-certain-character
within the Field Calculator.

I have the below but cannot get it to run.

What am I missing?


texts: Create virtual lines in QGIS with Python

texts:
Due to our requirement, the default "Add Feature" will not work for us.
So we decided to create a new GUI which validates and does some calculation before changing a layer. This GUI holds the information in a list and based on some conditions decides which layer/layers to edit.

My add-feature tool needs to be similar to the default one, with default add-feature as soon as you click it starts drawing an arbitrary line on the canvas.
Similar to the following picture.

How can I represent the information on the QGIS map canvas without adding any new layer?

In short, I want to draw lines/polygons on map canvas. These lines and polygons are totally virtual and after execution of GUI will be removed. Is there a function/class which does this?


texts: Convert GeoTIFF coordinate system without losing quality?

texts:
When converting a GeoTIFF from EPSG:3794 to EPSG:4326 using QGIS I am noticing a major loss in overall quality, especially with straight lines such as roads, parking marks, etc. The original is 4500 columns x 6000 rows and when converting I am given the automatic option to convert it to 4686 columns x 5974 rows (I'm not an expert, but I'm guessing this has something to do with the offset). If I override this and set the output as 9000x12000, the quality remains unchained, but the size jumps ups from 100 to 400 MB.

Before:

After:

Secondly, is there an easy way to save the GeoTIFF with a JPG compression in QGIS? I'm able to to it in Global Mapper, but I would like to use one program for my conversions (I'm jet to figure out how to re-project GeoTiff/Shapefiles in Global Mapper).


texts:
I'm writing an add-in for Arcmap and at the end of it I am left with multiple layers from buffers, joins, and selections. I am trying to delete these layers before the add-in finishes so to keep the number of layers in TOC to a minimum. Below is the piece of code I am using to delete the layers, and the error it rasies.

f = ['Select_1', 'Join_1', 'Buff_1']
for x in f:
    arcpy.Delete_management(x)

Error:

Runtime error  Traceback (most recent call last):   File "", line 2, in    File "c:\program files (x86)\arcgis\desktop10.7\arcpy\arcpy\management.py", line 4359, in Delete     raise e ExecuteError: ERROR 000622: Failed to execute (Delete). Parameters are not valid. ERROR 000628: Cannot set input into parameter in_data.


texts: Do PNG files suffer performance for scaled read over ERDAS Imagine (.img) files?

texts:
So I have a 20 GB in size Raster Image in .img format.  Though I will be examining the code, to find out why, I am AMAZED at how quickly QGIS renders the entire file in a scaled format, and prior to writing code I was wondering if anyone knows what other format that offers actual compression (this .img file I am using has an .ige component the docs say immediately turns off compression) but also has that pick and choose functionality I believe QGIS is using.
I believe based on what I'm seeing that the file is going to be heavily indexed inside, which allows the file pointer to skip around ALOT, whereas a PNG file is likely to be compressed row by row and this would probably require a person to decompress and load pretty much all the data to then scale the image and render it.
I don't want to give up the performance I am seeing in QGIS, but I'm uncertain how to proceed.
Does anyone know a better more compressed format that offers the same kind of fast scaling functionality?
Edit
https://pastebin.com/bvbEcVtd
Here are the results of my tests on the Tree Canopy raster.
This actually does create some precedent for finishing my next test, the access test. Assuming the good good people who are slowly ending our world don't cut time to finish the smallest thing short.
The somewhat scary thing is the difference between memory copy from GDAL in squares of 512 (which is native in this raster) to a Bitmap vs the time it takes to compress and save the PNG.
I will add access speed statistics as well.


texts: Get coordinates of all pixels in a raster with rasterio

texts:
I have a n by m raster image in rasterio and I would like to get the ground coordinates of all the pixels in this raster (ideally in an array of tuples). What would be an efficient way to do this?
This is what I have so far which is not efficient at all
file_name = 'sample.tif'
image = rasterio.open(file_name)
height, width = image.height, image.width
X_coord = np.zeros((image.height, image.width))
Y_coord = np.zeros((image.height, image.width))
for row in range(height):
    for col in range(width):
        X_coord[row,col] = image.xy(row, col)[0]
        Y_coord[row,col] = image.xy(row, col)[1]

This piece of code loop through rows and columns in the image and uses the .xy(row, col) method to store x and y coordinates separately in two arrays. obviously, time-consuming and inefficient.


texts: How to use gridfiles (*.gsb) in QGIS 3.10.0-2

texts:
It seems that the solution previously given does not work anymore:

How to use gridfiles (*.gsb) in QGIS

Does someone know how to add new transformations in using gridfiles *.gsb in QGIS 3.10?


texts: Storing polygons in PostGIS (data coming from shapefiles)

texts:
We want to store data from shape files in PostGIS all in one table.

There will be two columns in the table:

boundary - The polygon data (How do we store this?)
mongo_id - Links to a mongo database

It seems if we use shp2postgis it creates a whole set of tables for that shapefile. We want to use one table for all boundary data.

What is the best way to do this? (Do we need to use a specific srid?)


texts: arcpy.da.ListSubtypes returns empty IOError on 64bit

texts:
I'm trying to use “ListSubtypes” function in ArcGIS Python.

It works on 32bit environment (f.e. -
Desktop), but it does not work in 64bit (f.e. - Server) and returns IOError without any information – f.e.: “IOError(u'sde_pipe.SCHEMA.feature',)”.

I am using arcpy.CreateDatabaseConnection_management to make connection and setting it with arcpy.env.workspace.

Code snippet:

walk = arcpy.da.Walk(datatype="FeatureClass")
                for root, feature_datasets, feature_classes in walk:
                    for feature_class in feature_classes:
                        try:
                            subtypes = da.ListSubtypes(os.path.join(root, feature_class))
                        except:
                            arcpy.AddWarning("Unexpected {} error:{}".format(feature_class, sys.exc_info()[0]))


texts: ESRI Geoprocessing service and other servers

texts:
I am new to ESRI GeoProcessing (GP) services so please excuse the naive question.  I have an FLEX application running off of ArcGIS Server.  I need to push data from the ArcGIS Server to an analytic server that calculates all sorts of interesting metrics using R that I cannot do within ArcGIS.

So my question is this:  Can a GP accept user inputs (e.g. run on these 5 points) and then push a foreign key to another server for further processing ?  The other server would do its magic and then send the results (and foreign key) back to ArcGIS server which displays to the user.

Can someone point me to some resources on the web I can read up on this ?


texts: Unable to delete 3rd vertex of a polygon | OpenLayers6

texts:
When polygon has 3 vertices left I am unable to delete any of those vertices:

var modifyInteraction = new ol.interaction.Modify({
   features: selectCtrl.getFeatures(),
   deleteCondition: function(event) {
       return keys['46']; // 46 = delete key
   }
});


texts:
I'm trying to create convex hull for about 25000 points stored in the table.
ST_ConvexHull run successfully, but resulting geometry does not covers some points.

What could be a reason?

And it is not problem of points falling exactly on boundary. The example shows the problem in GIS viewer for two specific points quite far away from the hull.

select ST_ConvexHull(ST_Collect(ARRAY(select st_setsrid(point(stop_lon,stop_lat)::geometry, 4326)
                                      from gtfs_stops
                                     )
                                )
                     )
union
select st_setsrid(point(stop_lon,stop_lat)::geometry, 4326)
from gtfs_stops
where stop_code in ('10798', '10498')


texts: Standard deviation for percentiles interval in Google Earth Engine

texts:
I'm working on a GEE script aiming to extract DEM-based elevation statistics for regions defined by polygons. Specifically, I want to obtain the mean, median, standard deviation, and min/max values of the lowest 10% in the elevation ranges of different regions defined by polygons. The mean is easy since GEE has a reducer just for this purpose; the following works fine:

// Calculate median of lowest 10% elevation of polygon region
var lowest10PercentMeanDict = alos_DEM.reduceRegion({
    reducer: ee.Reducer.intervalMean(0, 10),
    geometry: regionPolygon.geometry(),
    scale: 30
})

A similar approach should be possible to obtain median and min/max with the 'percentiles' reducer.

However, I could not figure out yet how obtain the standard deviation for the percentile ranges calculated by the two reducers.

Is it possible to retrieve the data collected by 'intervalMean' and 'percentiles' to use it as input for further processing steps? Or is there a workaround using e.g. 'histogram'? Finally, it would be really cool if it was possible to apply the 'combine' reducer with 'sharedInputs' activated to calculate all relevant statistics for the percentile interval in one step.


texts:
When I import shapefile layers their encoding is System while the data is in UTF-8. How to change the default encoding to UTF-8?
This question answer here "
Is it possible to change default encoding for QGIS?
" is no longer valid since in QGIS 3.12.3 there is no longer such option available in Data Sources.
Has it just been moved to another place (where?) or is there any workaround?


texts: OpenStreetMap (OSM) data is misregistered upon download, in just one area?

texts:
I have a satellite image over the area of Forez, France.

I checked that the landmarks on the corner points coincide with the landmarks of Google Maps at the same coordinates, so the image is not misregistered itself.

I download OpenStreetMap (OSM) data (I tried from OSM site, including a mirror, and with QGIS but the problem persists).

The data is misregistered in a range of 100-300 meters in a non constant way, so I cannot correct it globally. This is the case when I download the image but if I browse, for instance, the mapbox.com map while overlaying it to the satellite image there, I can see it is correct in that case.

It looks that I am getting wrong data for this area when I download it. I checked the same procedure on several other cities and it works as expected.

I was thinking that maybe the points are expressed in another crs, but OSM data is supposed to use WG84 in every case.

Do you have any clues about what could be going on?


texts: Finding cloud cover score of Landsat image?

texts:
I want to find cloud cover of an image
This is my code:

var image = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
    .filterBounds(district)
    .filterDate('2015-03-01','2015-05-01')
    .sort('CLOUD_COVER')
    .map(maskClouds)
    .median();

I tried this code:

var getCloudScores = function(image)
{
    //Get the cloud cover
    var value = ee.Image(image).get('CLOUD_COVER');
    return ee.Feature(null, {'score': value})
};

var results = landsat.map(getCloudScores);

print(Chart.feature.byFeature(results));

It is giving me error:

  landsat is not defined in this scope.

How do I calculate cloud cover and which variable I should use in place of landsat?


texts: How do I fill in serial letters (AA, AB,AC...,BA,BB,BC...ZZ) to a shape?

texts:
(I am using ArcGIS software, ArcMap...)

MY PROBLEM
I have a shape file containing points. The shape file contains 3 columns named FID, Shape* and Label. In the column  I want to fill in AA, AB, AC..., BA, BB, BC...ZZ. Since this is over 600 points (and I have 19 of these shape files), I do not want to do this manually. How do I proceed to fill this in automatically? Preferably by using field calculator.

I would prefer to be able to:

Select say 100 of the points
Use field calculator to name them AA-DX
Make new selection of 100 (or some other count)
Continue naming them from where I left off. So DY-HT
Make new selection of 100 ..... and so on...

TRIED SO FAR
What I already have tried is to create a table in excel with a label column and AA, AB, and so on already filled in. And with a FID column filled in with 0, 1, 2, 3... Then I imported that table to ArcMap and joined the shape file to the new table based on the two FID columns. Unfortunately there is no system to the shape files FID column up against what I want them to be named. So what happens when I join is that I have FID 1 = AA, 2 = AB and so on. Whilst what I really want is FID 74 = AA, 35 = AB, and so on in almost a random number.

The excel code I used to generate AA, AB, AC and so on was:
=IF(RIGHT(A1)="Z",CHAR(CODE(LEFT(A1))+1),LEFT(A1))&IF(RIGHT(A1)<>"Z",CHAR(CODE(RIGHT(A1))+1),CHAR(65))
I wrote AA in the first cell, and then this code in all underlying cells

EXAMPLE
To give you a better picture of the problem:
I have several points divided on 3 islands. The points were created randomly, so point 1-250 are not all on the same island, and then 251-500 are not on the next same island. The points are just randomly scattered on the three islands. I want to select all points on island 1 and name them AA-DY (or whatever). Then selecting all points on the next island and naming them from DY and on to TG (or whatever). And then continuing on the next Island.
Within the one island it does not matter what point becomes AA or what point becomes BR. if that follows FID it is ok but it does not really matter (so if point 2, 6, 12 and 34 were the only islands on the first island. point 2 would be AA, point 6 would be AB, 12 = AC and 34 = AD)

Anybody who can solve my problem?


texts: Joining ArcGIS table with feature class many-to-one to create new feature class?

texts:
I am using ArcGIS Desktop 10.2.2.

I have a file geodatabase with two files, a table and a feature class with point geometry.

The feature class contains transit stops with the stop number and the geography of each stop
The table contains boardings per trip per day at each stop, with time and date information for each record.

This is obviously a many-to-one relationship, because there's only a few hundred stops but hundreds of boarding records at each stop. What I would like to do is join the table to the feature class so that I end up with a feature class with each boarding record linked with the relevant geography for the stop. (My goal is to produce a time series animation showing boardings over time.) However, there doesn't seem to be a straightforward way to join geographic data to a table and transform that into a feature class.

Do I need to do a more complex workaround?

I do have the lat-long data, so I could just create a feature class from the table using that data, but isn't there an automatic way to do it that doesn't force me to re-create geographic data?

I'm using ArcGIS 10.2.2 Basic on Windows 7.


texts: QGIS Hide symbols which overlaping others

texts:
I have a layer with points located close to each other. Symbols which I have to set for each of point are overlapping. I would like to hide (or remove) those points which overlap (in other words I'd like to make a generalization). For example I have input layer:

And my expected result is something like this:

At the beginning I was using method described here: Joining two or more overlapping buffers using MMQgis plugin?, but it makes one point by dissolving all buffers  and then getting the centroid. In my example its possible to get more than 1 point without overlapping others so I'd like to ask if its possible to get the result which I described.


texts: Importing KML in QGIS - what are all the node elements that QGIS looks for other than Name and Description?

texts:
Of all elements given at (ref: http://service.kmlvalidator.com/ets/ogc-kml/2.2/) only Name and Description seem to be recognized on importing KML using QGIS 1.8.0-Lisboa. I would like to know if this is completely true or few other elements from the spec are also recognized?

My question is related to the two below:

GDAL 1.9.1 ogr2ogr KML to PostGIS not incuding ExtendedData
How to convert KML to shapefile without losing attributes using QGIS?


texts: How to store Large Raster Images of Equipotential Surface Generation Using Monte Carlo Simulation?

texts:
I have a large (1GB+) raster that I am using as the base for the generation of an equipotential surface.  This is to assess the accuracy of DEMs derived from another source.  In situ observation is impossible and the equipotential surface allows me to model in error.

I have an ArcGIS model that generates a single realization of the surface.  The model is outputting beautifully and generates a 1GB raster realization.  I am going to generate 100 of these surfaces to start to build a statistically significant pool of realizations (Monte Carlo simulation).

How would you go about storing the rasters?  How would you visualize them to allow for the selection of the most likely realization (the one at the center of the monte carlo significance envelope)?

Here are the options I have considered:

Convert to point and store each realization as a column in the attribute table.  Here I am concerned about the shapefile size limit (2GB).
Convert to CSV using gdal2xyz.  I tried the conversion and the output of a single raster was 12GB!  This is way too inefficient.
I considered using R but am not sure which package would facilitate this type of research (spatstat perhaps).
Graph either the histograms or cumulative distribution functions of each raster realization for visual identification.


texts: Where to look up type of SQL syntax used by ArcGIS Desktop 10.x and Pro 1.x

texts: I have searched all obvious resources in order to look up the type of SQL syntax used by ArcGIS Desktop (10.x) and Pro (1.x) with no luck so far; that includes Google, Wikipedia, gis.wiki.com, StackExchange, & the ESRI website. I am wondering what the specific flavor of SQL on the desktop side is (i.e. pictured below for a shp file), e.g. Microsoft, proprietary. Is this information known by users? Is there another resource I am missing?


texts: How to workaround non 'ascii' encode character in layer ID of WSM layers in QGIS?

texts:
I am working with the plugin RiverGIS, which in one steps reads the layer ID of all raster layers. In my case it fails becuase there is an "ä" somewhere.

Traceback (most recent call last):
File "C:/Users/XXXXX/.qgis2/python/plugins\rivergis\rivergis.py", line 344, in options
dlg = DlgSettings(self, widget=widget)
File "C:/Users/XXXXX/.qgis2/python/plugins\rivergis\dlg_settings.py", line 58, in __init__
item = QStandardItem('{0}'.format(layer.name())) #layerId
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 135: ordinal not in range(128)

I do not see it anywhere in the Layers Panel, but I can read that is everywhere in the .qgs file related with Swedish WMS service:

<layer-tree-layer expanded="1" providerKey="wms" checked="Qt::Unchecked" id="Hydrografi_ytor_nedtonad_default_Text_nedtonad_Adresser_Adresser_nedtonad_Administrativ_indelning_Administrativ_indelning_nedtonad_Bestämmelser_Bestämmelser_nedtonad_Bebyggelse_Bebyggelse_nedtonad_Anläggningar_Anläggningar_nedtonad_Kraftledningar_Kraftledningar_nedtonad_Fjällinformation_Fjallinformation_nedtonad_Järnväg_Järnväg_nedtonad_Kommunikation_Kommunikation_nedtonad_Hydrografi_Hydrografi_nedtonad_Kurvor_Kurvor_nedtonad_Hydrografi_ytor_mark_default20180215162518119" source="contextualWMSLegend=0&amp;crs=epsg:4619&amp;dpiMode=7&amp;featureCount=10&amp;format=image/png&amp;layers=mark&amp;layers=hydrografi_ytor&amp;layers=kurvor_nedtonad&amp;layers=kurvor&amp;layers=hydrografi_nedtonad&amp;layers=hydrografi&amp;layers=kommunikation_nedtonad&amp;layers=kommunikation&amp;layers=jarnvag_nedtonad&amp;layers=jarnvag&amp;layers=fjallinformation_nedtonad&amp;layers=fjallinformation&amp;layers=kraftledningar_nedtonad&amp;layers=kraftledningar&amp;layers=anlaggningar_nedtonad&amp;layers=anlaggningar&amp;layers=bebyggelse_nedtonad&amp;layers=bebyggelse&amp;layers=bestammelser_nedtonad&amp;layers=bestammelser&amp;layers=administrativ_indelning_nedtonad&amp;layers=administrativ_indelning&amp;layers=adresser_nedtonad&amp;layers=adresser&amp;layers=text_nedtonad&amp;layers=hydrografi_ytor_nedtonad&amp;password=xxxxxx&amp;styles=mark.default&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=&amp;styles=hydrografi_ytor_nedtonad.default&amp;url=http://maps.lantmateriet.se/topowebb-skikt/wms/v1.1?request%3DGetCapabilities%26version%3D1.1.1&amp;username=xxxx" name="Hydrografi_ytor_nedtonad.default/Text nedtonad/Adresser/Adresser nedtonad/Administrativ indelning/Administrativ indelning nedtonad/Bestämmelser/Bestämmelser nedtonad/Bebyggelse/Bebyggelse nedtonad/Anläggningar/Anläggningar nedtonad/Kraftledningar/Kraftledningar nedtonad/Fjällinformation/Fjallinformation nedtonad/Järnväg/Järnväg nedtonad/Kommunikation/Kommunikation nedtonad/Hydrografi/Hydrografi nedtonad/Kurvor/Kurvor nedtonad/Hydrografi-ytor/mark.default">

I do not consider an option to wait for the bug of the plugin to be fixed or to remove and load all layers of the WSM witout an easy way to achieve it.


texts: What is the PostGIS 2.x equivalent of the pre-PostGIS 1.5 ~= operator?

texts:
Stemming from my other question: When would a PostGIS geometry compare using ~= return true when ST_Equals returns false?, what is the PostGIS 2.x equivalent of the  pre-PostGIS 1.5  ~= operator?

It appears that from 1.4 to 1.5, the ~= operator changed from an "exactly equal" to an "bnd equal":

For example, in v1.3:
http://postgis.net/docs/manual-1.3/ch06.html#id439812
The "~=" operator is the "same as" operator. It tests actual geometric equality of two features. So if A and B are the same feature, vertex-by-vertex, the operator returns true.

and in 1.5 and later:
http://postgis.net/docs/manual-1.5/ST_Geometry_Same.html
Returns TRUE if A's bounding box is the same as B's.

I'm mostly interested in PostGIS2.0, but I'm not tagging a specific version and leaving it open.


texts: Combining CSV and shapefile to find area name where stations are located

texts:
I have one shapefile with marine areas. The other is a CSV file with some station names and coordinates. I would like to get table with stations names and corresponding marine area names, where the stations are located.
Is there an easy way to do this in QGIS? (for example using Field Calculator or Attribute Table).


texts: New record fails in Collector with particular FGDB relationship topology

texts:
This is lifted from my GeoNet post asking the same question.
I have FGDB that I am trying to build out for in-the-field surveys through AGO and Collector. Below is a mock diagram of the tables that I am having trouble. FeatureLayer1 is existing features. FeatureLayer2 is newly created features.These are simple, unattributed relationships.

In Pro: If I create a new feature in FeatureLayer2 and then a new record for SharedTable1, everything is saved without issue. If I select a feature in FeatureLayer1 and create a record in Table1 and then a SharedTable1 record, everything is saved without issue. I can even upload the edits done in Pro to AGO and they appear in Collector as expected.
In Collector: If I create a new feature in FeatureLayer2 and then a new record for SharedTable1, when I tell it to submit the record it says, "1 or more attributes failed to submit". If I select a feature in FeatureLayer1 and create a record in Table1 and then a SharedTable1 record, when I tell it to submit the record it says, "1 or more attributes failed to submit".
If I recreate the relationships, like below. All record creation is submitted and works as expected in both Pro and Collector.

Am I forgetting something rather obvious about relationship integrity in the first relationship design; is Pro ignoring something that Collector is catching? Or is there a caveat about using FGDB or Collector with this design?
Also, is there a log for Collector, either in the app or AGO that could help diagnose this problem? "1 or more attributes failed to submit" is an extremely unhelpful error message.


texts: Spatial joining two line layers and checking intersection in PostgreSQL/PostGIS

texts:
I have two line layers in PostgreSQL/PostGIS. I want to the select data which are not intersecting. When I am writing this query it is taking a lot of time. How can I make it faster and see the result?

SELECT Geometry into Qlayer5
FROM qlayer4, egmap_20170316_tmc_polyline
WHERE st_intersects(qlayer59.Geometry,egmap_20170316_tmc_polyline.geom) = false

and I have also tried using right join but none of them giving output.

SELECT Geometry INTO Qlayer5
FROM qlayer4
RIGHT JOIN egmap_20170316_tmc_polyline ON
st_intersects(qlayer59.Geometry,egmap_20170316_tmc_polyline.geom) = false


texts: query in POSTGIS much slower then model in QGIS

texts:
I have a materialized view in postgis with linear referenced roads and a table with boundaries.

I want to sum all lines per boundary based on 2 categories. For that: I add a column (tw) which defines the categorie (0 or 1).

I made following query:

select
g.naam,
case when t.tw = 1 then sum(st_length(t.geom)) end as traag,
case when t.tw = 0 then sum(st_length(t.geom)) end as snel

from gemeentegrenzen g

join (select geom, case when morf in (113, 114, 125) or (morf = 103 and type = 2) then 1 else 0 end as tw

from wegenregister.mv_wegsegment_wegverharding_lrs) t on st_intersects(st_buffer(g.geom, 0), t.geom)

group by g.naam, t.tw
;

This takes me a few hours.

In QGIS I made a model that does exact the same things based on the same layers. This process takes about 30-40 minutes.

What is wrong with the sql-query?

when running explain:

"GroupAggregate  (cost=243596190.39..245430994.97 rows=22176 width=283)"
"  Group Key: g.naam, (CASE WHEN ((mv_wegsegment_wegverharding_lrs.morf = ANY ('{113,114,125}'::integer[])) OR ((mv_wegsegment_wegverharding_lrs.morf = 103) AND (mv_wegsegment_wegverharding_lrs.type = 2::numeric))) THEN 1 ELSE 0 END)"
"  ->  Sort  (cost=243596190.39..243858174.65 rows=104793704 width=283)"
"        Sort Key: g.naam, (CASE WHEN ((mv_wegsegment_wegverharding_lrs.morf = ANY ('{113,114,125}'::integer[])) OR ((mv_wegsegment_wegverharding_lrs.morf = 103) AND (mv_wegsegment_wegverharding_lrs.type = 2::numeric))) THEN 1 ELSE 0 END)"
"        ->  Nested Loop  (cost=0.00..173759771.26 rows=104793704 width=283)"
"              Join Filter: st_intersects(st_buffer(g.geom, 0::double precision), mv_wegsegment_wegverharding_lrs.geom)"
"              ->  Seq Scan on gemeentegrenzen g  (cost=0.00..62.08 rows=308 width=20402)"
"              ->  Materialize  (cost=0.00..96126.77 rows=1020718 width=274)"
"                    ->  Seq Scan on mv_wegsegment_wegverharding_lrs  (cost=0.00..53144.18 rows=1020718 width=274)"


texts: How to get latitude and longitude data from the borders of a state in R

texts:
Here is my problem: I need to get longitude and latitude data from the borders of the Brazilian states. With this data I can plot a map of each Brazilian state and, of course, of the whole country.

I know that R has some packages to plot maps and also to get latitude and longitude data from cities, countries, etc. but the problem is that I need latitude and longitude from the bordes of each state and not just the map or the data of specific place.

I need to have this data to after construct a map. So, I need both the data and the map! I don't know if it's possible to get this sort of data in R. Is it possible to extract this data from Google Maps?

I've found latitude and longitude data by cities on the website of the Brazilian Institute of Geography and Statistics but I couldn't find it by states.

Can someone help me?

P.S.: I'm an statistician. I dont't how to use some (and I don't have access) to some softwares that geographies use, such as ArcGIS. I only know how to use R, SAS, Access, Excel...


texts: How to get values on a rastar layer to provide me with values

texts:
So I have received data from an external source for my work they have provided me with NDUI (plant productivity) with black being a lower value and white a higher value, however I am unsure on how to get specific values for certain areas
Does anyone know how to get values up from this type of layer or do I need to ask the provider for additional information?


texts: How to merge multiple ADF files to a single shapefile?

texts: I have a set of adf file which use the same structure. How can I merge all ADF to shp file? Does the ogr2ogr command can help in this case?


texts: Geprocessing Service: ERROR 000816: The tool is not valid. .Pyt file is fine but .tbx has red x's

texts:
I have a .pyt Python toolbox which runs fine in ArcMap and then gives the dreaded "ERROR 000816: The tool is not valid" when published as a GP Service.  I've dealt with this issue many times before, but this one is exceptional.

If I run ArcMap as the arcgis service account user (Shift - Right click - Run as different user) and inspect the actual GP service code that ESRI creates, the .pyt is fine and runs with no issue, but the derived .tbx has red x's.  I can't think of any reason why or any way to tell what the problem is.

The "extracted" .pyt also runs fine from the command line (run as arcgis service account user with debug code in the if __name__ == "__main__": block.  Running with 64 bit python and import arcserver at top of script).

This is on ArcGIS Server/Desktop 10.3.1.


texts:
i want to trace using a weight filter but we i have the case, that 2 edges are overlapping and they share the same 2 junctions.  Now if you want to set a flag, you won't be asked if you want to select Edge A or Edge B.

One Edge has a diameter of 5 inches and the other one has a diameter of 8.
The trace should work by setting 5 or 8 as Weight Filter.

Normally it is working, but not when lines are overlapped. What can i do?

Programmaticaly a solution perhaps or over the İnterface?


texts:
I have been converting data published in is ESRI’s public ASCIIgrid format to ZMap Plus Grid in QGIS 2.18.6 .

When I tried to continue on my work, I suddenly received the following Error message:ERROR 5: MINUSERPIXELVALUE must be specified.
Even maps that I had already been converting the day before, could not be converted again!

One thing that struck my eye was, that in the Translate (Convert format) window the following text showed up: gdal_translate -of Leveller
I am pretty certain, there was a ZMap in there before, instead of the Leveller.
I have double- and triple-checked - I am using the correct output format (ZMap Plus Grid).

I am using 2.18.6, because in 3.4.4 the option to convert a map to ZMap Plus Grid seems to have disappeared.


texts:
Here in the south of France are some huge fires running ... I wanted to create a map of them by adding data from a WMS I thought usefull : http://effis.jrc.ec.europa.eu/applications/data-and-services/

But when trying to add one of the WMS provided urls to my base map, it fails ...

Example : http://ies-ows.jrc.ec.europa.eu/effis?LAYERS=modis.hs&FORMAT=image%2Fpng&TRANSPARENT=TRUE&SINGLETILE=false&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:4326&BBOX=-35.0,25.0,50.0,72.0&WIDTH=596&HEIGHT=330&TIME=2017-07-19/2017-07-26

displays the error message :

  The URL is either invalid or contains unsupported projections

Any ideas of how I can use these data please ?


texts: Sentinel-2 range of values, Level 1C (2A)

texts:
Is it correct that images (TIFF 8-bit, B2, B3, B4 bands, sentinel-2 L2A, high resolution) downloaded from sentinel-hub have very poor range of values? Min value is about 30 and max value is about 60 for some bands.

Shouldn't histogram be wider or it's normal for Sentinel data with atmosphere correction? Nir band has wider range of values. (Note: region of interest has forest cover; summer period; clouds 0%)


texts: Downloadable, Open Source, IP GeoLocation database

texts:
I have an open source project I need a similarly open source IP GeoLocation database for. i.e. IP address to country (and ideally city). Ideally with a license that allows redistribution.

This is a question that's been asked before (Advice on geocoding IP addresses, and https://stackoverflow.com/questions/3232516/geocode-an-ip-address most noteably), but they were for RESTful/API interfaces; I want a database that can be downloaded and used offline.

So far I've found two potentials:

IP2Location's 'Lite' - which claims to be open source but doesn't allow redistribution and has a very restrictive set of terms of use.

MaxMind's GeoLite2 - Released under a Attributeion ShareAlike Unported License, but again with restrictions on redistribution.

Does anyone know of any suitable datasets?
Thanks.


texts: How to use a variable in Geoserver viewparams?

texts:
I just managed to create a parametric view that is working OK when i define the parameter value as, for instance, viewparams:'value:31' However, when i try to pass a value that comes from a variable, for instance, viewparams:'value:variable', the wms layer just wont load.
The variable is defined as var variable= 31;
Any ideas on why this happens?
I'm using OpenLayers + Geoserver + PostGIS

EDIT 1 -

Just to explain a little bit better what I'm trying to achieve.
I have a web map application developed with Openlayers where i have a set of wms layers that are being created by Geoserver.
Despite the fact that i already have some functionalities implemented, such as feature info in pop ups, images on those pop ups, etc, i thing that it would be really important to allow users to query the layers, to allow the map to show only what they wanted to see. The query would be done through a php form, where the values selected by users would act as variables on the Parametric views created on Geoserver, and by doing so, the features showing up on the map would be only the ones selected by the user.
The parametric view i created for testing purposes works, if i "hardcode" the value for the parameter:

var rov_dives = new OpenLayers.Layer.WMS(
           "ROV Dives",
                   "http://host:8080/geoserver/wms",
                   {'layers': 'parametric_view', 'format':'image/png', 'transparent':'true', viewparams:'test_parameter:50'},
                   {'opacity': 1, 'isBaseLayer': false, 'visibility': false}
                );

In this example the map only shows the features that comply with the condition stated on the SQL script that defines the parametric view, in this case, all features that have a number of measurements higher than 50.
If I could pass that 50 as a variable coming from the aforementioned PHP form, I could implement the solution I thought of... The definition of the variable and WMS layer I'm trying to use right now is:

var variable = 50;

var rov_dives = new OpenLayers.Layer.WMS(
           "ROV Dives",
                   "http://host:8080/geoserver/wms",
                   {'layers': 'parametric_view', 'format':'image/png', 'transparent':'true', viewparams:'test_parameter:variable'},
                   {'opacity': 1, 'isBaseLayer': false, 'visibility': false}
                );

Despite all my efforts I'm yet to find a solution for this.

Hope this explanation helps to understand the problem!


texts:
I'm plotting the least cloudy Sentinel image in MGRS tile '11SPV', but it's rendered as a narrow triangle on the Western edge of the tile.  I've changed the temporal range but the same thing occurs.  Is this a clash of projections, or something else entirely?
The co-ordinates of tile 11SPV are:
EPSG    32611
MGRS_REF
36.13956045 -115.88852197
36.124095832 -114.77760861
35.223124941 -114.80245835
35.238087535 -115.90095919

UTM_WKT MULTIPOLYGON(((600000 4000020,600000 3890220,709800 3890220,709800 4000020,600000 4000020)))

LL_WKT  MULTIPOLYGON(((-115.888519424674 36.1397407305084,-115.902146161155 35.1499160380147,-114.697342097699 35.1330063316074,-114.668785361013 36.1222067277992,-115.888519424674 36.1397407305084)))

Screenshot of the output below.

// var START_DATE = '2017-02-15';
// var END_DATE = '2017-04-15';
var MGRS_TILE = '11SPV';

var s2_unsorted = ee.ImageCollection('COPERNICUS/S2')
                    .filterMetadata('MGRS_TILE', 'equals', MGRS_TILE)
                    .filterDate('2020-07-01', '2020-07-31');
var s2_sorted = s2_unsorted.sort('CLOUDY_PIXEL_PERCENTAGE');
var least_cloudy_image = ee.Image(s2_sorted.first());

Map.centerObject(least_cloudy_image);
Map.addLayer(
  least_cloudy_image,
  {bands:'B4,B3,B2', min:0, max:3000},
  'least cloudy image'
);
print('least cloudy image', least_cloudy_image);

// It can be useful to print out the image collection, and the list of metadata properties to confirm that it is working the way you expect:

var MAX_IMAGES_IN_LIST = 100;
var getCloudMetadata = function (coll) {
  return coll.toList(MAX_IMAGES_IN_LIST).map(
    function (i) {
      return ee.Image(i).get('CLOUDY_PIXEL_PERCENTAGE');
    }
  );
};

// print(
//  'START_DATE', START_DATE,
//  'END_DATE', END_DATE,
//  'MGRS_TILE', MGRS_TILE
//);
print(
  's2 (unsorted)', s2_unsorted,
  'CLOUDY_PIXEL_PERCENTAGE metadata', getCloudMetadata(s2_unsorted)
);
print(
  's2 (sorted)', s2_sorted,
  'CLOUDY_PIXEL_PERCENTAGE metadata', getCloudMetadata(s2_sorted)
);


texts: cross domain problem with :OpenLayers.Protocol.HTTP

texts:
this code works with local kml files, but not when the kml files are on my other server,
I got 3 error :

OPTIONS http://192.168.0.150:9000/files/anonymous/AVGHDOP.kml 404 (Not Found) XMLHttpRequest.js:220
OPTIONS http://192.168.0.150:9000/files/anonymous/AVGHDOP.kml Origin http://localhost is not allowed by Access-Control-Allow-Origin. XMLHttpRequest.js:220
XMLHttpRequest cannot load http://192.168.0.150:9000/files/anonymous/AVGHDOP.kml. Origin http://localhost is not allowed by Access-Control-Allow-Origin.

so, I try to put headers in the OpenLayers.Protocol.HTTP. but it still is not working -_-.
here is my code:

map = new OpenLayers.Map('map');
osm = new OpenLayers.Layer.OSM();
vectors = new OpenLayers.Layer.Vector("KML", {
    strategies: [new OpenLayers.Strategy.Fixed()],
    protocol: new OpenLayers.Protocol.HTTP({
        url: url_file,//the file is on an other_server(a play server).
        headers: {
            "Access-Control-Allow-Origin":"*",
            "Access-Control-Allow-Headers":"Access-Control-Allow-Origin"},
        format: new OpenLayers.Format.KML({
            extractStyles: true,
            extractAttributes: true,
            maxDepth: 2
        })
    })
});
map.addLayers([osm, vectors]);
map.addControl(new OpenLayers.Control.MousePosition());
map.addControl(new OpenLayers.Control.EditingToolbar(osm));
vectors .events.register("loadend", vectors , function (e) {
    map.zoomToExtent(vectors .getDataExtent());
});

I dont know if I can configure a proxy. So if I can solve this problem without it it would be great :)


texts: PostGIS query for geocoding street intersectons using local data sets?

texts:
I'm currently looking for a script example for geocoding two intersecting streets using local data sets and PostGIS.

I'm aware that the Tiger Geocoder can used for geocoding both addresses and street intersections, but the results for street intersections isn't as accurate as the local data sets and has been giving completely inaccurate results.

The current documentation only refers to the Tiger Geocoder and there isn't other docs or examples relating to this problem.


texts: Problems with a wms layer in Openlayers 3

texts:
First of all sorry if my English isn't good.

I'm trying to add a layer into an OpenLayers 3 map. This one is which I want to insert:

new ol.layer.Image({
    name: 'cartografia',
    style: 'cartografia',
    visible: true,
    source: new ol.source.ImageWMS({
        url: 'http://www.geo.euskadi.net/arcgis/services/U11_AGS_WMS_Cartografia/MapServer/WMSServer?',
        params: {
            'LAYERS': '1',
            'STYLES': 'default'
        },
        serverType: 'geoserver' }) })

When I go to http://www.geo.euskadi.net/arcgis/services/U11_AGS_WMS_Cartografia/MapServer/WMSServer?request=getcapabilities into the browser, I can see the xml, but I'm not able to insert the layer

What I'm doing wrong?


texts: Connecting Two Iterators In ModelBuilder of ArcMap

texts:
I created a model for iterate with feature dataset and feature class but problem is iterate dataset iterating all datasets but passing last dataset to iterate feature class.
How can I solve this?


texts: Set Center of Openlayers3 to location of click?

texts:
Is it possible to get openlayers3 to center the map on the location of a click?

Don't have any code to show as i am just curious and can't seem to find any information regarding this.


texts: PostGIS - ST_Difference query returns a dissolved result

texts:
I am using the ST_Difference to erase multipolygon feature by a mask. However, the query returns a dssolved multipolygon.

The query is the following:

'''SELECT ST_AsGeoJSON(ST_Collect(geom))::json
   FROM (SELECT (
     ST_Dump (
         ST_Difference(ST_GeomFromGeoJSON('%s'),ST_GeomFromGeoJSON('%s')))).geom)
             As f''' % (feature,mask)

Please take a look at those images to understand the problem:

Input:

Dissolved output:


texts: PyQGIS error message: algorithm "gdalogr:cliprasterbymasklayer" not found

texts:
I wrote a QGIS plugin and at the moment I'm going through the error messages.
I'm stuck on the following:

Now I show you the top of my code where I import everything and the function containing the gdal algorithm:

from qgis.PyQt.QtCore import QSettings, QTranslator, QCoreApplication
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QAction, QFileDialog
from qgis.core import *
from osgeo import gdal
from processing.core.Processing import Processing
import glob, os.path
from .resources import *
from .Clip_XYZ_dialog import ClipXYZDialog

def clipRasters(self):
    Processing.initialize()
    inputDir = self.getInputPath()
    outputDir = self.getOutputPath()
    for lyr in glob.glob(os.path.join(inputDir, "*xyz")):
        processing.run("gdalogr:cliprasterbymasklayer", {lyr, self.getVectorLayer(), 'none', True, False, 0,
                       outputDir + lyr})

Interesting is that "from osgeo import gdal" is actually grayed out in my code and processing has a red underline that marks some sort of error. It says "unresolved reference 'processing'" but I don't know what that means.
Can someone explain me the error and what should be done?


texts: Query to merge simplified polygons according to the map scale-factor

texts:
I'm trying to construct a view in PostgreSQL that simplify polygons according to the map scale-factor. Basically I was reading this thread http://linfiniti.com/2011/06/scale-dependent-generalization-in-postgis-and-qgis/ and I managed how to do it in QGIS, but about POstGIS I was rather confused. Can someone highlight me?

Another detail, I already have three different tables each one at a different simplified vision. I just need a query that assembly these ones declaring the factor scale for each one.


texts: Unexpected argument grid_dist_x using PDAL

texts:
I'm trying to convert a .las file to a DTM/DEM using PDAL, but having the issue of multiple bands instead of one.

I went through Generating a DTM and writers.gdal but it prompts an error message:

  Unexpected argument 'grid_dist_x'.

{
    "pipeline": [
       "E:/ground.laz",
        {
            "filename": "E:/ground.tif",
            "grid_dist_x": "2.0",
            "grid_dist_y": "2.0",
            "output_format": "tif",
            "output_type": "all",
            "type": "writers.gdal"
        }
    ]
}


texts: I have an array of objects where each object has three fields: lat, lon, and category. It is essentially pixels that have been given a land use category. I cannot figure out how to turn this data into a geotiff. I assume I should use geotools. The coordinates are in dec degrees lat long. I know I can use q or arcgis to do this but I need to do it as part of an automated process. Just need a push in the right direction.


texts: in seach of gps tracking (web) service to use with rails web app

texts:
hey out there GISers,
i am looking for a gps tracking service i can hook gps devices into and request their infos via a ruby on rails webapp.
does anybody know some?

any help is appreciated!

thanks,

martin

a site which does similar things is eg.: www.cabulous.com


texts: Writing Datetimes with Fortran in Shapefiles

texts:
I'm writing shapefiles nicely with Fortran. One of the fields I'm writing is a Date field. I read several things online that seem conflicting, wondering if I could get some clarification.

The dBASE file has a Date input, I can easily work with this. Fields are however limited to 10 bytes, so there is no room for time. And altering the field inside of QGIS just leads to the time not being saved (why does it even exist in QGIS then?). So I get the same issue as here and similar things. I also found here that a datetime format is accepted with dBASE but this doesn't seem to get recognized in QGIS (I know the link seems to imply it only works in FoxPro but it was worth a shot). I'm additionally confused by this page which suggests that time is no problem for ArcGIS, (which is obviously not QGIS but they use the same .dbf files, I'm also writing these file for use in ArcGIS).

My question boils down to this: I guess Date+Time is a bit of an issue with the .dbf file, so my options are to basically store the time as a string ("When visualizing data through time, you must specify the Time field that contains the time values. These time values can be stored in date, string, or numeric field types. For best performance, it is recommended that you store your time values in a date field type"). The last link makes me think that ArcGIS can still work with this (I'd like to be able to create time-based visualizations with the time slider, etc.). I just can't find what format to put it in when I save the time as a string and if there is any special indicator I'd need to set in the .dbf header or something, and will ArcGIS or QGIS be able to obtain the time information despite the column being a string column. I want to be able to do this all through Fortran, without actually changing any settings in ArcGIS or QGIS. I'm trying to automate this process through Fortran and I'm really close, this is the last bit.


texts: Copying fields from one vector to other on QGIS

texts:
I would like to copy the source fields with the same format (type, length...) from one vector to other that of course is different. is it possible? The values for each filed should be blank
So vector 1 has 10 fields
vector 2 has 5 different fields
I would like to have
vector 3 with 15 fields.
I can do it manually but it is time consuming.


texts:
I am new to MapServer. I was trying to get WMS and WFS services started but could not get any simple article to start the services from scratch and display service data into OpenLayers.

Please suggest some simple articles to start the WMS and WFS services on MapServer and use them in OpenLayers.


texts: Using Mapbox vector tiles from Geoserver in OpenLayers

texts:
Currently this error code is the only result:

Uncaught Error: Unimplemented type: 4
    at Pbf.skip (index.js:191)
    at Pbf.readFields (index.js:41)
    at MVT.readFeatures (MVT.js:250)
    at VectorTile.<anonymous> (featureloader.js:86)

Code:

import Map from 'ol/Map.js';
import View from 'ol/View.js';
import MVT from 'ol/format/MVT.js';
import VectorTileLayer from 'ol/layer/VectorTile.js';
import VectorTileSource from 'ol/source/VectorTile.js';

const vectorLayer = new VectorTileLayer({
  source: new VectorTileSource({
    format: new MVT(),
    tilePixelRatio: 1,
    url: 'http://localhost:8080/geoserver/gwc/service/tms/1.0.0/opengeo%3Acountries@EPSG%3A4326@pbf'
  })
});

new Map({
  layers: [vectorLayer],
  target: 'map',
  view: new View({
    center: [0, 0],
    zoom: 2
  })
});


texts: Running a tool on subset of layer two points at a time PyQGIS

texts:
layer = iface.activeLayer()

request = QgsFeatureRequest()
request.setLimit(2)
request.setFilterFids([1, 2])
for feature in layer.getFeatures(request):
    print([f for f in feature])

params = { '-g' : False, 'GRASS_MIN_AREA_PARAMETER' : 0.0001, 'GRASS_OUTPUT_TYPE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'GRASS_SNAP_TOLERANCE_PARAMETER' : -1, 'GRASS_VECTOR_DSCO' : '', 'GRASS_VECTOR_EXPORT_NOCAT' : False, 'GRASS_VECTOR_LCO' : '', 'acolumn' : None, 'arc_type' : [0,1], 'input' : '/Users/uname/Downloads/scatteredroads.sqlite', 'npoints' : -1, 'output' : '/Users/uname/Downloads/out3.sqlite', 'points' : '/Users/uname/Downloads/testptssnapped.sqlite|layername=testptssnapped', 'terminal_cats' : '1-100000', 'threshold' : 50 }

#processing.runAndLoadResults("grass7:v.net.steiner", params)

What I want to do is run a processing algorithm (v.net.steiner) on two points at a time. The background is that the whole tool fails if even one point is faulty. By running the algorithm on two points at a time I can find where it fails and delete that point.
With request.setFilterFids([1, 2]) I have selected just two points, but how can I pass this subset of the layer into the tool?
Do I need to create a new layer out of this subset?
How do I do that?


texts: Problems transforming polygon projections inside Shiny app

texts:
I've just recently started attempting to build mapping apps with leaflet and shiny in R. I'm currently stumped by an issue with projecting polygons inside shiny.

Here is the shapefile to reproduce my code, and here's the stripped down code:

library(shiny)
library(leaflet) #MUST INSTALL DEVELOPMENT VERSION WITH:  devtools::install_github('rstudio/leaflet')
library(sp)
library(rgeos)
library(rgdal)

#pull in full rock country shapefile, set WGS84 CRS
countries <- readOGR("D:/NaturalEarth/HIF", layer = "ctry_hif",
                     stringsAsFactors = F, encoding = "UTF-8")
countries <- spTransform(countries, CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"))

#run shiny app
shinyApp(
  ui = fluidPage(leafletOutput('myMap', width = "80%", height = 500),
                 absolutePanel(width = "20%", top = 10, right = 5,
                               selectInput(inputId = "location",
                                           label = "Country",
                                           choices = c("", countries@data$sovereignt),
                                           selected = "")
                 )
  ),     #END UI

  server <- function(input, output, session) {

    #observe click event; zooms to administrative units for the country that is clicked on
    observeEvent(input$location, {

      #subset countries shapefile by dropdown selection country
      selected <- countries[countries@data$sovereignt == input$location,]

      # selected <- spTransform(selected, CRS("+proj=moll +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"))
      # selected <- gBuffer(selected, width = -.2)
      # selected <- spTransform(selected, CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"))

      #plot leaflet output
      output$myMap <- renderLeaflet({
        leaflet() %>%
          addTiles() %>%
          addPolygons(data = selected)
      })    #END TOP LEAFLET OUTPUT
    }) #END OBSERVE EVENT
  } #END SERVER
) #END SHINYAPP

Running this code as is works fine--the map updates with whichever country the user selects from the dropdown menu.

The problem occurs when I try to change the projection of the selected polygon within the Shiny observeEvent. The ultimate goal is to be able place the country level polygon over a regional-level polygon with the rgeos function over and update the map with regions rather than countries. I have achieved this within Shiny to create a perfectly functional app. But when I try to use that same exact code within this app, no dice. I've narrowed the problem down to the following lines of code (which are commented out above):

selected <- spTransform(selected, CRS("+proj=moll +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"))
selected <- gBuffer(selected, width = -.2)
selected <- spTransform(selected, CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"))

When I uncomment those lines of code, the app breaks and gives me the following error:

  Warning: Error in [[: subscript out of bounds Stack trace (innermost
  first):
      74: slot
      73: .spTransform_Polygons
      72: spTransform
      71: spTransform
      70: spTransform
      69: spTransform
      68: observeEventHandler [#19]
       4:
       3: do.call
       2: print.shiny.appobj
       1:  ERROR: [on_request_read] connection reset by peer

When I take the code out of Shiny and run it with a country string in place of input$location, it works perfectly fine. And again, I've gotten the same exact code to run in a different app with a click event. But the projection change breaks this one.

Does anyone have any insight why this spTransform breaks my Shiny app?


texts:
Is it possible in MapInfo (Version 10) to show in the legend all the ranges created in a thematic map even though the record count for one specific range is 0?

I have to create several thematic maps with the same ranges (and legend) in order to be compared to each other, but some maps don't have objects with the value of some range, therefore the legend comes out with "a gap".

In the following example, I miss the range "2000 - 3000":

... even though I created 6 ranges in the customize ranges window and formated the 6 ranges in the customize range styles window:


texts: Finding coordinates of tangent points and intersection of curved line?

texts:
I have a line with curves in it.

Is there an easy way to extract the X Y values for the tangent points and intersection points in ArcMap 10.2.1?

Hopefully my simple paint diagram clarifies what I mean.

Fortunately I only have 1 line with about 8 of these rounded corners.  I am going to create a new layer and draw in the straight lines leading up to the curve - snapping to the vertices but leave out the rounded corner.  I will then extend the lines by whatever distance makes them all intersect and use that to give me the intersection coords.  I can get the tangent ones easily enough.  (My curves were originally just a lot of small connected straight lines but I have already manually edited them to arcs and simplified the vertices on straight sections - at most the line has moved 5m from the original which is fine for my uses).


texts: Install QGIS3 with ecw support with Homebrew

texts:
I'm trying to open ecw images and want to do this with QGIS.

Is there a way that I can do this solely with Homebrew? Or using Homebrew for the most part?

Here you can see that I have install via Homebrew the following things:

osgeo/osgeo4mac/ecwjp2-sdk ✔             osgeo/osgeo4mac/gdal2-ecwjp2 ✔
osgeo/osgeo4mac/gdal2 ✔

And

qgis3

But when I try to open a .ecw in QGIS I get the following error:

Invalid Layer: GDAL provider Cannot open GDAL dataset /Users/ciaran/Downloads/cco_data-20181209181928/data/aerial/ST0343_20130822ortho.ecw: `/Users/ciaran/Downloads/cco_data-20181209181928/data/aerial/ST0343_20130822ortho.ecw' not recognized as a supported file format. Raster layer Provider is not valid (provider: gdal, URI: /Users/ciaran/Downloads/cco_data-20181209181928/data/aerial/ST0343_20130822ortho.ecw

I really would prefer to have all the dependencies handled with brew, but suggestions are welcome!


texts: Keeping lines in PDF after export in QGIS 3.4?

texts:
I have regularly this problem: when I export lines from QGIS to Illustrator with a .pdf (or even .svg), my lines are destroyed in several lines.

Is there a way to keep my lines unbroken?


texts:
I have used a sector in my Geo map using turf.sector(),and using add layers() filling the sector with colors.

Now how can I add zoom option to this sector.?
I want it to reduce size on zooming in


texts: How to dynamically disperse point labels in ArcMap, using image files and leader lines?

texts:
My GIS group needs to find, or somehow develop, a labeling tool for points in ArcMap.  Ideally, it would work like this:

Each point would be labeled using an image file (jpg or png) so that a location, such as a McDonald's restaurant, would get labeled with thumbnail-sized image of the golden arches, etc.
A leader line would extend from the image to the point location on the map
The labels would position themselves as close to the points as possible, without overlapping each other.
When you zoom in or out on the map, the labels would reposition themselves, moving closer or farther from the points, in order to keep from overlapping.

Basically, we're looking for a method to label points with graphics, instead of text, that we can then throw onto a tiled base map online.  If we can use any open-source or non-propriety methods, Javascript libraries, HTML5 tools, etc, it would be best for the budget.   But, if need be, we are open to any alternative software options

We also have access to ArcGIS for Server, so we could publish a map service if there is a way to accomplish this in ArcMap for Desktop.  We have been looking for some kind of way to do this in ArcMap for more than a year, without any luck.  ESRI has a few articles on how to use PNG files as point symbols, but we're looking for a way to use PNG/JPG files as point labels. Maybe it's too much.


texts: How to change the style of a vector layer on a button click

texts:
Is there a way to change the style (e.g. color) of a vector layer on button click?

I have defined a vector layer like this:

   new OpenLayers.Layer.Vector("WFS", {
            style: myStyle,
            strategies: [new OpenLayers.Strategy.BBOX()],
            protocol: new OpenLayers.Protocol.WFS({
                url: "http://demo.opengeo.org/geoserver/wfs",
                featureType: "tasmania_roads",
                featureNS: "http://www.openplans.org/topp"
            })
        });

Now I want when I press a button (which runs a function) to change the style with a new style which I define as:

   var newStyle = {
    fill: true,
    fillColor: "#ff0000"
};

Is something like this possible? I think I can not do this using redraw() or refresh() right?

One solution would be what I read here. (destroy the whole vector layer and build it again with the new style). But this doesn't seem very efficient either or?

EDITED

I tried this but doesn't seem to work. Instead I get all feature black:

   // ADD STYLING - DIFFERENT COLORS
                var styleContext = {
                    getColor: function (feature) {
                        var objectKeys = Object.keys(gidsAll); // use objectkeys to loop over all the object properties //use it to get the length
                        for (var i = 0; i < objectKeys.length; i++){
                            if (Math.round(feature.attributes.__gid) === parseInt(gidsAll[objectKeys[i]], 10)) {
                                return "green";
                            }
                        }
                            return "red"; //no images on this line
                    }
                };

                // define Style
                var defaultStyle = new OpenLayers.Style({
                    fillColor: "${getColor}",
                    fillOpacity:"1",
                    strokeColor: "${getColor}",
                    strokeOpacity: "1",
                    strokeWidth: 8,
                    cursor: "pointer",
                    pointRadius: 8

                }, {
                    context: styleContext
                });

                // Define style when selecting the feature
                var selectStyle = new OpenLayers.Style({
                    'pointRadius': 8,
                    strokeColor: "cyan",
                });

                // Define the stylemap (loaded in each feature)
                var featurestyleMap = new OpenLayers.StyleMap({
                    'default': defaultStyle,
                    'select': selectStyle
                });

                wfs_layer_network.style = featurestyleMap;
                //then redraw the layer
                wfs_layer_network.redraw();


texts:
I have the EPSG number of the projection and I want to use proj4 to get the projection descriptive string (like +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs)

I want to use proj4 and no html request like http://spatialreference.org/ref/epsg/EPSG/proj4/ because the tool has to work without internet


texts: How to edit an ArcGIS Server WFS-T service in uDig?

texts:
Now a straight forward workflow to do this is present in the below link.

http://udig.refractions.net/files/docs/uDigWalkthrough2.pdf

Point 3 of page 8 states to change to the ‘Edit Geometry’ tool from the tool bar.

But I can’t find this anywhere in the uDig interface.

What could I be missing?

Do note that the service added to uDig is a WFS-T service from ArcGIS Server and not GeoServer.


texts:
I recently installed QGIS 2.0.1 and uDig 1.40b on the same computer. PostGIS (from OpenGEO Suite) is running on my server. I'm able to connect to PostGIS and access layers with uDig but not with QGIS. Any thoughts why uDig works but not QGIS? I've tried previous versions of QGIS but without success.

UPDATE:

Thanks to all of you responding to my question.  I have a few items to update my original question.

Below is the parameters entered in QGIS to connect to PostGIS on a remote server (and, yes, the port for PostGIS is 54321).

The error message is below.

I have recently connected to the PostGIS database with OpenJump without problems (as well as with uDig).

Your thoughts are greatly appreciated.

Scott

UPDATE 2:

In response to recent questions:
(1) uDig, OpenJump and QGIS are all on the same client computer and OpenGEO is on a separate server,
(2)  pg_hba.conf has the following settings:
   # IPv4 local connections:
      host    all             all             0.0.0.1/0               trust,
(3) postgresql.conf has the following settings:
     listen_addresses = '*'
     port = 54321,
(4) tables and field names are all in lower case, and
(5) same credentials used for QGIS, uDig and OpenJump.

UPDATE 3:

In place of the computer name (on the local network) I entered the IP address of the server and the connection was made between QGIS and PostGIS.  It appears (in my situation) I cannot enter the hostname of the server to make the connection, only the IP.  Anyone else encounter this phenomena?

FINAL UPDATE:

YES!  The issue with the setting for IPv6 solved the problem.  I'm able to connect to the server by its hostname as well as its IP address.


texts: How to lock the composer extent in QGIS?

texts:
Is there a way to lock the print composer view extent map? This is my print composer:

If I change the scale bar in the canvas the composer change also. I try to use those options but with no success.

This is the canvas screen:

If i using "Sync composer with map" plugin  after i chnging the scale, then the composer scale change also.


texts: Using "managed" intermediate data in ModelBuilder - ArcGIS - what are the benefits? vs the costs of not using in-line variable substitution

texts:
Do you have experience or examples of using "managed" data to ensure custom models are able to be shared?

What are the costs / benefits of this versus setting the file path using in line variable substitution

Most of my models at present use in line variable substitution e.g.

%Scratch%\Var1b
or

%Scratch%\Variable%Value%_result

Within the Model Scratch is then set as a model parameter

I have found that in trying to make the models more robust and transferable (where there have been issues in sharing the custom tools) that making more of the intermediate data "managed" has solved some issues. However it causes other issues because if all data is set to be "managed" then the in_memory cannot be used and also in line variable substitution cannot be used to name files.

I'd be grateful to hear your experience and  solutions with using "managed" intermediate data to ensure models  are transferable (and any implications regarding using in-line variables / in_memory work space).

There is help note here that mentions that in some (unspecified) situations that not using "managed" intermediate data can cause generic error messages in Model Builder

http://help.arcgis.com/en%20/arcgisdesktop/10.0/help/index.html#//002w0000005p000000

I am using ArcGIS 10.1, SP1, Desktop Advanced,  on Win 8, OS 64 bit,

Thanks,


texts: How to access qgis, postgis, etc in ubuntu through Amazon AWS

texts:
I'm new to programming; however i have been able to read and research the programs i need to set-up for a GIS system. I chose to use Geoserver (as WMS) Postgresql, postgis, Qgis and Openlayers.
I am setting up a web-based map platform. I have been able to install ubuntu on AWS on which i successfully installed postgresql and postgis. However, am finding it hard to follow tutorials through a command line as I need to see the file structure, etc as well as pgadmin3. is there any way i could access the instance through a gui to perform further installations and tutorials?


texts:
I have a custom projection used in some shapes on a prj file.
I want to insert this projection in the table spatial_ref_sys PostGIS.
The data in the prj file will SRTEXT table field, how can I get PROJ4TEXT from SRTEXT??

INSERT into spatial_ref_sys
 (srid, auth_name, auth_srid, proj4text, srtext)
values
( 101010, 'epsg', 101010, '?????????????',
'GEOGCS["Carta Geral",DATUM["Not specified (based on International 1924 ellipsoid) (EPSG ID",SPHEROID["International 1924 (EPSG ID 7022)",6378388.0,297.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",200000.0],PARAMETER["False_Northing",5000000.0],PARAMETER["Central_Meridian",-51.0],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]');


texts:
I was recently presented to the software Whitebox GAT 'Iguazu'. Unfortunately, I tried to use it in two different machines: one with Windows 7 (64) + JRE 7 (65) and other with W7 (64) + JRE 7 (67) . In both computers I could not start the program.

I tried double click and also open specifying the program path. Nothing happens. Am I doing something wrong?


texts: Field Calculator - How to evaluate and sum multiple fields?

texts:
I'll do my best to describe the problem - my main issue isn't so much the python code but rather the logic I'm using.

The file I'm working on is a polygon shapefile with forest attribute data. In the attribute table, each polygon has 5 fields that describe tree species present (SP1-5) and a percentage that each species represents in each polygon (SP1-5_PER). Below is a picture of the attribute table I'm working with.

I'm trying to use field calculator to sum the percent of coverage that is composed of coniferous trees, in each polygon. Ie, this polygon has 50% coniferous, whereas that one has 80%. etc etc etc.

Here is what my code in field calculator looks like:

def percvr(sp1,per1,sp2,per2,sp3,per3,sp4,per4,sp5,per5):
    sum = 0
    if (sp1 == "Sw" or "Se" or "Sb" or "P" or "Pl" or "Pj" or "Pa" or "Pf" or "Fb"  or "Fa" or "Fd"):
        sum=sum+per1
    if (sp2 == "Sw" or "Se" or "Sb" or "P" or "Pl" or "Pj" or "Pa" or "Pf" or "Fb" or "Fa" or "Fd"):
        sum=sum+per2
    if (sp3 == "Sw" or "Se" or "Sb" or "P" or "Pl" or "Pj" or "Pa" or "Pf" or "Fb" or "Fa" or "Fd"):
        sum=sum+per3
    if (sp4 == "Sw" or "Se" or "Sb" or "P" or "Pl" or "Pj" or "Pa" or "Pf" or "Fb" or "Fa" or "Fd"):
        sum=sum+per4
    if (sp5 == "Sw" or "Se" or "Sb" or "P" or "Pl" or "Pj" or "Pa" or "Pf" or "Fb" or "Fa" or "Fd"):
        sum=sum+per5
    return sum

esri_field_calculator_splitter

percvr( !SP1!, !SP1_PER!, !SP2!, !SP2_PER!, !SP3!, !SP3_PER!, !SP4!, !SP4_PER!, !SP5!, !SP5_PER!)

The above text may not be overly clear so I included an image to show indenting:

Basically, what I want it to do is, if the SPn field corresponds to one of the above tree codes, add the number from the corresponding percentage field to the sum. If the tree code does not match one of the above, do nothing and move on to the next case. Finally, output the sum to the field.

The issue that seems to come up is that this function seems to be adding all percent cover no matter what so that the resulting values are all 100%


texts: Including image in callout using ArcMap?

texts:
I'm using ArcMap 10.3 and creating a map of 30 properties where each property needs to include an image within the callout.

The final product has to be a printed map.  I'm familiar with creating basic Label Expressions using VBScrip, but need to know if there's a way to include an image?

My images are saved locally in a .tiff format and have a unique identifier as the file name. The other option I see is to add the image and resize into the callout, but this approach would take a lot of time and effort.

Here's an example


texts: SSL error message using MMQGIS and Google Geocoding API

texts:
I have a large batch of about 9000 addresses that require geocoding. I've read most of the documentation, and have sectioned my data into chunks of 1000 to geocode using QGIS's MMQGIS Plugin. I also used my Google API key. However, it fails to run and returns this error message:

  failure connecting to maps.googleapis.com
  url open error [ssl: certificate_verify_failed (_ssl.c:833)

I've tried reinstalling everything (the latest python, the latest QGIS, the latest MMQGIS plugin), but the same error message appears. I even shortened my dataset to 10 addresses but it still returns the same error message.

There is definitely no issue with my API key either as when I run the URL: https://maps.googleapis.com/maps/api/geocode/xml?sensor=false& + address + &key= + apikey , the api works.

Anyone has any idea what might be the problem?


texts:
I developing QGIS module and I have a question, how to capture QgsMapCanvas window with OpenCV for shoving in different frame or different application?

Part of the code:

class MainWindow( QtWidgets.QMainWindow, Ui_MainWindow ):
    def __init__( self ):
        QtWidgets.QMainWindow.__init__( self )
        self.setupUi( self )

        self.setWindowTitle( "QGIS Demo" )

        # Create map ()
        self.canvas = QgsMapCanvas()
        self.canvas.setCanvasColor( QtGui.QColor( 200, 200, 255 ) )
        self.canvas.enableAntiAliasing( True )
        self.canvas.show()


texts: Where the folder of new symbol saved in the computer ?- QGIS 2.12

texts:
I created new polygon symbol called "476" and saved it in the Layer properties in one computer (with the "save" button under the symbology ):

I seeking the symbology folder where this new symbol saved in, in order to work with it in other computer.

I know the option of save it as qml file and prefer not to use it- Is there a folder that i can copy\paste to other computer?


texts: Can't create a vector map with VectorTopo in new mapset after switching

texts:
I need to create vector maps in different mapsets with pygrass. However, there seems to be a "hidden" global variable which prevents mapset in pygrass from changing. It sort of "memorizes" the mapset the first time when VectorTopo is called. The global variable does not change after subsequent g.mapset calls. The following code snipet can be used to reproduce the issue.

from grass.pygrass.modules.shortcuts import general as g
from grass.pygrass.modules.shortcuts import vector as v
from grass.pygrass.modules.shortcuts import raster as r
from grass.pygrass.modules.shortcuts import database as db
from grass.pygrass.vector import geometry as Geo
from grass.pygrass.vector import VectorTopo

# Create a vector map with one point in the first mapset
g.mapset('test1', flags='c')
new = VectorTopo('newvect', mapset='test1')
new.open('w')
pt = Geo.Point(0, 0)
new.write(pt)
new.close()

# Then switch the mapset
g.mapset('test2', flags='c')

#new2 still points to the "newvect" map in the "test1" mapset even
#though mapset is set to 'test2'
new2 = VectorTopo('newvect', mapset='test2')

new2.open('w')

pt2 = Geo.Point(0, 0)
new2.write(pt2)

#the program crashes because VectorTopo tries to build the map in
#mapset 'test2' but 'new2' is pointing to the "newvect" in mapset 'test1'
new2.close()

In the source code of the VectorTopo class, the mapinfo attribute is initilized with self.c_mapinfo = ctypes.pointer(libvect.Map_info()). For some reason, the value of mapset is fixed once VectorTopo is called. Any idea how to change the "hidden" global variable?


texts: Trying to automate clip for multiple polygons based on unique field ID?

texts:
I have two feature classes, one that contains all counties for 5 states and the other contains 90 polygons I need clipped only to their pertaining county boundary, but they overlap/ cross the county boundary (See image below).  Both feature classes have a field with a unique 5 digit ID for each county as well. Being that I am relatively new to Python, is there a way I can use a loop or searchcursor to clip each of the 90 polygons to their respective county boundary using their 5 digit ID?

*The red rose colored polygons show the overlapping polygons I need to clip and the tan colored polygons show what I need the final product to look like.


texts:
I'm completely new to GIS and i'm trying to work my way into this. My goal is to integrate a simple map created using QGIS with my asp.net web mvc3 application.
The main objectives would be to show the map on the application as well as performing some operations with the different points and lines (points of interest and roads respectively).

Can anyone point me in the right direction on how to achieve this?


texts:
Is there a resource for open data for the City of Montreal?

I am specifically looking for building footprints.


texts: R spatial: Erase one polygon from another: correct use of `st_difference`?

texts:
I am trying to erase one shapefile from the other, similar to ArcGIS Erase tool:

This worked pretty well with rgeos::gDifference(spdf1, spdf2), which needs as input geometry of SpatialPolygonDataFrame.

Now, I want to switch from SPDF files to sf or sfc objects. But, st_difference does not keep a not overlapping geometry. Instead, it keeps buffer minus one :

Instead, I want to keep part encircled in blue:

How to correctly Erase features using sf objects? I tried tools st_difference, st_sym_difference or using features st_geometry(sf) for operation, but I get to have the same, for me unwanted results. Also, I found a suggestion of st_erase function:

st_erase = function(x, y) st_difference(x, st_union(st_combine(y)))

But using it on my data erased <- st_erase(buff, u) generates error:

`Error in CPL_geos_op2(op, st_geometry(x), st_geometry(y))   Evaluation error: TopologyException: Input geom 1 is invalid: Self-intersection at or near point`

Here is my example:

# Load data
shp = system.file("shape/nc.shp", package="sf")

my.sf <- st_read(shp, quiet = TRUE)

# Convert crs to projected system to make buffer
my.sf.web<- st_transform(my.sf, 3857)

# Subset the data to create two independent shps
i = 10

# Split datasets in two files
one  = my.sf.web[i, ]
left = my.sf.web[-i,]

# Create buffer
buff = st_buffer(one, 35000 ) # distance

# CHeck which polygons overlaps with my buffer
out.overlap = st_overlaps(buff, left)

# Subset the polygons that overlaps with the buffer
nbrs.buff <- left[st_overlaps(buff,left)[[1]],]

u <- st_union(st_geometry(nbrs.buff), st_geometry(one), by_feature = FALSE)
#u <- st_union(st_combine(st_geometry(nbrs.buff)),
 #             st_combine(st_geometry(one)))
int.buff.one = st_difference(buff, u)   # NOT WORKING HERE???


texts: Shortest path not recognising network as connected

texts:
I'm trying to use a grid network that I have created to find the shortest path between two points accounting for directional wind-speed.  The problem I'm running into is that the shortest path feature in QGIS doesn't seem to be able to turn corners in my network.  It can find the path for any points in a straight line, but any points that deviate in longitude or latitude it gives an error saying that there is no path.

I thought it might be a problem with my data so I just created a naive grid and I get the same result.

I'm pretty new to QGIS so I'm not sure what I'm doing wrong.


texts: How to identify segments with child layers in QGIS?

texts:
I'm working on a project which involves manually going through a city map and changing features of streets with planned construction in the future. The layers are:

scenario_network is just a road map
scenario_change is where the child layers (created in the scenario_network layer) are placed in an attribute table.

The problem is that the child layers don't have any spatial attribute (in the table at least) so I can't zoom to them or highlight them. But if I do choose a segment of the scenario_network layer then the child layer is visible, so it's obviously connected geospatially somehow.

I have been panning through the map looking for where changes need to be made via the creation of a child layer and now I'm stuck because I know I definitely have missed some segments.

My idea for finding these is to create a layer highlighting the scenario_network segments that have child layers (via the scenario_change layer).

How would I go about doing this? I tried virtual layers and SQL but that didn't lead anywhere (I have very limited experience with it though). Can anyone think of an easier way of doing this or how I would do it in a virtual layer?


texts: Combining attributes from multiple point shapefiles using PyQGIS?

texts:
I have seven point shapefiles with the same points (number and location) but different attributes. I would like to collapse all the attributes to a single point shapefile. I know that if I had only two, in QGIS I could simply join attributes by location.

Is it possible to perform the operation without manually operating it 7 times?


texts: Python - formatting path strings and checking if a path exists

texts:
I would like to use the following code to determine if a path exists.  The path I would like to check is being passed to my code via parameter on a ArcMap 10.0 tool dialog box.  The parameters data type is folder, this folder path is being passed along to sys.argv[2] in my code below.

{import sys

import os

if os.path.exists("%s"): %(sys.argv[2])

    pass

else:

    #Do Something Magical}

Normally I would not have any issue with this script if I were explicitly stating the folder path. For example any of the following three works well and does what I need:

os.path.exists("C:\\Data\\Hardwar\\Folder"):

os.path.exists(r"C:\Data\Hardwar\Folder"):

os.path.exists("C:/Data/Hardwar/Folder"):

In the preceding code what I am finding is that as the path i.e. (C:\Data\Hardwar\Folder) is being passed from my parameter to sys.argv[2] the first letter after \ is being escaped and rightfully so.
How do I format the path in sys.argv[2] to a python acceptable path format?


texts: How to delete obstacles (corduroy road) from DEM in ArcMap?

texts:
I have a DEM which looks like this:

The narrow longish lift running from north to south is a corduroy road (hope this is the correct word for "planks which allow people to cross a mire without getting their feet wet"):

The water can flow beneath the corduroy road without any problems in real life. Unfortunately GIS isn't aware of that because it is included in the DEM. This leads to wrong calculation of flow accumulations...

...and watersheds:

How can I modify the DEM to not include the wooden corduroy road anymore? Is there a way to adapt this area to the elevation of the surrounding cells?


texts: I'm starting a new project and it's the first time I work with satellite imagery. Would anyone care to explain how to obtain the azimuth angle from the CORNER_ X/Y or the latitude/longitude data in the MTL file? I've seen it in other posts and I still don't get an idea on how to do it!


texts: GeoTools FeatureCollection to Filter (make Filter from a FeatureCollection)

texts:
I have a FeatureCollection and I want to make a Filter of them. One way is that I may use FilterFactory#id(Set<Identifier> set) to make a filter.

FilterFactory ff = CommonFactoryFinder.getFilterFactory();
Set<String> idSet = DataUtilities.fidSet(collection);
for(String s : idSet) {
   fidSet.add(ff.featureId(s));
}
Filter filter = ff.id(fidSet);

Is that the best way?
How can I do that? How can I get rid of the for loop?


texts: Getting Latitude and Longitude using GPS Averaging app on android phone?

texts:
I am trying to get latitude and longitude of radio stations across my country (Liberia) using an Android phone. I downloaded GPS Averaging but I keep getting an error which says:

  NO GPS SIGNAL

How can I use an Android phone to get Lat/long?


texts: How to create a custom projection of PRS92 and UTM 51N for the Philippines?

texts:
Possible Duplicate:
  How to define new custom projections in QGIS?

How do I create a customized CRS parameter in quantum GIS? I'm try to create a projection of PRS92 and UTM 51N. This projection is for the philippines. Thanks!


texts: Why does export to AI rasterize all my vector layers?

texts:
I have no raster layers in my map document and no transparencies. Yet the map is rasterized when exported to AI.  (Map frame and coordinate grid are vector graphics but everything in the map itself is a single raster image)

I've exported maps to AI before and I did not have this problem.  This time the map is quite large (ANSI E @ 34"x44") Perhaps that is the problem?

I know that all layers below a raster layer get rasterized in the output, any transparent layers and layers below a transparent layers.
What are the other factors that will cause the AI exported to rasterize all the layers?


texts: Can TextSymbolizer font size be set as a function of the scale?

texts:
The standard behaviour when rendering WMS layers is to keep the text size across all scales and then filter out colliding labels so that the text remains readable, although delivering incomplete information.

Now, I'd like to invite the user to zoom in when he wants to actually read the labels while keeping the overall view on all data (i.e. very small, unreadable text labels) when zooming out.

I know that the simplest way to render scale-based elements is to use the  and  elements on rules, but that will end up in tens of rules, which I'd like to avoid.

The idea is then to use a function to define the text size, something like:

<TextSymbolizer>
     <Label>
       <ogc:PropertyName>name</ogc:PropertyName>
     </Label>
     <Font>
       <CssParameter name="font-family">Arial</CssParameter>
       <CssParameter name="font-size">
           <function name="get_number_between_1_and_14_depending_on_scale" />
       </CssParameter>
       <CssParameter name="font-style">normal</CssParameter>
       <CssParameter name="font-weight">bold</CssParameter>
     </Font>
</TextSymbolizer>


texts: Change number of cells in raster using GDAL?

texts:
i have 5 raster files and i want to merge them to one file with exact 50x50 cells because i have an R script to process it later.

I tried the ArcGIS function "mosaic to raster" but it delivers a raster with 70x107 cells and seems not to have any options for entering the number of cells.

Is there any possible way to transform it from 70x107 to 50x50 cells?


texts: Where are replicas stored in the Geodatabase?

texts:
I'm trying to verify that "unregistering" a replica from the Manage replicas dialog does, in fact, delete the replica.

I looked for a table pertaining to replicas, but all I see is GDB_REPLICALOG.  I was expecting some table with one row for each replica.

What table in the geodatabase is used to create the list shown in this dialog?


texts: python.multiprocessing and "FATAL ERROR (INFADI) MISSING DIRECTORY"

texts:
While trying to do multiprocessing with arcpy, I am occasionally running into this error:

FATAL ERROR (INFADI)
MISSING DIRECTORY

I have no clue what is triggering this error, and it crashes the python process, making it impossible to get a traceback on it. It occurs while writing final raster output from a lengthy sound model.

It is sometimes accompanied by an error

Unable to write BND file for %TEMP%\ras####

Where %Temp is parsed correclty and #### is some random 4 digit number. This is unusual because each process has its own workspace, which is where most files should be written.

The problem is not the input data... I can rerun the program on the failed inputs and it will run correctly.


texts: How to reverse / invert / switch X and Y coordinates in OpenLayers 3+?

texts:
In OpenLayers 2 you could pass additional paramater for layer options to reverse X and Y coordinates order in BBOX parameter for WMS GetMap request.

var layerOptions = {
    ...
    yx: {'EPSG:3346' : true}
}

How to do the same with OpenLayers 3+? I am actually using OpenLayers 6


texts: Opening multiple hyperlinks in one point directly from QGIS

texts:
I have an enormous shapefile and each point has about twenty different attributes. About five of these twenty are hyperlinks.

Is there anyway to open these directly from selecting a point in QGIS?

For example, in ArcGIS Explorer, you can click on a point, look at the point's attributes, click on the hyperlink, and it will open adobe/autocad/etc.

I installed hot links plugin but couldn't figure out how to use it, let alone any information about it online.


texts: Select and list all the adjacent features of a feature in ArcGIS

texts:
I have a shapefile of the Zips of California like the attached image. What I want is to select the adjacent/neighboring polygons (those touch the boundary) of each polygon in ArcMap and want to create a list of the Adjacent polygons for each polygons to use in Excel. I know there is select by location option that can be used to select the polygons that touches a polygon. But since I have almost 1700+ zip code polygons how can I do that easily without doing it one by one. For Example

in this image I want to list all the neighboring zips polygon for "93208" (The big pink Polygon in the rectangle box)  may be in another field like (93285, 93250, ...........) and then export to Excel. The main point here is to know how can do it at once for all the zips.
Is that possible in ArcMap?


texts: Developing tools for ArcMap 9.x and 10.x

texts:
I've been asked to start developing something for ArcGIS 10.x, but here is the problem: in my computer I already have the SDK and ArcMap 9.3.1 installed.

That means that I need to uninstall it before installing 10.x. My problem lies that I still work with customers that uses 9.3.1 and this is the first one with 10.x.

What strategies are you guys using for targeting both platforms? My initial idea is to use virtual machines, but that is a pain.

Also, what if I throw some ArcGIS Engine development? Do I still need separate boxes?

Any other options?


texts:
I'm developing an ExtJS3.4-GeoExt1-OpenLayers2.12 GIS application.

For basic functionality I need to filter layers to get specific data from a Geoserver WFS layer.

Filter is done through the variable myVar as a filter value as it follows:

First Filter:

customFilter = new OpenLayers.Filter.Logical({
   filters: [
       new OpenLayers.Filter.Comparison({
           type: OpenLayers.Filter.Comparison.EQUAL_TO,
              property: 'myCode',
              value: myVar
       })
    ]
 });

Then the WFS Layer:

wfsLayer = new OpenLayers.Layer.Vector("LayerName", {
      protocol: new OpenLayers.Protocol.WFS({
           url: "http://localhost:8080/geoserver/wfs",
       featureType: "LayerName",
       featureNS: "http://localhost:8080/project",
       featurePrefix: "schema",
       geometryName: "the_geom",
       outputFormat: "json",
       readFormat: new OpenLayers.Format.GeoJSON(),
       srsName: 'EPSG:25831',
       defaultFilter: customFilter
    }),
    strategies: [new OpenLayers.Strategy.Fixed(),
        myStrategy
    ]
});

And add it to the map:

map.addLayer(wfsLayer);

This works with a pre-set myVar variable before running the app. My idea is that when myVar is changed dinamicaly in my app (this is done), wfs layer updates its filter value too so map data is updated.

I've tried refreshing layer as myLayer.refresh() when myVar has been changed on my app but it still takes the initial myVar value so data in the map does not change.

Anyone knows?


texts: Getting vector layers to appear in map rendering?

texts:
I am using QGIS 2.18.7 on Windows 7. I am attempting to write a pyqgis script that will create a map rendering and save it, using a raster layer, a polygon layer, a line layer and a point layer. The polygon layer and the raster layer are already in the project at the time the script is run. The point layer and line layer are created within the script

The problem I am running into is that in the rendering, only the raster and the line layer appear - the point layer and the  polygon layer do not seem to appear in the rendering anywhere, and the line layer does not have the proper symbology used.

I am currently using QgsMapRenderer to do this operation.

from qgis.core import *
from qgis.utils import *
from qgis.gui import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import os.path

##Map_Save_Folder=folder
##Map_Save_Name=string roadmap

# Create save file location
mapName = "%s.png" %Map_Save_Name
outfile = os.path.join(Map_Save_Folder,mapName)

# Create point and line layers for later
URIstrP = "Point?crs=EPSG:3035"
layerP = QgsVectorLayer(URIstrP,"pointsPath","memory")
provP = layerP.dataProvider()
URIstrL = "LineString?crs=EPSG:3035"
layerL = QgsVectorLayer(URIstrL,"linePath","memory")
provL = layerL.dataProvider()

# Add points to point layer
feat1 = QgsFeature()
feat2 = QgsFeature()
feat3 = QgsFeature()
feat1.setGeometry(QgsGeometry.fromPoint(QgsPoint(5200000,2600000)))
feat2.setGeometry(QgsGeometry.fromPoint(QgsPoint(5300000,2800000)))
provP.addFeatures([feat1, feat2])

# Add line to line layer
feat3.setGeometry(QgsGeometry.fromPolyline([feat1.geometry().asPoint(),feat2.geometry().asPoint()]))
provL.addFeatures([feat3])

# Set symbology for line layer
symReg = QgsSymbolLayerV2Registry.instance()
metaRegL = symReg.symbolLayerMetadata("SimpleLine")
symLayL = QgsSymbolV2.defaultSymbol(layerL.geometryType())
metaL = metaRegL.createSymbolLayer({'width':'1','color':'0,0,0'})
symLayL.deleteSymbolLayer(0)
symLayL.appendSymbolLayer(metaL)
symRendL = QgsSingleSymbolRendererV2(symLayL)
layerL.setRendererV2(symRendL)

# Set symbology for point layer
metaRegP = symReg.symbolLayerMetadata("SimpleMarker")
symLayP = QgsSymbolV2.defaultSymbol(layerP.geometryType())
metaP = metaRegP.createSymbolLayer({'size':'3','color':'0,0,0'})
symLayP.deleteSymbolLayer(0)
symLayP.appendSymbolLayer(metaP)
symRendP = QgsSingleSymbolRendererV2(symLayP)
layerP.setRendererV2(symRendP)

# Load the layers
QgsMapLayerRegistry.instance().addMapLayer(layerP)
QgsMapLayerRegistry.instance().addMapLayer(layerL)

# Start the map rendering
visImg = QImage(QSize(1600,1200),QImage.Format_ARGB32_Premultiplied)
# Background color
visColor = QColor(255,255,255)
visImg.fill(visColor.rgb())
# Create Painter
visPainter = QPainter()
visPainter.begin(visImg)
visPainter.setRenderHint(QPainter.Antialiasing)
visRender = QgsMapRenderer()
# set rendering window
layerList = []
for layer in QgsMapLayerRegistry.instance().mapLayers().values():
    layerList.append(layer.id())
visRender.setLayerSet(layerList)
# set viewing window
visExtent = QgsRectangle(layerP.extent())
visExtent.scale(1.25)
visRender.setExtent(visExtent)
visRender.setOutputSize(visImg.size(),visImg.logicalDpiX())
visRender.render(visPainter)
visPainter.end()
visImg.save(outfile,"png")

When I run this script, the QGIS browser window looks like - the polygon vector layer (the purple thing) is clearly visible:

However, the image that is saved looks different. The polygon vector layer is nowhere to be seen, and the line and point layers do not match their symbology:

How do I get the vectors layer to show up properly in the saved image?


texts: Azimuth and Distance, NumericalDigitize, Numerical Vertex Edit, XY tools and other plugins are not on QGIS Plugin Manager version 2.0.1

texts: Will these plugins no longer be available in QGIS 2.0.1?


texts: Batch PyQGIS3 NDVI calculation yielding skewed outputs

texts:
In a previous post, I thought I'd cracked a problem running a script with a batch NDVI calculation on some 16bit unsigned ENVI .hdr data cubes:
from qgis.analysis import QgsRasterCalculatorEntry, QgsRasterCalculator
from qgis.core import QgsProject

lddLrs = lddLrs = [l for l in QgsProject().instance().mapLayers().values() if isinstance(l, QgsRasterLayer)]
    path = "/desired/output/location"
    for lyr in lddLrs:
        entries = []
        r = QgsRasterCalculatorEntry()
        ir = QgsRasterCalculatorEntry()
        r.ref = 'r@121'
        ir.ref = 'ir@192'
        r.raster = lyr
        ir.raster = lyr
        r.bandNumber = 121
        ir.bandnumber = 192
        entries.append( r )
        entries.append( ir )
        calc = QgsRasterCalculator( '(ir@192 - r@121) / (ir@192 + r@121)', path + lyr.name() + "_c3_ndvi.tif", 'GTiff', lyr.extent(), lyr.width(), lyr.height(), entries )
        calc.processCalculation()

However, the outputs are all dark with low resolution and the statistics are off. I'm thinking there some settings in the calculation that need instruction but lost as to what it might be?
If I run the same NDVI calculation in the QGIS calculator GUI I get a clear image. No adjustments in the symbology seem to help.


texts:
I am trying to export (Excel, XML or PDF formats) WMS feature information using the following tools:

1.- GeoServer.-Provides a SQL statement which generates a WMS layer, based on polygon data.

2.- PostGIS.-Provides the functions to GeoServer SQL.

3.- Leaflet.-To show the results on a map viewer application.

I have seen how to do something like that with OpenLayers but I am developing with Leaflet and I don't know if it is possible.

To realize, the final objective is to export the information from a layer but the limit is another layer which is a polygon.


texts: How can I insert new records to an ArcSDE feature class from a view in ArcSDE

texts:
I am wondering how I can both insert new records from a view to a feature class and update data that may be newer in the view than in the feature class. I have been fumbling around in modelbuilder and arcpy and haven't made any significant headway yet. I need to be able to export the model or script so that it can be run as a recurring job.

Thanks!