texts: Marker symbols from a WMS not behaving with a rotated data frame?

texts:
I have unchecked "Rotate marker symbols with dataframe" in ArcGIS, which works as normal for marker symbols from locally sourced shapefiles, however, the WMS layer marker symbols do not respect the setting.

Can this be fixed in the GIS software's settings, or possibly in the map server file that defines the WMS symbols?


texts:
I have two geeky passions while driving: recording GPX data to upload to OSM as well as recording on board videos like this one. Since these kind of videos are sort of boring for others to watch I was wondering if maybe there's an application out there to convert the track data into a video which I could then overlay over my original recording showing real time stuff like time of day, speed, elevation, etc. Basically a HUD. If there was a way to show part of the map I'm driving through that would be dreamy.

Do you know of such a piece of software?


texts: Working with multiple workspace in Arcpy

texts:
I would like to work with 3 different workspace.

One folder (D:\stegdq\rasters) contains only rasters, this is satellite images folder, I would like to read only;
one file geodatabase for the temporaly files (D:\temp.gdb);
and one other gdb for the results - arcpy.env.workspace=r'D:\tes\gfrd\ujhateq\result.gdb'.

I would like to write one script containing every different steps in all, but how can I change between 3 workspaces? Now I have to run one by one, and I have to set workspace again. I'm a beginner in ArcPy.

input poligon (from results.gdb) bufferig-"25 Meters" (temp);
then ListRasters (from the rasters folder); set env.snapRaster rasters[0];
input elevation_point.shp (from the result.gdb) with env.snapRasters interpolating (temp);
sa.ExtractByMask rasters[0] (from satelite image with temp buffer); from these extract image RasterToPoint_conversion shp (temp) and RasterToPolygon_conversion shp (result);
with temp_point ExtractMultiValuesToPoints (all satellite images from rasters folder); and extractValueToPoint (from elevation raster-temp)
do some calculation in the attribute table (in the temp point table);
join temp_point values to the polygon (from result.gdb)

Is it possible to handle this workspace change in one script? (ArcGIS 10.6)


texts: Using CheckCapabilities of Server Object Extension?

texts:
I am testing a sample project  for SOE.

The constructor of this sample SOE is :

public NetSimpleRESTSOEWithCapabilities()
        {
            soeName = this.GetType().Name;
            reqHandler = new SoeRestImpl(soeName, CreateRestSchema(), CheckCapabilities) as IRESTRequestHandler;
        }

and the CheckCapabilities method:

private bool CheckCapabilities(string configCapabilities, string requiredCapability,
          object resourceOrOperation, NameValueCollection boundVariables, JsonObject operInput, string requestProperties)
        {
            if (string.IsNullOrEmpty(requiredCapability))
                return true;
            else
            {
                if (string.IsNullOrEmpty(configCapabilities))
                    return false;
            }

            string caps = configCapabilities.ToLowerInvariant();

            HashSet<string> configCaps = new HashSet<string>(caps.Split(','));
            if (!configCaps.Contains(requiredCapability))
                return false;

            return true;
        }

I need to know what does this method do exactly?

I couldn't find any resources in ArcObjects documents.


texts: Intersecting Polygons to Build Boundary Hierearchy using PostGIS

texts:
I have a set of polygons that are stored flat in a table (these are OSM admin boundaries extracted through Osmium and osm2pgsql). Each polygon has one record for it. However, these polygons form hierarchies.

How do I identify these hierarchies and store only one polygon (the smallest) with the attributes for its parents using PostGIS?

This is how the data looks like:

Currently, the data is stored as:

A
AA
AB
AC
AB1
AB2
AC1
AC2
AC11
AC12
AC21
AC22

I want to go from that to:

AA, A, geom of AA
AB1, AB, A, geom of AB1
AB2, AB, A, geom of AB2
AC11, AC1, AC, A, geom of AC11
AC12, AC1, AC, A, geom of AC12
AC21, AC2, AC, A, geom of AC21
AC22, AC2, AC, A, geom of AC21

In a real world example,

AC11 could be Boston, AC1 Suffolk county, AC Massachusetts and A United States.

The only relationship these polygons share is a spatial one. The solution needs to be able to be applied at scale. For example, all of the administrative boundaries of the US.


texts:
I have a problem with refreshing layers.  I have WMS and WFS layers from one source. I edit WFS and after do wms_layer.redraw(true) but the layer redraws only after zoom in or zoom out.

Same with WFS. I have wfs_layer.visibility=false and do wfs_layer.visibility=true wfs_layer.refresh({force:true}). And layer refreshes only after zoom in or zoom out.

For doing these operations do I have to do something special?


texts: raster statistics by line shape (vector)

texts:
I have a georeferenced area where I created 7 raster maps (classified with suitability values from 1 to 5) as I have 7 factors to check e.g. natural reserves, floods, slopes etc. From there I did a weighted overlay raster for the final evaluation. In this area I have a railway corridor (represented by a line) which I buffer at 30 meters. I want to calculate a suitability score from the cells that this buffer contains. For example if the buffer contains 10 cells with value 1, 10 with 2, 20 with 3, 20 with 4 and 40 with 5, the final score will be: (10*1)+(10*2)+(20*3)+(20*4)+(40*5) = 370 points of suitability.

How can I count the number of cells from each value this buffer "touches" and the final sum? If in some way I could clip the raster with the buffer, the new raster of the buffer should contain "value" and "count" and I suppose I could do it from there.
I don't know if I need to do the buffer or it can be done with the line shape, since the raster already contains cells of 30m*30m.


texts: Clipping tif with polygon in ArcGIS Desktop?

texts:
I'm trying to clip a .tif (Ordnance Survey download file) with a parish boundary polygon, but ArcGIS Desktop 10.3.1 won't let me drop the .tif into the Input Features box: and gives me this error message:

  One or more dropped items were invalid and will not be added to the control.

With no explanation of how the file is invalid. I don't know how to proceed.


texts:
I am publishing postgis data using geoserver with 4 dimensions including elevation.

How to show this layer in cesium 3d globe with elevation or displacement value?


texts: "AttributeError: Cannot parse SetParameterAsText" but my indexing is correct

texts:
I think I have all my indexing correct.

I have 8 parameters in my script tool. 7 input and 1 derived output. Indexing for GetParameterAsText starts at 0, so logically my SetParameterAsText should have an index of 7, considering my output parameter is the last one in the list.

I use sys.argv to set my input parameters in the script. This index starts at 1.

#Get all the inputs from the user
year = sys.argv[1] #GetParameterAsText(0)
state = sys.argv[2] #GetParameterAsText(1)
cipArea = sys.argv[3] #GetParameterAsText(2)
layerString = sys.argv[4] #GetParameterAsText(3)
renderer = sys.argv[5] #GetParameterAsText(4)
orientation = sys.argv[6] #GetParameterAsText(5)
emailAddr = sys.argv[7] #GetParametersAsText(6)

#Do a ton of stuff

outputPath = os.path.join(arcpy.env.scratchFolder, "Map.pdf")
outputPDF = arcpy.mapping.ExportToPDF(mxd, outputPath)
arcpy.SetParameterAsText(7, outputPDF)

Error I receive:

  Traceback (most recent call last):
  File "D:\NET_Projects\HabitatMapGPServices\PrintHabitatMaps\PrintHabitatMaps.py", line 234, in
  arcpy.SetParameterAsText(7, outputPDF)
  File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy__init__.py", line 670, in SetParameterAsText
  return gp.setParameterAsText(index, text)
  File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\geoprocessing_base.py", line 231, in setParameterAsText
  self._gp.SetParameterAsText(*gp_fixargs(args, True)))
  AttributeError: Object: Error in parsing arguments for SetParameterAsText

My input window:

How my output is set up:


texts: Renderd "planet_osm_polygon" not exists?

texts:
I'm trying to create my map server. Importing a planet with osm2psql was perfect, I installed nominatim and is working too. I installed the libapache2-mod-tile packet, caring about to not create the database. After the configuration, Renderd make this error:

An error occurred while loading the map layer 'default':

  ERROR:  relation "planet_osm_polygon" does not exist

I'm sure that the database wasn't corrupted, as nominatim is working like a charm.

There is a way to recover this missing table?


texts: QGIS Plugin to show data from Postgres Database using PyQGIS , QT Table Widget

texts:
I'm trying to build a plugin in QGIS 3.0 which will load a table from Postgres DB and show the data in QtableWidget using PyQT and PyQGIS.
I have created the form in QT designer :

In my main plugin python file , I have added the code of connecting to postgres DB as well . But How do I populate the data into the tables of the QtableWidget using pyQGIS .


texts: How to use the 'File' type inputs in QGIS modeler?

texts: I would like to add a field to all shp-files in a directory and calculate the area. I tried with the parameter "File" but didn't find a way to conncet this input to the other algorithm/operators.


texts: Getting Multilinestring Z to stand on background using Mapbox

texts:
I added to Mapbox, a 3D not extruded object by geojson: a Linestring Z. However, it's stand on the background.

Is it possible to put this object at the height that is defined?


texts: distance calculations splitting highways km, toll ways km, and other roads km

texts:
Till now I have been able to use  MapPoint  or  Google Maps for a lot of things, specially directions and road trips distance calculations.

Today I need again to perform (massive) road trips distance calculations.
But I also need to split each distances in three components:

highway km
toll roads km
other roads km
total distance = 1 + 2 + 3

I could not see how to get these information from the MapPoint API or from the Google Map API.
The directions that I could get from them seem unsuitable to identify  highways  or  toll roads.

Would you know how I could solve my problem?
I have at least 50000 distances to calculate.
My preference would go to using Google Maps.
But I could use any other system as long as it is for free or very cheap.


texts: Writing python script to select attributes not in growing table with over 4000 values?

texts:
I am trying to write a Python script that will automate the process of comparing files within a directory to the id of a feature class, and then create (or refresh) a layer with only the features that do not find a file within the directory with their id.

I have created a Python script that almost successfully does this (works with test data) but my problem seems to be that the directory it is looking at contains over 4000 files (which appears to be SELECT BY ATTRIBUTE's limit) and will continue to grow in size.

Here is an example of the script I am trying to use:

import arcpy
import os

jpg = os.listdir(directory location)
photos =([s.strip('.jpg') for s in jpg])

arcpy.CopyFeatures_management(feature class location ,r"in_memory/headphotos")

tmp_layer = arcpy.mapping.Layer("in_memory/headphotos")

arcpy.SelectLayerByAttribute_management(in_layer_or_view=tmp_layer,selection_type="NEW_SELECTION", where_clause=' "ce_id" NOT IN' + str(tuple(photos)))

arcpy.CopyFeatures_management(tmp_layer,new layer)

You will notice that I use str(tuple(directory reference) as my current mode of cycling through the list of 4000+ files.

Is there a way to get past the problem of SELECT BY ATTRIBUTE only managing to contain some not all of the files?

Is there a way that I could possibly be doing this more efficiently?


texts: Field Calculator Expression Assistance - Return Value Based on a Text String in Another Field

texts:
I'm still in my infancy learning Python (also using arcpy), and I've got a field calculator expression that I am having trouble formatting. Hoping someone can help... I am using ArcMap 10.5.

I am trying to have a calculation return a value of "1" if a specific word is found in another cell (text string). So for example... A cell named "BODY_PART" contains the following string "BACK ARM LEG", I would need the expression to return a value of "1" into a new/blank field (already created) based on looking for the word "ARM".... In my mind, the equation would look something like this: If "BODYPARTS" contains "ARM" print "1" else print "0"(wrong syntax, I know).

Here is how far I got...

**in the Pre-Logic Script Code:

def findWholeWord(leg) :
  if 'LEG' in !BODYPARTS! :
    print('1')
  else :
    print('0')

This is giving me a Syntax error on Line 2.


texts: Importing KML file to OpenLayers - Projection System

texts:
I know that many have this problem,but none of the answers helped me so i suppose it's a different problem.This is my code:

    <!DOCTYPE html>

        <title>Lesson Javascript-OpenLayers-WMS</title>

Here everything works fine instead of the KML loading part. I have tried running the html from a localhost (IIS 7),running different types of projection (2100,4326),running KML files that others suggested that they work, uploading the KML (GoogleDrive,DropBox) and load it from online, even different loaders like the GML Loader using as format .KML .

What am I doing wrong and as an extra question is the conversion from different types of projection system happening automatically like in Google Earth?


texts: How to get Geography data to GeoJSON in PostgreSQL?

texts:
I am using PostgreSQL database and there is a field in a table(area), i.e., public.geography(Points,4326). It contains below type of records

"0101000020E6100000BA83D89942334540780B24287ED051C0"

I am using ST_AsGeoJson(), to get the GeoJSON through above types of records.

My database is connected and I am using a query to fetch result, i.e.,

$query="SELECT  ST_AsGeoJSON(geog) FROM area";

But I am getting below warning and not getting any results

Warning: pg_query(): Query failed: ERROR: function st_asgeojson(public.geography) does not exist LINE 1: SELECT ST_AsGeoJSON(geog) FROM public.area ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. in /home/domain/public_html/sg_database.php on line 20

How can I solve it?


texts:
I need to add stores (shapefiles) to geoserver running on localhost:8080. In data_dir/data I have directories containing shapefiles. I add them as workspaces with Namespace URI set to localhost:8080/geoserver/data/*name_of_the_dir*/.

When I try to add new store, the URL field in Connection Parameters doesn't open though and I can't choose which shapefile I want to add. I suppose the only error might be in localhost:8080/geoserver/data/*name_of_the_dir*/. I tried many different variations of this path, none of them worked for me.

So the question is rather simple (hope the answer too): How do I add a store to a workspace when working in localhost? Thanks for any help.

PS: The geoserver I'm working on is meant to run offline, thus I can't enter web URLs in Namespace URI.


texts:
A coworker of mine was recently given permission to import our local county government's GIS data into OpenStreetMap. I've made single edits on the OpenStreetMap site before, but I have never imported entire datasets.

Where do we start?

Also, are there any tools that help automate a task like this?

I'm assuming there should be a decent amount of custom scripting involved to handle the local GIS's schema. I would like to see how other people have handled this problem.

It's also likely that we could get data from other local governments in the future, so if there is anything that would help relieve the burden of building a custom import system multiple times, I would be interested.


texts:
I was working with Pollution data from OMI i.e. NO2 & O3.
I need to find the correlation between the two rasters.
I need pixel-based correlation, but in ArcGIS Pro, I could only find point-based correlation.
How do I do pixel-based correlation for the rasters?


texts: How to increase capacity of osrmRoute in osrm package in R

texts:
I had plotted the routes of some locations. The maximum number of locations allowed for routing using the OSRM package in R is 100 coordinate points.

How can I extend beyond this restriction?


texts: I need to delete everything (faces, nodes, edges, anything I'm not thinking of) from a PostGIS topology, but I want to keep my database schema (schemas, tables, columns, sequences, etc.) intact. Is there a simple way to do that? If not, what elements do I need to delete and what functions/queries would I use to delete them?


texts: Changing color of specific feature(s) with PyQGIS?

texts:
Imagine that the lines that i have drawn is simple pipeline network, represented by some simple lines in a vector layer.

How can i define a script that changes the color of only specific lines to "red"?

I tried to write a script from google sources but i failed dramatically. I managed to change the color of the all the lines but i need to specify the "red" color. So far my script is this, but its not working:

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

def change_color():
    active_layer = iface.activeLayer()
    """renderer = active_layer.rendererV2()"""

    renderer = QgsCategorizedSymbolRendererV2()
    active_layer.setRendererV2(renderer)
    symbol = QgsSymbolV2.defaultSymbol(active_layer.geometryType())
    symbol.setColor(QColor(Qt.red))
    active_layer.setCacheImage(None)
    iface.mapCanvas().refresh()
    iface.legendInterface().refreshLayerSymbology(active_layer)

change_color()

This is what i am looking for but with a script not manually


texts: Compare 2 layers for like point features

texts:
I am looking for a plugin for QGIS that can compare 2 layers and tell me which point features are not common to both and which features are separated by a distance of say plus 1 foot.

I am working on a project that we are collecting data on utility poles.  We have to collect 100,000 poles and want to compare the position to the company’s data base of positions for the 100,000 poles. I am thinking in the simplest form I will have, what I call my field layer of collected poles w/XY values and the utility supplied layer consisting of information, including XY values.

How do I compare the layers and identify which poles are 1) not common to both and 2) Not within say a foot of each other?

I have 3 situations where I need this;

A pole is not collected in the field because it no longer exists but the utility still has it in the data base
A pole is collected but is more than a foot away from where it is supposed to be.  We will need to re visit and determine if this a data collection error
New poles that the company does not provide data for.

I will be using a gps equipped with a laser and camera and my requirement is to take a picture of the id tag but the laser allows us to do this from a distance.  My problem is identifying when an operator collects data but not the utility pole but, say a house in the background.  This will result in the XY values being > than a foot different.  A foot is not my hard target just an example number.


texts: How to get pgrouting source and target value using openlayers 2/3?

texts: Is there anyone can teach me how to get the pgrouting's source and target parameters in openlayers 2/3? I plan to get those parameters by click the OSM map layer. Currently, I can only get the lonlat x and y values, but my this is not exactly what I need.


texts:
OK, I have no idea what's going on. I'm using a Mac and successfully installed pgRouting. I used osm2po on some data, which created a sql file. I imported the sql file into a pgRouting database and all is well, except the fact I only took into account routes for cars.

After Carsten helped me with configuring osm2po.config, I ran osm2po again that ran as expected.

From the terminal, I run the command:

psql -U [username] -d [dbname] -q -f "/Users/John/Desktop/osm2po-4.6.9/wmCar/wmCar/wmCar_2po_4pgr.sql

I was expecting it to be successful like last time, as to my knowledge the conditions are the same. However I get the error:

psql:/Users/John/Desktop/osm2po-4.6.9/wmCar/wmCar_2po_4pgr.sql:101739: ERROR:  INSERT has more expressions than target columns
LINE 2: ..., -2.0046492, 52.5307149, -2.0026647, 52.5310823, >'010200002...

With pgAdmin I look at the empty table that was created, and compared to the first sql file I imported, the new table was missing a column. That being geom_way. I find this odd as I haven't changed anything. I threw osm2po folder to the trash, and unzipped a new osm2po folder. To test whether it was going to work, I ran osm2po on the original pbf file with the original osm2po.config settings and tried to import that into the same pgRouting database. The error appeared again. For some reason, the last column, geom_way, isn't being added to the table.

Would anyone know why it's started doing this?


texts: GeoAlchemy: AttributeError: type object 'ColumnProperty' has no attribute 'ColumnComparator'

texts:
I installed GeoAlchemy using easy_install but when trying to import it returns the following:

  Traceback (most recent call last):
    File "", line 1, in
      import geoalchemy
    File "C:\Python27\ArcGIS10.2\lib\site-packages\geoalchemy-0.7.2-py2.7.egg\geoalchemy__init__.py", line 2, in
      from geoalchemy.base import *
    File "C:\Python27\ArcGIS10.2\lib\site-packages\geoalchemy-0.7.2-py2.7.egg\geoalchemy\base.py", line 242, in
      class SpatialComparator(ColumnProperty.ColumnComparator):
  AttributeError: type object 'ColumnProperty' has no attribute 'ColumnComparator'

How to fix this?


texts: Extracting some part of a satellite image using mask?

texts:
I'm trying to extract some part of a satellite Landsat-8 image. using another image.

I have the following satellite image:

and I want to keep only the areas from the satellite image which  are highlighted as green in the other image in below.
(white and green image is the crop data layer for the same location as my satellite image):

Basically saying I want to keep the corresponding green areas in my original satellite image and delete the corresponding white areas from the original satellite image which is shown at top.

How can I do that?


texts: Adding mapgrid to existing mapinsets in ArcObjects .Net (C#)

texts:
I am facing the problem to add a mapgrid to existing map insets created in a pagelayout at an earlier step. I can implement some code in a DLL loaded by reflection to add some operations like adding a north arrow, a legend or modifying existing elements of the pagelayout using an available interface.
Up to now I am able to get the created map insets and to create the map grid but I have difficulties to "link" them together.
Here is the code I tried:
   for (int i = 0; i < localMap.MapSurroundCount; i++)
   {
               IMapSurround mapSurround = localMap.MapSurround[i];
                if (mapSurround is MapInset)
                {
                    IMapInset mapinset = mapSurround as IMapInset;
                    IFrameElement frameElement = graphicsContainer.FindFrame(mapinset);
                    if (frameElement != null)
                    {
                        ICustomOverlayGrid mapGridCarroyage = new CustomOverlayGridClass();
                        ...
                        ... setting some properties for  mapGridCarroyage
                        ...
                        IMapFrame mapFrame = frameElement as IMapFrame;
                        IMapGrids mapGrid = mapframe as IMapGrids;
                        mapGrid.AddMapGrid(mapGridCarroyage);
                    }
               }

         }

mapFrame is always null but localMap.Mapssurround[i] is returning correctly an existing MapInset and frameElement is not null.
What is going on?


texts: Exported GPX shows reference points in Google Earth

texts:
My gpx files show reference numbers in Google Earth.

I have been exporting gpx files from single part ESRI shapefiles. The files work fine, only they show some sort of reference Points in Google Earth. This does not happen in Garmin Basecamp, Runkeeper, Viewranger or other apps.

To solve this I have tried:
1. comparing the textfile exported through ArcMap (which doesn't show ref points) and editing some things:
Removing  which changed the points to WPT001 etc.
Removing metadata which made no difference.
2. Selected "skip attribute Creation" which made no difference
3. Tried routes and tracks in different combinations

I know I can remove the references in Google Earth, however, as I export quite a lot of these files I would rather not need to do that. Any ideas for a simple solution?


texts: Select points outside of polygon in Google Earth Engine

texts:
I understand how to get the points that fall inside a polygon with GEE:
// Load a feature collection and a area of interest
var dataset1 = ee.FeatureCollection("link/to/any/point/dataset/on/gee");

// Define a region roughly covering the EU.
var eu = ee.Geometry.Rectangle(-26.367188,34.016242,35.332031,73.124945);
Map.addLayer(eu, {color: '000000'}, 'planar polygon');
Map.centerObject(eu);

// Filter the table geographically: only points in eu
var filtered = dataset1.filterBounds(eu);
print(filtered);
Map.addLayer(filtered, {}, 'default display');

How do I get all the points that are outside the polygon?
I've seen a topic here that discussed how to do this with polygons, but when implementing it, I don't get a featureCollection returned, but some weird data type like:
Filter.not
type:Filter.not
filter:Filter.intersects
type:Filter.intersects
leftField:.geo
maxError:ErrorMargin
rightValue:Polygon, 5 vertices

Assistance?


texts: Copy records from ArcMap, paste in Excel, wrong number of records

texts:
When I use ArcMap 10.3 and copy records (from attribute table) and paste to Excel I sometimes don't get all of the records pasted. Probably a limitation of cells or rows or something. Of course the alternative is to export data, but copy/paste is a bit faster.

My questions are:

Is this a known bug/error in ArcMap, or is it a problem in Excel?
Is there anyway to change a parameter or setting or such in ArcMap to get this to work?


texts: Different outputs from Clip_management and ExtractByMask

texts:
I have a question about clipping a part from a raster according to the extent of a polygon.
Should Clip_management and ExtractByMask create the same results if I set the "NO_MAINTAIN_EXTENT" option for Clip and the "snapRaster" option for Extract by Mask (to avoid any resampling)?

arcpy.Clip_management(raster, "#", outraster, "in_memory\shape_lyr", "-9999", "ClippingGeometry", "NO_MAINTAIN_EXTENT")

vs

arcpy.env.snapRaster = raster
outExtractByMask = ExtractByMask(raster, "in_memory\shape_lyr")
outExtractByMask.save(outraster)

If yes, why my two outputs still differ? See photo:

I can analyse that the method: Clip_management produced 3 values more than ExtractByMask (comparing two attribute tables) but could not identify where exactly.

Any ideas?

EDIT: I just found one of the 3 pixels (red), that was made by using Clip_management but not ExtractByMask. It's driving me crazy.

EDIT2: Im using ArcGis 10.4.1.
After a long time having no answer, I decided for myself that Extract By Mask is more accurate than Clip management!


texts: How can I associate one point layer to one line layer?

texts:
How can I associate in QGIS one point layer to one line layer

A sample scenario could be this one:

A point layer "Valves" and line layer "Pipelines"
Each layer should have its own set of attributes
A "pipeline" has to begin and end in one "valve"
A change in the "Valves" geometry implies a change in the "Pipelines" geometry, i.e., if I move a "valve", the "pipelines" connected to that node should follow the node wich are connected to


texts: Regional Large Scale Map Projection Choice

texts:
I am currently designing a geospatial product that will be primarily used for large and intermediate scales that cover an entire state of the US or more.

The UTM projection would be ideal because of its conformal properties.

But, I am not crazy about it for the product I am designing because of states that may encompass more than one UTM zone. Of course I could render all of the imagery in one zone or the other, but it seems problematic, especially for possibly combining the products together some day in the future into a national US dataset. My source data is in variety of projections, that I will be reprojecting to a common projection.

So I need to decide on my common server-side projection, and possibly a different projection for my clients (if needed but not desirable). Is Albers Equal Area a good choice?

EDIT: The product shall be in the form of topographic maps in both Large Scale (1:24k) and Intermediate Scales (1:63k).

EDIT: I should like my national projection to minimize distortion when projecting to a client projection, as I will have pre-rendered raster images - not just vector data, so I don't think geographic is best.

EDIT: Here is another way to ask the question (I'll figure the rest out on my own or ask as a second question). For a Large Scale topographic viewer, that could view across multiple UTM zones and multiple State Planes at any time depending on its center, what projection would you recommend serving to the view?


texts: How to batch interpolate many shapefiles to DEM

texts:
Here´s the problem: I have about 40 shapefiles of contour lines (type line) and I need to interpolate them to create DEM's (tiff, or better some grid format). To do so, some batch scripting would be nice but I just can't figure out a good way.

I could do it with the batch tools of QGIS (GRASS v.bspline would do the job), but I would need to set the parameters for EACH single run. Not very slick at all. So I tried to do it with SAGA CMD in a bash script, but the problem is that the interpolation function needs the input of the area extension and I don't really know how to code that again.

It´s my first real contact with coding for GIS or Python but I've programmed before in Matlab and know some Linux bash stuff so that should not be too much of a problem.

So can anyone help me with a simple way to batch script basically what the Interpolation Plugin of QGIS does?


texts: Arcpy scripts run time dialog keeps deactivating tkinter window

texts:
I'm using tkinter in my scripts to get field names of the user in case the hard coded field names were not found in the target feature.

it runs from python IDE, but when run from arcmaps toolbox the interface keeps refreshing making it impossible to focus on the input message box generated from the script.

Is there a way to keep focus on the generated dialog so the user can type in the information? I can post my script if needed. or is there less messy way to get a string value from the user?

I'm using something similar to this :

from Tkinter import *
import sys

class popupWindow(object):
    def __init__(self,master):
        top=self.top=Toplevel(master)
        self.l=Label(top,text="Hello World")
        self.l.pack()
        self.e=Entry(top)
        self.e.pack()
        self.b=Button(top,text='Ok',command=self.cleanup)
        self.b.pack()
    def cleanup(self):
        self.value=self.e.get()
        self.top.destroy()

class mainWindow(object):
    def __init__(self,master):
        self.master=master
        self.b=Button(master,text="click me!",command=self.popup)
        self.b.pack()
        self.b2=Button(master,text="print value",command=lambda: sys.stdout.write(self.entryValue()+'\n'))
        self.b2.pack()

    def popup(self):
        self.w=popupWindow(self.master)
        self.master.wait_window(self.w.top)

    def entryValue(self):
        return self.w.value

if __name__ == "__main__":
    root=Tk()
    m=mainWindow(root)
    root.mainloop()


texts: What geoprocessing tool to use for analysis of multiple line feature classes?

texts:
I have many line feature classes that I am trying to use in an analysis. For sake of the question I will just use a basic example.

I have a line feature class of State Roads for the state of Florida. I also have a line feature class that shows where the divided sections of roadway are. I would like to split the State Road lines using the divided roadway feature class while keeping the attributes for the divided roadway feature class.

In the picture below, the red lines represent the divided roadway feature class and the green lines represent the State Roads feature class. So I would like the green line to break into three segments using the red lines. I would like to retain the information in the table from both feature classes so I can easily discern where the divided roadways are along state roads, using 1 feature class.


texts: Installing QGIS 2.0 with the newest gdal and geos libraries

texts:
I want to install QGIS 2.0 on Ubuntu 12.04 LTS. I followed these steps until the final installation command.

Before I compiled gdal 1.10, geos 3.4.2 and grass 6.4.3 on my own.

In the synaptic package manager I marked qgis (2.0.1-2+precise1) for installation and I can see that the older libraries gdal 1.7, geos 3.3.8 are marked as well.

How can I build QGIS with the new compiled libraries?? I want to avoid that the old libraries will be installed as well.


texts: Using ArcPy with ArcGIS Pro and ArcGIS Desktop on same machine?

texts:
I'm just trying out ArcGIS Pro for the first time and I had to change my PYTHONPATH to python34

ArcGIS Pro is now working without crashing every time I open the Analysis tab... However now when I try to run a process in ArcMap 10.3.1, I get various python errors; on tools that worked a half hour ago with the same exact data inputs.

Is this a conflict in python versions since ArcGIS 10.3.1 uses 2.7?

Is there a way to have ArcGIS Pro and ArcGIS 10.3.1 running simultaneously on the same machine, even though each utilizes a different python version?


texts: Count number of Points within a varying distance

texts:
I have a set of points (roughly 500,000 houses), and I would like to compute how many other points (sea buoys) are within a radius of each house. The search radius for each house is its distance to the horizon based on its elevation, so the search radius is not fixed (as with other tools) and is different for each house.

Is there a tool/method which would give an output of how many sea buoys are within the distance to the horizon of each house. so a column for house ID's and a column for number of sea buoys within its distance to horizon (I have already generated dist_horizon for each house).

I am using Arcmap 10.3 and I have a license for all tools as far as I know.


texts: Assigning CRS to shapefile when it doesn't have one, in R?

texts:
I think that by using readOGR to import a shapefile renders worthless to put proj4string to the script since if any coords are available in the shapefile, it will be transported through the readOGR.

Therefore, proj4string is expedient only if we use another import function for example readShapeSpatial (for polygons, lines or points) or by using readOGR, but in the case that the shapefile does not contain the coordinates/projection:

When checking if the shapefile has projection information and if it has not, should I add proj4string although I have put readOGR?


texts: Create QT variables using for i in range

texts:
I would like to create self variables using for i in range.

for i in range (1,50):
    name = "self.layoutG" + str(i)
    grid = QGridLayout()
    nameA = "self.layoutG" + str(i) + "a"
    gridA = QGridLayout()

I suspect this not a good way of doing it but I cannot predict how many QGridlayouts() I will need as it depends on the folder input the user puts in.

Will I be able to use these variables normally?

As after a number of tries it seems the variables don't seem to act the same way as stating the the variable names in a hardcoded way. I need to use variables in mutiple functions in the script which is why I've set them to self.

I am a beginner in QT.


texts: Creating custom address locator in ArcGIS Desktop?

texts:
It was 8 years ago when Esri published a famous "Customizing locators in ArcGis 10" whitepaper. They also gave us more than 50000 lines of magic Xml covering US address styles.

I tried to make a rather simple locator style file, removing everything I found unnecessary. After a week or more I had something between 400 and 600 lines of xml file that I pushed to Create Address Locator geoprocessing tool.

I've got "Error code 42". Nothing more. A good sense of black humour.

Do you have any piece of advice how to get more diagnostics?


texts: Count Points in Polygon not writing value

texts:
I have a "almost" running script found in StackExchange. The problem is that is does not write the result to the column 'count'.

What am I forgetting?

# Read the data.
polygons = gpd.GeoDataFrame.from_file('C:\code\polygon.shp')
points = gpd.GeoDataFrame.from_file('C:\code\point.shp')

# Make a copy because I'm going to drop points as I
# assign them to polys, to speed up subsequent search.
pts = points.copy()

# We're going to keep a list of how many points we find.
pts_in_polys = []

# Loop over polygons with index i.
for i, poly in polygons.iterrows():

    # Keep a list of points in this poly
    pts_in_this_poly = []

    # Now loop over all points with index j.
    for j, pt in pts.iterrows():
        if poly.geometry.contains(pt.geometry):
            # Then it's a hit! Add it to the list,
            # and drop it so we have less hunting.
            pts_in_this_poly.append(pt.geometry)
            pts = pts.drop([j])

    # We could do all sorts, like grab a property of the
    # points, but let's just append the number of them.
    pts_in_polys.append(len(pts_in_this_poly))

# Add the number of points for each poly to the dataframe.
polygons['count'] = gpd.GeoSeries(pts_in_polys)

print polygons

The result is

C:\Python27\ArcGIS10.5\python.exe "C:/Users/Bjorn ten Broeke/PycharmProjects/CountPointInPolygon/CountInPolygon_170615 - local.py"
   id  pts_p  pts_poly  count  \
0   1      0         0     12

                                            geometry
0  POLYGON ((8.704751258280005 50.33636457834147,...

Process finished with exit code 0

So it writes out the 12, that is correct. But when I open the polgon layer, the column is empty


texts: Python init code add value in field after creating folder

texts:
I wrote a Python init code for a form. It creates folder and subfolder if the value of a field is "Si".

# -*- coding: utf-8 -*-
import os
from qgis.core import *
from qgis.utils import *

from qgis.PyQt.QtWidgets import QWidget

def crea_cartelle(layer, idx, path):
  layer = iface.activeLayer()
  idx = layer.fieldNameIndex('codice_opera')
  folder = layer.fieldNameIndex('crea_directory')
  path = "\\\\xx.xx.x.xx\\dati_gis\\archivio_opere_tv\\"
  for feat in layer.getFeatures():
    attrs = feat.attributes()
    if attrs[folder]== "Si":
      if not os.path.exists(path + attrs[idx]):

        os.makedirs(path + attrs[idx]+os.sep+ attrs[idx]+"_documenti")
        os.makedirs(path + attrs[idx]+os.sep+ attrs[idx]+"_foto")

Well after creating folders I would like adding a code that inserts the hotlink values (es. path + attrs[idx]+os.sep+ attrs[idx]+"_foto") in fields "link_foto" an "link_document"

I have tried to add this code:

        layer = iface.activeLayer()
        feats = layer.getFeatures()
        field_index = layer.dataProvider().fieldNameIndex('link_foto')
        layer.startEditing()
        l_foto = "some text"
        layer.changeAttributeValue(feat.id(), field_index, l_foto)

layer.commitChanges()

But It returns an error for layer that doesn't recognize.
Any suggestions is welcome.


texts:
I'm looking for api that i can use to get informations about roads (lightning condition , road type or surface condition) it should take as an  inputs latitude and longitude .
I found Bing road data api that gives informations about road type but it takes two cities names and google roads speed limits is not free.


texts: How to polygonize raster to shapely polygons

texts:
I am seeking an open-source python solution to convert raster to polygon (no ArcPy).

I did know the GDAL function to convert raster to polygon, and here is the manual: http://pcjericks.github.io/py-gdalogr-cookbook/raster_layers.html#polygonize-a-raster-band

Nevertheless, I expect that the output can be shapely polygons or any object, temporarily in memory, not saved as a file. Is there any package or code to handle this issue?

If the raster has been processed in a numpy array, the approach is listed below.


texts:
On the web page where the map shows (using Mapbox GL) and I want to add legend. The icons in the mapbox map are in a sprite with the details in JSON. I can see the PNG sprite and JSON in the browser console. The JSON looks like:

"airport-15": {
  "width": 42,
  "height": 42,
  "x": 76,
  "y": 300,
  "pixelRatio": 2,
  "visible": true
}

What's the best way to create a CSS class for the marker icons? For performance reasons I'm hoping to avoid loading the PNG image a second time.
.icon-airport-15 {...}

Mapbox sprite documentation


texts: I am trying to use HEC-RAS for the flood modelling of my flood simulation. How do I use the text file output of HEC-RAS with the GRASS script r.inund.fluv?


texts:
I have two tables both of them having polygon geometry. Lets consider Table 1 has bigger polygons which overlap over the smaller polygons in table 2.Now I know how to find how many polygons from table 2 come under a single polygon from table 1. What I want to do is to find the  proportional area for those polygons from table 2 which get intersected with the polygon from table 1.When I say proportional area I mean how much

(overlap polyon area/total area of that intersected polygon from table 2)*100.

I want find this because it would help me in calculating another value with the right proportions.

I did the below using 1 polygon from table 1. I wanted to know how could I do this for all the polygons from table 1 using cursor.

SELECT a.bg_id, (SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(a.geometry,b.geometry, 0.005), 0.005, 'unit=sq_mile') /SDO_GEOM.SDO_AREA((a.geometry), 0.005, 'unit=sq_mile'))"Proportional Area"
    FROM table 1 a, table 2 b
    where b.STORE_number= '351029'
    AND SDO_Relate(a.geometry,b.geometry,'mask=anyinteract') = 'TRUE';

Here is the one which I tried with cursor which doesnt work apparently.

 Declare
 Cursor c1 is
 select store_number,geometry from stores  where CLIENT_ID= 1 and ORG_ID = 1 ;

 Type C1_TAB_TYPE is table of c1%ROWTYPE;
 c1_list c1_TAB_TYPE;

 Begin
           For r1 in c1

              Loop
              Select bg_id
               BULK COLLECT INTO c1_list from
              (
              SELECT bg_id, (SDO_GEOM.SDO_AREA(SDO_GEOM.SDO_INTERSECTION(geometry,r1.geometry, 0.005), 0.005, 'unit=sq_mile') /SDO_GEOM.SDO_AREA((geometry), 0.005, 'unit=sq_mile'))"Proportional Area"
 FROM DATA
 where r1.store_number != r1.store_number
 AND SDO_Relate(geometry,r1.geometry,'mask=anyinteract') = 'TRUE');
 End loop;
 End;


texts: XMLHttpRequests clogging/pending in Leaflet.js

texts:
If I have a lot of active layers and eg. zooom in and out, dozens of tile xmlhttprequests are sent. This causes a problem in most browsers, clogging it so to speak, and leaving the map blank and dozens of Pending resource requests in Network Console (in eg. Chrome).

Any known work-around for this issue? I'm creating a map with dozens of layers for a client, and with some activity on the map (zoom, adding lots of layers simultaneously, etc), this issue will appear.

What is needed, I believe, is some internal queue in Leaflet.js, as the queue in eg. Chrome browser is buggy.


texts: Get sum of a field for each element of overlapping paths

texts:
I've used the very useful Openroute service to develop a number of routes which I have populated with traffic numbers (on each route). I want each section of road to present the total of a field (across multiple records) on each segment of road.

The routes fan out like tree branches so the routes close to the point of interest have many individual paths overlying one another, until it gets a to point on the network where just the destination is on a route.

I've tried a few ways but I either get a sum of the whole dataset, or a sequence of numbers on all the underlying routes.

I can get the answer the long way around by selecting the underlying routes and then inspecting using the Statistics Panel 'Sum' but I'm sure there must be a much easier cleverer way of doing this.

FURTHER INFO: It’s difficult to visualise as the routes often overlap, but let me try to describe it differently. I have undertaken a set of route plans using open route service. These are sometimes overlaying and sometimes separate. Each individual route line has 4 values attached to it, AM IN (Arrivals in the morning peak), AM OUT (departures in the morning peak), PM IN (arrivals in the PM peak) and finally PM OUT (departures in the evening peak).
I want to present vales on the plan that show the total value on each section of the routes, summed together. So for example if routes AB,AC,AD all ran over an element of common route the sum of their values would be presented. For each section of road I want to show the specific value of AM IN /AM OUT on that section of road. Essentially if i select the routes and use the Statistics panel the sum of selected routes shows me the right answer - but this is laborious.


texts: Can't re-reference `the_geom` when requesting CSV format in Carto

texts:
We're developing a reverse proxy sitting in front of Carto's API. When a user of our reverse proxy requests data, we'd like the geometry values to be returned as Well-Known Text. And our reverse proxy sits in front of an arbitrary number of tables/datasets, so we don't know the field names ahead of time (and I'd like to avoid a second HTTP request to find them out if possible, just for speed).

To accomplish this with the JSON format, we've been using:

SELECT *, ST_AsText(the_geom) AS the_geom

(example)

This works fine - it only outputs a single the_geom field. I'm not sure if this is a feature of Postgres or simply a "feature" of JSON (you can't have more than one property with the same name).

The problem is that it doesn't work when making the same query with &format=csv (example). It throws the error:

ERROR 1: ERROR:  column reference \"the_geom\" is ambiguous"

Any advice on getting around this?


texts: Adding perimeters around points map layout output QGIS

texts:
I'm making a map in QGIS with a number of points in different categories. In the print layout view, it looks like this:

As one can see, there are black perimeters around the dots, both on the map and in the legend. When I export the map as a pdf, the perimeters suddenly disappear.

How can I prevent the black perimeters from disappearing in the pdf output of the map?


texts: How to get a WMS GetfeatureInfo popup with OpenLayers?

texts:
I am new to OpenLayers, used this link to get feature information of WMS layer of GeoServer. If I clicked on any feature its continuously loading not displaying any popup. Can any one please help me in this regard. Here is my code

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Religious in Rajahmundry</title>
<link rel="stylesheet" href="openlayers/theme/default/style.css"
    type="text/css"></link>
<link rel="stylesheet" href="openlayers/examples/style.css"
    type="text/css"></link>

I tried to run example through my pc, I am getting all layers but did not get popup.


texts: Creating a box-plot based on raster values in ArcMap?

texts:
I'm currently working on ArcMap and having trouble designing my workflow.

My objective is to create a boxplot based on raster values. I want to divide my raster file based on some polygons I have and then for each category create a boxplot.

I thought of zonal statistics as a table but that doesn't show all my values.


texts: GDAL merge warp has black block can't remove

texts:
I have been using the gdal to merger a lot of *.tif files to get one big arear, I always get the blackblocks

I tried GDAL merge and GDAL warp but none of them seems working.

Does anyone know where I get wrong? I also attached one of the tiff information at end.

gdalwarp --config GDAL_CACHEMAX 4000 -wm 4000 -srcnodata 0 -dstalpha mx913.tif `mx914.tif mx915.tif mx916.tif mx917.tif mx918.tif mx919.tif mx920.tif mx921.tif mx922.tif mx923.tif mx924.tif mx925.tif mx926.tif mx927.tif mx928.tif mx929.tif mx930.tif mx930gabo.tif dev_transp_tours.tif`

or using:

gdal_merge.py -pct -o tours.tif  mx913.tif mx914.tif mx915.tif mx916.tif mx917.tif mx918.tif mx919.tif mx920.tif mx921.tif mx922.tif mx923.tif mx924.tif mx925.tif mx926.tif mx927.tif mx928.tif mx929.tif mx930.tif mx930gabo.tif

Each tif comes with four files they are: *.ers *.tfw *.TAB *.hgr

mx914.ers information:

DatasetHeader Begin
    Version     = "7.1"
    Name        = "mx914.ers"
    SourceDataset   = "mx914.tif"
    LastUpdated = Thu May 15 16:09:33 GMT 2014
    DataFile    = "mx914.tif"
    DataSetType = Translated
    DataType    = Raster
    ByteOrder   = LSBFirst
    CoordinateSpace Begin
        Datum       = "GDA94"
        Projection  = "LOCAL"
        CoordinateType  = EN
        Rotation    = 0:0:0.0
    CoordinateSpace End
    RasterInfo Begin
        CellType    = Unsigned8BitInteger
        CellInfo Begin
            Xdimension  = 42.3299565846599
            Ydimension  = 42.3306584909193
        CellInfo End
        NrOfLines   = 5341
        NrOfCellsPerLine    = 4146
        RegistrationCoord Begin
            Eastings    = 2211635.722
            Northings   = 2906028.401
        RegistrationCoord End
        NrOfBands   = 3
        BandId Begin
            Value       = "Red Layer"
        BandId End
        BandId Begin
            Value       = "Green Layer"
        BandId End
        BandId Begin
            Value       = "Blue Layer"
        BandId End
        RegionInfo Begin
            Type        = Polygon
            RegionName  = "All"
            SubRegion   = {
                0   0
                0   5341
                4146    5341
                4146    0
                }
        RegionInfo End
    RasterInfo End
DatasetHeader End

mx914.tfw

42.3299565847
0.0000000000
0.0000000000
-42.3306584909
2211656.8869782924
2906007.2356707547

mx94.TAB

  Definition Table
  File "mx914.tif"
  Type "RASTER"
  (2211635.722,2906028.401) (0,0) Label "Pt 1",
  (2387135.722,2906028.401) (4146,0) Label "Pt 2",
  (2211635.722,2679940.354) (0,5341) Label "Pt 3"
  CoordSys Earth Projection 3, 116, "m", 145, -37, -36, -38, 2500000, 2500000

mx914.hgr

[ID],,
File=HMRGeoReferenceFile,,
Version=2.2,,
,,
[GeoRefSetting],,
Origin_Lower_Left_X=2211635.722,,
Origin_Lower_Left_Y=2679940.354,,
Pixel_Size_X=42.3299565846599,,
Pixel_Size_Y=42.3306584909193,,
Image_Width=4146,,
Image_Height=5341,,
Rotation=0,,
Affinity=0,,
,,
[ImageInfo],,
Image_Owner=,,
Image_Description=Ausway Mapping Raster Dataset,,
Scanning_Res_X= 600,,
Scanning_Res_Y= 600,,

Here is the merged tif


texts: Including WMTS Layer from API in Openlayers2

texts:
I´ve generated a map API from the GBIF data portal. It shows points from the country Mali.

I included the API as a WMTS in Openlayers2, but I dont know how to change the xyz accordingly, so that my data shows up properly in my openlayers2?

The implemented WMTS Layer code looks like this:

    var wmts = new OpenLayers.Layer.WMTS({
    name: "Observations Mali 2000-2010 WMTS Gbif",
    url: "http://api.gbif.org/v1/map/density/tile?x=0&y=0&z=0&type=COUNTRY&key=ML&layer=OBS_2000_2010&palette=yellows_reds",
    layer: "layer_id",
    style: "default",
    matrixSet: "matrix_id",
    isBaseLayer: false

});

map.addLayer(wmts);

And the webbrowser output (the yellow dots) looks like this so far:

Setting xyz as 0 values just give me a yellow point grid in my map.
Hope someone can give me a solution to my problem showing up the Mali data properly.


texts: Reclassifying a raster based on values in another raster

texts:
I am attempting to create a new raster based on the values of two rasters I have already created. I am using ArcGIS 10.1

Raster1 is an area with my true values.
Raster2 was created by reclassifying Raster1 using focal statistics.  This reclassified the raster1 pixel values according to the maximum pixel value within the kernel.

The goal for my reclassification is to compare the values in Raster1 to the values in Raster2.  If the Raster1 value is < 50% of the value in Raster 2 then the pixel in the new raster is set to 0, else the value is kept as the value in Raster1.

I am hoping that I can work something out using the ArcGIS toolbox.  I am not an advanced user so I don't understand programming.


texts:
When developing urban planning documentation (f.e. a master plan of a territory) each scheme or plan must be collected in a file in .mxd format.
Does QGIS software generate a .mxd file?


texts: Python plugin for QGIS 2.8.3 - issues related to combobox item data retrieval

texts:
Something unexpected is happening within a function connected to pyqt combo box currentIndexChanged event. Two combo boxes are populated and connected to a function to fire upon index change. The function then retrieves specific information from the selected combo box item and populates two other combo boxes respectively.

While all comboboxes are eventually and correctly populated, something is still occurring at the wrong time as I get AttributeError: 'NoneType' object has no attribute pendingFields on the lines indicated in the layerChanged function when the plugin is initially run. After I exit out of the python error warning, the dialog shows up with all comboboxes properly populated. Each time the combobox is used and a new item is selected, the second combobox correctly populates with no errors.

I am wondering if the problem may be related to the moment when combobox items are added--perhaps the currentIndexChanged signal is firing before the first item is added, and therefore is undefined?

The run function upon opening the plugin:

def run(self):
    # show the dialog
    self.dlg.show()

    self.dlg.ui.compteurCombo.clear()
    self.dlg.ui.resCombo.clear()

    layers = QgsMapLayerRegistry.instance().mapLayers().values()

    for layer in layers:
        if layer.type() == QgsMapLayer.VectorLayer and layer.geometryType() == QGis.Line:
            self.dlg.ui.resCombo.addItem(layer.name(), layer)
        if layer.type() == QgsMapLayer.VectorLayer and layer.geometryType() == QGis.Point:
            self.dlg.ui.compteurCombo.addItem(layer.name(), layer)

    self.dlg.ui.vServIn.setMaximum(500000.99)

    # Run the dialog event loop
    result = self.dlg.exec_()
    # See if OK was pressed
    if result == 1:
        # do something useful (delete the line containing pass and
        # substitute with your code)
        self.calcStats()

This is how the comboboxes are connected to the signal and the run function is called.

def initGui(self):
    # Create action that will start plugin configuration
    self.action = QAction(
        QIcon(":/plugins/statsaep/icon.png"),
        u"Calculer statistiques du réseau AEP", self.iface.mainWindow())
    # connect the action to the run method
    self.action.triggered.connect(self.run)

    # Add toolbar button and menu item
    self.iface.addToolBarIcon(self.action)
    self.iface.addPluginToMenu(u"&statsAEP", self.action)

    QObject.connect(self.dlg.ui.compteurCombo,SIGNAL("currentIndexChanged(int)"),self.layerChanged)
    QObject.connect(self.dlg.ui.resCombo,SIGNAL("currentIndexChanged(int)"),self.layerChanged)

The function called upon currentIndexChanged:

def layerChanged(self):
    registry = QgsMapLayerRegistry.instance()
    self.comptLayer = self.dlg.ui.compteurCombo.itemData(self.dlg.ui.compteurCombo.currentIndex())
    self.resLayer = self.dlg.ui.resCombo.itemData(self.dlg.ui.resCombo.currentIndex())
    #QMessageBox.information(None, 'Connection result', "Res layer %s" % self.resLayer.name())
#Error occurs here
    comptField_names = [str(field.name()) for field in self.comptLayer.pendingFields()]
#Error also occurs here
    resField_names = [str(field.name()) for field in self.resLayer.pendingFields()]

    self.dlg.ui.consoCombo.clear()
    self.dlg.ui.longCombo.clear()

    for field in comptField_names:
        self.dlg.ui.consoCombo.addItem(field)

    for field in resField_names:
        self.dlg.ui.longCombo.addItem(field)


texts:
Just wondering if anyone ever experiences any problems moving layers? I have set up QGIS in the office and it works brilliantly for everyone apart from one of my colleagues who finds that on odd occassions he cannot move the order of his layers around. No error messages come up but nothing happens when he tries to drag the layers. This only goes away when he restarts his QGIS.

The version of QGIS is 2.8 and we are using Windows 8.

Anyone know what the problem is here?


texts: Can't save map with different projection in QGIS

texts:
I'm using QGIS 2.4 and am opening a shapefile I downloaded (specifically from: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_coastline.zip).

What I would like to do is convert the shapefile to EPSG:3857 and then save it as a KML (or some other format easily readable by OpenLayers).  I attempt to do this within QGIS by opening the shapefile (EPSG:4326), right clicking on the layer->Save As then I choose KML, set my CRS to EPSG:3857 and then I save.

Unfortunately, after opening the new file in QGIS it always tells me the layer is still EPSG:4326.  I am opening from a clean project in QGIS (so as to be sure its not inheriting the projects projection).  All the things I have read online tell me to convert projections in this way.  Additionally, I am getting no weird output in the terminal from which I have opened QGIS.

Am I missing something here or doing something wrong?


texts: operator FIELD_NAME IS NULL is not working

texts:
I have a map of soil properties. I am trying to exclude areas that are designated for protection from a selection on this map.

I have tried to use the following query:

SOIL_TEXTURE = 'clay' AND SPA_NAME IS NULL but this does not work


texts: Is there a PostGIS function for checking the validity of a lon/lat pair, given a coordinate system?

texts:
I have data with lon lat pairs that I'm converting to geography types. Some of the pairs, however, are corrupt -- in my case, very negative values for longitude.

Is there a helper function in postgis that I can use to exclude such pairs? I'd like to exclude rows whose lon lat values aren't valid given the range of my coordinate system.

I'd like to do something like:

select *
from data_with_lonlats
where POINT_IS_VALID(ST_POINT(longitude, latitude), 4326)

where 4326 is my coordinate system, which has range [-180 -90, 180 90].


texts:
I have a shapefile of a lot of polygons. I calculated perimeter of each polygon and some polygons returned nan values as they have hole/ring. I am looking for a way to select the polygons with 'nan' value in QGIS. "column_name" = 'nan' seems to be an invalid expression in QGIS.

How do I select them?


texts:
Is there a way to start QGIS with custom command line arguments and to access those arguments at runtime in a plugin?

Background:
I'm trying to start QGIS using a third party application(click on a GIS-Button, QGIS opens with a predefined project using the --project flag). After the project has finished loading I want to register a listener to a given layer inside that project. The name of the layer has to be passed somehow to QGIS. As the name may vary, my best guess was to append that somehow to the command line arguments. The intention of this process is to be able to perform selection, zoom and pan options in QGIS which are triggered by a third party application and, if the corresponding button is clicked, to send data (e.g. areas) back to the third party application for further use.

Basically I've got everything working except for the registering of the layer, which has to be done manually at the moment.


texts:
I have installed QGIS and OTB according to instructions (Win 8, 64 bit) . I have set the paths in the "Orfeo Tool Box menu". See attached.
I get a message "Wrong value for parameter "Msys value".
I built empty directories of "Msys" in QGIS, and now the message doesn't appear, but there is no OTB menu in the Toolbox pulldown

,


texts: How to separate nodes that are common to more than one polygon in QGIS?

texts:
I have a polygon layer which I want to edit its shape.
To do so, I have to edit its nodes.

The problem is that some of this nodes are shared by more than a polygon, and when I move the nodes, the two polygons move together.

In some cases this would be great, because it helps keeping boundaries together, but in this case it is not what I want: I want to create a blank space in between.

I've tried some workarounds that worked, but are time-consuming and not elegant at all:

Deleting common nodes and creating both polygons again.
Adding rings near to the boundaries and then "play" with its nodes to create the space.

Is there an option to avoid the nodes being common to more than one polygon (something maybe like split nodes, or split polygons)?


texts: QGIS 3 Modeler: Generate New Vector File

texts:
I want my graphical model to create a new empty line layer (preferably as a temporary scratch layer) and then add a bunch of new columns to this layer (this part is easy using the field calculator).
I then add new lines manually after the model has run.
Is this possible to do inside the graphical modeler or do I need to manually create the layer beforehand and then specify it as a data input?
(edited for clarity)


texts: QGIS autoincrementing primary key, unique constraint error

texts:
We changed our format for our layers from GPKG to SpatiaLite. A few Layers made some problems with an unique constraint error. Funny thing, saving them as SpatiaLite again did the job most of the time.
Lately I created a SpatiaLite and the same problem occured. "create an autoincrementing primary key" was on. filling the primary key myself worked but the "automatic created" from the program didn't fill it right I guess. I wanted to recreate the error yesterday but they creating of a SpatiaLite layer worked flawless. I can't find much to this error and have no clue what the reason for this problem is. We have no local installation. The program and the SpatiaLites are on the server.


texts: How to save image to disk with with gdal_translate?

texts:
I do:

import os
from gdal import *

filename = 'c:/rast.jpg'
outputTif = 'c:/rastOut.tif'
os.system('gdal_translate filename outputTif')

but it returns "1".

gdal_translate doesn't save the image to disk. Is any additional parameter needed?


texts: Plotting and analyzing extracted elevation data in R?

texts:
I have a shapefile of county boundaries for New York state and elevation data downloaded through the elevatr package.

library(elevatr)
library(raster)
library(sf)
library(USAboundaries)

counties <- us_counties(map_date = "1930-01-01", resolution = "high", states = c("NY"))

counties_sf <- as(counties, "Spatial")
elevation_data <-get_elev_raster(counties_sf, z=9, src = "aws")
map <- extract(elevation_data, counties)
plot(elevation_data, axes=TRUE)
plot(st_geometry(counties), add=TRUE)

This produces an image like this:

That's all well and good, but how do I restrict the elevation data to just the area of the county boundaries, e.g. for computing zonal statistics or for creating a map of only the state?

The extract function from the raster package returns a sequential list of lists of elevation points, but as far as I can tell, there isn't a way to link those points back to the unique IDs of the actual counties that come from the shapefile, even using the extent function.

Ideally I'd like to work with everything using the sf (Simple Features) package, as in this question, because that's what I'm most familiar with. It's a little confusing for me to keep track of which packages return raster objects, which return sf objects, which return spatial polygon data frames, etc.


texts: How do I stop the identify results popup window in QGIS 3

texts:
I use the identify tool in QGIS3 a lot. When I click a feature it show the results in a identify panel and it gives a popup window that shows the results.
I want to get rid of the popup window as it obscures my view. It also opens a new window for every click which means I end up with a lot of popup windows.
I am on QGIS 3.2.3 but I have encountered this problem with other versions as well.


texts:
Is there a neat and tidy way of adding comments, or text boxes, into the display of the Graphical Modeller of QGIS 3.14 for a model that one is building.
This is straightforward in ArcGIS ModelBuilder but I can't find a neat way of doing this in the QGIS process model building tool.


texts: Loading TIGER 2010 Edge Shapefile with ogr2ogr produces reversed Latitude and Longitude

texts:
I'm attempting to build a MySQL database that will allow me to reverse geo-code addresses using the MBR functions within MySQL.  I've downloaded the latest set (2010) of TIGER edge shapefiles from the US Census website and am trying to load them into MySQL using the GDAL ogr2ogr utility.

A new table (geotest) does get created with a SHAPE column that has the geometry defined as a LINESTRING. However, I am seeing reversed latitude and longitude values that get reversed when running the following command:

ogr2ogr -f "MySQL" MySQL:"geodb,user=myuser,host=localhost,password=mypwd" -nln geotest -nlt LINESTRING -append -a_srs "EPSG:4326" -lco engine=MYISAM tl_2010_01021_edges.shp

What I get when I look at the data are latitudes and longitudes (although correct when verified on Google Maps) are in fact reversed as seen below:

LINESTRING(-86.69863 32.973164,-86.69853 32.97302,-86.69856 32.97287,-86.698613 32.972825,-86.6988 32.972825,-86.6989 32.972892,-86.6989 32.973002,-86.69874 32.97316,-86.69864 32.97318,-86.69863 32.973164)

I've tried this for other shapefiles as well (to include those w/ polygons/etc.) and in all cases the latitude and longitudes appear to be reversed when loaded into the geometry column.   I'm hoping it is something as simple as a flag I am missing w/ ogr2ogr that will load them in the proper order.

For what I am doing (building a complete database of roads for the purpose of reverse geo-coding in the US) am I even using the correct set of census shapefiles (i.e., edges) and if so, what am I doing wrong when loading?  If there is not a way to correct with ogr2ogr, is there an easy update I could run after loaded to reverse all of the coordinates in the LINESTRING geometry column?


texts: How do I convert XYZ coordinates to another projection system

texts:
I am trying to convert between coordinate systems in QGIS.

I have a point file in NZGD49 coordinates (EPSG:27200) (referenced to the geoid) which I am trying to convert to NZGD2000 coordinates (EPSG:2193) (referenced to the ellipsoid).

I have tried saving the layer as a CSV file with the CRS set as NZGD2000 and the geometry set as AS_XYZ. This does a good job at converting the X and Y values, but returns 0 values for Z. I presume I have to assign which column represents Z before I do this but I don't know how. Does anyone know how to do this?


texts:
I'm trying to create a model wherein one of the parameters is a compound variable, that is made of multiple variables joined together. How can this be done?

For example: create an insider buffer using Buffer(analysis) and name the output feature class from the distance parameter.

Variables:

BufferDistance = 1000
InputFC = d:\test.gdb\boundaries

Buffer tool parameters:

Input Features = %InputFC%
Output Feature Class = %InputFC%_%BufferDistance%
Distance = -%BufferDistance% Meters

A negative buffer distance is needed to create an inside buffer, but that means the %BufferDistance% variable can't be used in the output FC name. Thus the need for a compound variable.


texts: XYZTiles (MB) generator - how to erase "white tile" to have a lighter file

texts:
I work for resolve river quality problem
I am trying to make a good basemap combining a lot of data from zoom 9 to 19.
I'm using xyztile(MB) generator (jpg 75%) and to have a lighter file, I have a transparent 40meter buffer around the rivers (only for 18 and 19 zoom). Out of this 40m, it is white.
I would like to know if there is a way to remove the huge number of white tile while that can probably change de from 500Mb to 100Mb file
I use OS W10 - QGIS - Version : 3.12.3-București
Thanks


texts: How to create a dashed polygon border in C++?

texts:
In my maps I have a symbol, his type is polygon, I want to change the line style of the border, actually is solid , I had to put it in dash

Is there a simple way to change it ? i think to the QgsLineSymbolV2 ?


texts: Listing All Points In a Polygon Feature Class Using arcPy

texts:
Based on my understanding in coding, I thought the following code will list all points in every feature in my Building polygon feature class:

arcpy.env.workspace=r'D:\test.gdb'
rows=arcpy.da.SearchCursor("Building","Shape@")
for row in rows:
    print row
    for p in row:
        print p

But that displays the following results for each polygon:

(<Polygon object at 0x324838f0[0x32483ee0]>,)
<geoprocessing describe geometry object object at 0x32483EE0>

What is missing in my code?


texts: Downloading MODIS data of cloud cover less than 10%

texts: I use ModisDownload from rts package for downloading MODIS data. But is it possible to specify cloud cover and view angle before downloading? e.g. if I want to download MODIS data for cloud cover less than 10% and view angle of 10 degrees.


texts: Field Editor with Python: select by attribute & open table (QGIS)

texts:
I want to search on number values (>, = etc.) within a column and open table for the selected ones. It's an easy task within field calculator, but I want to see how it's build up with the python syntax and then run it. It would help me understand. Or should I run it with the consols editor?

While this is an expression by the attribute (population) i won't need the feature-class, right?

What I want is something like this:

def "population" < 2000

def showAttributeTable() (but only for the selected ones)


texts: Get Coordinates of selected item on map using ArcGIS Engine

texts:
I have IFeatureSelection. Then select from it items by QueryFilter.
How can i get coordinates of selected item? (If there are more then 1 object, then select first)?

Selected item is Point in Attribute Table.
I am using C# to write code.

Using samples and Links from @artwork21 and @GISKid i think that i can get coordinates of selected item using this code:

var fClass = featureLayer.FeatureClass;
var fCursor = fClass.Update(null, false);
var aFeature = fCursor.NextFeature();
var tPoint = aFeature.Shape as IPoint;
// then i get Coordinates from tPoint.

But i get new problem - method Update isn't implemented. Have SomeBody any advices?
Thanks.


texts: I have QGIS 2.8.2 Wien on windows 7 and quite new to QGIS. I have two shapefiles - 1 with rivers and 2 with sites located on some of those rivers. I want to carry out a spatial query to find the river sections that have sites located on them, but when I carry out the query, no sections are found, although there should be over 100 of them. I have checked that the CRS is the same on both layers (EPSG:29903 TM75 Irish grid), I don't know why results don't show up.


texts: Looking for options to use Mapfish with PHP

texts:
I recently installed MapFish on my test server and started to play around with. As I'm not that good in python/pylon I'd prefer to work with that framework with PHP.

I read that it is possible with sfMapfish which is a connector to the symphony-framework for PHP. Symphony is quite a strong framework, so I'm open to use it.

My questions are:

Has anyone used sfMapFish already and can show me a good tutorial to see how to start?
Is there another PHP Framework for MapFish (as sfMapfish hasn't been updated for over a year)?

Thank you!
Martin


texts: Set all raster values from decimals to integers on OQGIS

texts: I have a raster map made up of numerous pixels with decimal values. Is it possible to change these values from decimals to integers?


texts:
I am using Openlayers to publish maps and Geoserver as map server. Now I can add more than one layer in Openlayers like WMS , Vector , WFS and Google Maps as base map. How can i export map's current viewport as image.

EDIT: I need to print base layers also. Base layer may be Google maps , Bing maps etc.


texts: Get min/max lat and long values from geodataframe

texts:
I am new to Geopandas and I want the min and max values of both latitude and longitude for a single record. The Geodataframe is structured as so (not sure it matters):

STATEFP   STATENS     GEOID   STUSPS   NAME   geometry
49         48           48      TX     Texas  (POLYGON ((-94.718296 29.728855, -94.717207 29...


texts: How can a browser argument be used to position a web-map

texts:
How can I enable the unique location and zoom level of a user on a web-map to be shared?

For example, if a user zooms to lat: 75, lon: 35, zoom: 8, I would like to be able for the user to share that location through a link (for example, www.mymap.com/75/35/8). As I'm using OpenLayers, I understand how to record where the lat/lon/zoom of what the user is viewing, and also how to store this in a database if necessary, but I do not have a clear idea how (or if) this argument can be shared via the browser.

My OpenLayers code is usually something of this form:

var mapCenter = new OpenLayers.LonLat(-35, 75);
map.setCenter(mapCenter, 3);

For example, I would like www.mymap.com/23/15/10 to work, and all other permutations of lat/lon/zoom.


texts: Converting from flat earth to WGS84 with python

texts:
I'm looking to move from basic 2d Cartesian coordinate system into WGS84.

I know my starting coordinates, however all intermediate points are x/y/z points. of an origin 0,0,0 .

Mathlab has a function of Flat Earth to LLA, would python libraries like proj.4 or any other libraries have built in functions such as Flat Earth to LLA ?


texts: Defining soil classifications for Green Mountain National Forest based using SSURGO data

texts:
I'm a third-year undergraduate biology major with a focus in ecology. Referencing the methods laid out in A quantitative approach developing regional ecosystem classifications (Host et al 1996) I would like to create ecoregions for the Green Mountain National Forest. Obviously these would be very detailed compared to global ecoregions which distinguish between much more heterogenous climates. The first step is to classify the soil data into polygons. These will then be laid over climate polygons to define the ecoregion polygons.

I'm working with an abridged version of SSURGO data from ArcGIS. In their description on the website they say that they've only included 130 of the most useful variables. These include drainage, particle size, and taxonomic classification, slope, bedrock depth, runoff, erosion, and geomorphic description. I'd like to begin working with the former two (perhaps adding other variables later on) to create the soil polygons. Host et al (1996) used drainage, surface and subsurface texture, and particle size. My professor suggested k-means clustering but the data I have are actually categorical! Drainage is defined as “excessively drained”, “somewhat excessively drained”, …. , and “very poorly drained”. Particle size is defined as “coarse-loamy”, “coarse-silty”, “loamy”, etc.

Can I attempt to make the soil polygons using only those two categorical variables?

If not, what others should I include?

Another possibility, could I just use the USDA taxonomic classifications which are included?

Host et al (1996) don’t use them so I imagine there’s some reason not to, but I wonder if that reason applies to my work.

Also, any suggestions for a specific method to follow for the code in R or method in ArcGIS?

I would like to use comprehensive SSURGO data rather than the abridged version  but at this point its not feasible because you can only download 100 thousand acres at a time from the USDA website. I’ve been told that I could write a Python script to do that and I’d like to investigate that in future but for now I’d like to work with the data I already have. I'm really just defining the methods for a first draft of the project, so really I’m looking for a heuristic to improve on in future. Please, do let me know what other information I should provide in order to make it easier to provide a thorough answer.

I'm an early-intermediate R-user and I'm learning ArcGIS as I go along.

Here is link to a csv file of an attribute table of SSURGO data. First 100 rows only.

Host, GE, PH Polzer, DJ Mladenoff, MA White, TR Crow. 1996. A quantitative approach to developing regional ecosystems classifications. Ecological Applications 6: 608-618.


texts: Getting missing buildings from OpenStreetMap (OSM) file into QGIS?

texts:
I am trying to build a map with the footprints of the buildings using QGIS. So far, it was straightforward to import OSM file generated by OpenStreetMap, but unfortunately, the map is not complete. There are only a few buildings that are available, as you can see in the image below:

So far I couldn't find any vector map that would show those buildings. I saw in a previous post that there exist such a map on this website (see image extract in the picture below).

The problem is that the map was built in Flash and I cannot extract it as vector data. I can see however that the map was built in ArcGIS and I was wondering if there is any way to get such a map for QGIS. I have tried importing and *shp from here, but it is the same as in the first picture. My knowledge ended there, and I have realized that I don't even know how to search for such a vector map with all the buildings.

Can anyone help me with this or guide me on how/where to search for such a map?


texts: Installing arcpy package in PyCharm interpreters with ArcMap

texts:
There are lots of questions on GIS SE about importing ArcPy but I can't find a set of instructions that work for me. I know very little about paths and environments, so don't understand most of the answers.
I am using PyCharm Community 2018.1.4 and my usual project interpreter is Python 3.7. I have ArcGIS desktop 10.3 installed. I set up C:\Python27\ArcGIS10.3\python.exe as a new project interpreter in PyCharm, but when I click 'Install' and look at the available packages, I can see arcpy-metadata and arcpy-virtualenv but not arcpy.
I do have a .pth file in C:\Program Files (x86)\ArcGIS\Desktop10.3\Support\Python\Desktop10.3.pth and it contains the following text:
C:\Program Files (x86)\ArcGIS\Desktop10.3\bin

C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy

C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcToolBox\Scripts

...which looks correct?


texts: QGIS not showing the course of the line with arrow symbol and 'arrow at each segment' unchecked

texts: I want QGIS to show arrow at the end of each line but not at each segment on the line. When I select arrow symbol and uncheck repeat arrow at each segment, it draw a straight line from beginning point to the endpoint, without following the course of the line. How to fix this to get the course of the line and also the arrow at the end of the line.


texts: How to delineate/vectorize polygons out of a spline surface?

texts:
Often I generate hotspot surfaces at the point level, I'll quickly run through my workflow:

by taking the points, making a copy
running the integrate tool at a 1-mile XY tolerance
I am calculating disease prevalence, so in order to get a point-level prevalence rate, I select by attributes where some disease = 1 to get my numerators. Then I run collect events on the selection. After it's done, I clear my selection, run collect events to get the denominator.
Once those are both output features, I spatially join the numerator to the denominator, with the summary statistic set to minimum.
Once both counts are together, I can calculate prevalence by creating a new field in that spatially joined feature called Prevalence, where MinIcount/Icount * 1000 is the prevalence rate
From there, I have an analysis field to use for the optimized hotspot analysis tool. I run hotspots, get a point-level hotspot results w/ z-scores.
I then run the hotspot output through spline, using the GiZscore field as the analysis field.
From there I classify the raster surface the same way as the hotspot tool outputs the points, and that's my hotspot surface.

Here's a zoomed in example of what the surface looks like with class breaks shown:

This is where my question comes into play.

Sometimes, a month or two later, my work will ask for me to only take the "hot" hotspots (GiZscore > 1.95), and delineate them back to a vector. We use this to show blobs that are disease "hot" hotspots, so we can easily overlay them with other thematic choropleth maps.

My approach so far: Use Contour (Spatial Analyst) tool to take those and turn them into lines. When you use the Contour tool set to 1.95, all of the output are polyline but they include lots of contour lines within the > 1.95 boundaries. I then use the Feature to Polygon tool, and I end up having to use Editor because it includes all the class breaks after 1.95, so I have a lot of little polygons inside the big blobs I need to manually delete. I want to manually delete them because I don't want them to be included in the dissolve step I'll do next to dissolve all the delineated polygons into one big blob.

Here's a pic illustrating the areas I'd want to vectorize:

Is there a better way to do this?


texts: Self union a geodataframe whilst retaining columns of overlapping features

texts:
I have a geodataframe with overlapping polygon features. I want to mutate this to create a non-overlapping polygon geodataframe. I know I can merge the geometries by using unary_union as shown here: How to self union a GeoDataFrame?.
However this removes all other columns except geometry. I want to retain the columns (in the example below, id and weight). I have to compare each row to all other rows and see if they intersect, if so, use the ‘difference‘ operation to erase the overlapping part. The priority is not important, I just want to delete the overlapping part from one or the other geometry feature. The result should contain no overlapping polygons.
How do I do this somewhat comptutationally efficiently?
See picture. In this case, the squares (1, 2) and the buffered point (4) overlap each other. I would like to apply this for a geodataframe with ~5000 features.

Code sample of the geodataframe used above:
import geopandas
from shapely.geometry import Polygon, Point

my_gdf = geopandas.GeoDataFrame({
    'id': [1, 2, 3, 4],
    'weight': [100, 120, 50, 75],
    'geometry': [Polygon([(0,0), (2,0), (2,2), (0,2)]),
                 Polygon([(2,2), (4,2), (4,4), (2,4)]),
                 Polygon([(4.5,4.5), (6.5,4.5), (6.5,6.5), (4.5,6.5)]),
                 Point([3.3,1]).buffer(1.5)]})


texts: How to show points and polygons in single layer?

texts:
I have big trouble to show points and polygons in same layer in geoserver.
I have one table named as ABC.
in ABC there are two geometry fields-
1.the_geom
2.the_geom_polygon

Note: Some rows may/may not have geometry values.

Now, I am trying to publish this on geoserver 2.2.

I created style like this.

    <?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
    xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
    xmlns="http://www.opengis.net/sld"
    xmlns:ogc="http://www.opengis.net/ogc"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NamedLayer>
    <Name>Testing</Name>
    <UserStyle>
      <Title>Point_polygon_style</Title>
      <FeatureTypeStyle>
      <FeatureTypeName>Feature</FeatureTypeName>
      <SemanticTypeIdentifier>generic:geometry</SemanticTypeIdentifier>
      <SemanticTypeIdentifier>simple</SemanticTypeIdentifier>

<Rule>
<Name>polygon</Name>
    <MaxScaleDenominator>2500</MaxScaleDenominator>
    <PolygonSymbolizer>
    <Geometry><ogc:PropertyName>the_geom_polygon</ogc:PropertyName></Geometry>
        <Stroke>
              <CssParameter name="stroke">#FF8501</CssParameter>
              <CssParameter name="stroke-width">1.5</CssParameter>
        </Stroke>
  </PolygonSymbolizer>
</Rule>

<Rule>
   <Name>poi_educational_institute</Name>
     <PointSymbolizer>
        <Geometry><ogc:PropertyName>the_geom</ogc:PropertyName></Geometry>
        <Graphic>
           <ExternalGraphic>
             <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="test.png"/>
               <Format>image/png</Format>
           </ExternalGraphic>
           <!--<Size>
               <ogc:Literal>17</ogc:Literal>
           </Size>-->
       </Graphic>
     </PointSymbolizer>
</Rule>

</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

When going to the Layer preview  , its showing Error like this

code="internalError"Rendering process failed
java.io.IOException
null
Error: Operation on two geometries with different SRIDs

I thing the values are null in the geometry fields(the_geom/the_geom_polygon).

How can i give filter to check whether geometry is null/not(in style)?

Can you please help me to solve this...

Regards
Mohammed Shafeek


texts: Importing shapefile from website if download link is compressed file?

texts:
I'm trying to write an SQL query with PostgreSQL to download and import multiple shapefiles to tables in my database. All the links are of the form : https://www2.census.gov/geo/tiger/GENZ2010/gz_2010_STATE-FIPS-CODE_140_00_500k.zip.

I've tried using wget however I'm having trouble since the file is compressed and I'm not sure how to decompress it with a query.


texts: QGIS Graphical Modeler Help editor does not save

texts:
Is there a special way to save whatever text you're writing in the Help Editor for a QGIS Model? I've been trying a few times, apparently just after I click ok, even though I immediately click "save" afterwards, the description gets deleted.

Any ideas on what's happening?

**Using QGIS 2.8.2 version.


texts: Change the symbology of a dynamic map service in client

texts:
I am trying to use someone else's map service in my web map, but their symbology is atrocious so I need to render new colors through JavaScript API.

I try the following (amongst many other efforts spanning 2 days):

       parcels = new ArcGISDynamicMapServiceLayer(config.mapServices.parcels, {id:"Parcels"});
       parcels.on("load", function(){

           var layerDrawingOptions = [];
           var layerDrawingOption = new LayerDrawingOptions();

            // set symbology overrides
            layerDrawingOption.renderer = new SimpleRenderer(symbols.polygon);

            // the following index represents the layers in the service to apply the renderer to
            layerDrawingOptions[8] = layerDrawingOption;

            parcels.setLayerDrawingOptions(layerDrawingOptions);
            parcels.setImageFormat("png32");
            parcels.setVisibleLayers([8]); //schools,streets,parks,parcels,boundaries,shields

       })   ;

        map.addLayer(parcels);

I am following this currently:
https://developers.arcgis.com/javascript/jsapi/layerdrawingoptions-amd.html#renderer

The few examples at the API deal with renderers for class-breaks, etc, I need to resymbolize all parcels, which should be a similar concept. Any ideas on how I can symbolize a dynamic layer at the client rather than the server using JS API?


texts:
As an archaeologist working on excavated site data. Usually I use the Harris Matrix Composer to finalize the strategraphic matrix of the site. Lately I am using the QGIS Program in my work.
Is it possible to integrate/link the two; Harris Matrix and QGIS Programs?!


texts: How send wfs transaction data on json format in Openlayers?

texts:
I use a wfs layer in my project with openlayers as follows:

var saveStrategy = new OpenLayers.Strategy.Save();

me.point = new OpenLayers.Layer.Vector("Editable Features", {
    strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
    projection: new OpenLayers.Projection("EPSG:4326"),
    protocol: new OpenLayers.Protocol.WFS({
        version: "1.1.0",
        srsName: "EPSG:4326",
        url: 'point/read',
        featureType: "point",
        featureNS: "http://salam.opengeo.org",
        geometryName: "the_geom",
        readFormat: new OpenLayers.Format.GeoJSON({}),
    })
});

I edit some features and when I want to sync with server it send a request as follow:

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
    <wfs:Update typeName="feature:itsme" xmlns:feature="http://iran.me">
        <wfs:Property>
            <wfs:Name>the_geom</wfs:Name>
            <wfs:Value>
                <gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326">
                    <gml:pos>49.02405689339376 34.858924130844805</gml:pos>
                </gml:Point>
            </wfs:Value>
        </wfs:Property>
        <wfs:Property>
            <wfs:Name>name</wfs:Name>
            <wfs:Value>Salam Bar Hossein</wfs:Value>
        </wfs:Property>
        <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
            <ogc:FeatureId fid="point.3"/>
        </ogc:Filter>
    </wfs:Update>

I want to config the point layer to send transaction data with json format.

How do I do?


texts: How to compute layer by layer after stack?

texts:
I have some rasters that I want to compute the moving average and then rewrite the rasters again.

  r1 <- r2 <- r3 <- r4 <- r5 <- r6 <- raster(nrows=10, ncols=10);
  r1 <- setValues(r1,runif(100,min=1,max=100));
  r2 <- setValues(r2,runif(100,min=1,max=100));
  r3 <- setValues(r3,runif(100,min=1,max=100));
  r4 <- setValues(r4,runif(100,min=1,max=100));
  r5 <- setValues(r5,runif(100,min=1,max=100));
  r6 <- setValues(r6,runif(100,min=1,max=100));
  # Stack them
  st1 <- stack(r1,r2,r3,r4,r5,r6)
  #compute the moving average:
  x <- calc(st1, function(x) movingFun(x, 3, mean))

Now the layers in x should be recalculated as:

  firstlayer=(first layer + fourth layer)/2
  secondlayer=(second layer + fifth layer)/2
  thirdlayer=(third layer + sixth layer)/2

These are examples but my data are more than this so I prefer a loop to do the job no matter how many layers I have in x


texts: Calculating new satellite position given pseudorange measurements

texts:
I'm looking for a reference/text for an explicit formula to calculate a satellite position given pseudorange measurements from later epoch times. I've seen a lot of matlab code on the internet but I was hoping to have these formulas laid out nicely.

Can anyone point me to the right direction?


texts: Running Line Intersections algorithm from console on QGIS

texts:
I currently want to intersect every line from a Linestring layer with another Linestring layer that I get from a WFS. When I use the GUI to do that (Vector -> Analysis tools -> Line Intersections...) it works perfectly. Yet I am trying to do that using the Python Console inside QGIS3 with the following function:

def loadIntersections():
    player = QgsVectorLayer('Point?crs=EPSG:4326', 'linhas selecionadas', 'memory')
    provider = player.dataProvider()
    provider.addAttributes([QgsField('name', QVariant.String)])
    player.updateFields()
    QgsProject.instance().addMapLayer(player)
    intersect_layer = QgsProject.instance().mapLayersByName('linhas_stpc')[0]
    processing.run('qgis:lineintersections', 'pontos_selecionados', 'linhas_stpc','memory:pontos')

Yet I get the following error:

TypeError: QgsProcessingAlgorithm.checkParameterValues(): argument 1 has unexpected type 'str'

I must note that I have tried to load the layers into alias using the QgsProject.instance().mapLayersByName($LAYER_NAME)[0] but then the unexpected parameter changes from 'str' to 'QgsVectorLayer'. It is worth noticing that in the processing algorithm documentation both types are acceptable.

I only need to replicate the function used by the GUI to a script.


texts: OS Boundary Line shp export CSV with description and lat/lng

texts:
I have found several post saying it is possible in QGIS to export OS Boundary Line shp files to csv's containing the boundary line in lat/lng (for use on Google map) along with the name of the area, some with instructions on how to do it but when ever I follow them it doesn't work for me.

I've only just downloaded QGIS so I don't know my way around as yet.

Steps so far:

Clicked "Add vector file", right click on layer and click "save as". Then select format "CSV", set CRS as "Layer CRS" and coordinate reference system as "WGS 84". I tried putting "GEOMETRY=AS_XY" and "GEOMETRY=AS_XYZ" in the layer field. Click ok and I get a file containing information about the polygons like name etc... but not the boundary line in lat/lng.


texts: Classify / section line or group of points according to shape (with shapely objects)

texts:
Is there any python module/function that classifies/sections a shapely line according to the shape the line forms?

If not, I could do it with the positions of the points that form the line. I would like to ignore the absolute coordinates of the points, and classify according to the relative positions between them (in batches or something). Is there any mathematical coefficient that analyses this in particular? Or the correlation between points but without being the absolute coordinates?

I have searched ways but I don't find any solution. The closest thing I have come to is PySAL, but from what I understood, it serves for the correlation/classification of OTHER fields (like population, income...) using the coordinates to group them.

UPDATED

As an example, I have the following LineString (shapely object). I can generate any number of points along the line.


texts: I'm working on getting an 8 hour workshop made for Middle and High Schoolers for GIS. I know it can be hard to grab their attention so I was wondering if you guys had any ideas about what we can do to keep them interested. We should be able to have access to ArcMap as well as ArcGIS online. If you guys have any ideas let me know.


texts:
I have a raster data and Shapefile. Both data sets have same projection but they don't overlay each other.

What is the possible solution?


texts: How to use a search cursor on a joined table in ArcMap?

texts:
I'm struggling to get a search cursor to work on a joined table view.

I've used search cursors before, but never on data that has been joined.
Arcpy keeps saying that some of my joined fields don't exist.

I used arcpy.ListFields() and sure enough, the fields are there. Some of them look different though. They look like this:

Shapefile1.FID
Shapefile1.name
Shapefile1.LPOLY
source_id
title
author

My search cursor code:

searchRows = arcpy.SearchCursor(theJoinedView)

for row in searchRows:
    if row.source_id == None:
        arcpy.AddMessage(row.Shapefile1.FID)

It says Shapefile1.FID does not exist, when it should. Any ideas?


texts: How to populate text field in a shapefile table by 0 length string using ArcGIS?

texts:
Experiment:

Original table:

Field calculator expression applied to TXTfield:

“”

Add numeric field:

Field calculator expression applied to numField:

len( [TXTfield])

Result:

Note:

arcpy.da.searchCursor also reports 1 character long string in
TXTfield
ArcView 3 reports zero length string

Question:

What is going on?

I am using ArcGIS 10.2


texts: Adding new geometry column using PostGIS?

texts:
This is probably pretty straight forward. I want to add a new geometycolumn (27700) to my table which is currently in 3857, but i dont want to alter the points to the new geomtery.

How would i go about this?


texts: Segmentation Fault upon exit of QGIS map canvas

texts:
I have simplified my original code. My code is very similar to Pyqgis' cookbook. I am simply loading one VALID layer to QgsMapCanvas and then displaying it. Everything is displayed corectly etc. Problem is, everytime I exit out of the QgsMapCanvas GUI, my code then shows a segmentation fault (core dumped) message. How can I prevent this from happening?

from qgis.core import *
from qgis.gui import *
from PyQt4.QtCore import *

def main():
    # initiate canvas for debugging purposes
    # supply path to qgis install location
    QgsApplication.setPrefixPath('/usr', True)
    # create a reference to the QgsApplication, setting the
    # second argument to False disables the GUI
    app = QgsApplication([], True)
    # load providers
    app.initQgis()

    # create Qt mapCanvas object
    canvas = QgsMapCanvas()
    canvas.setCanvasColor(Qt.transparent)
    # enable this for smooth rendering
    canvas.enableAntiAliasing(True)

    # create vector layer object
    layer = QgsVectorLayer('BUAARE.shp', 'layer', 'ogr')

    if layer.isValid():
        QgsMapLayerRegistry.instance().addMapLayer(layer)
        canvas.setExtent(layer.extent())
        canvas.setLayerSet([QgsMapCanvasLayer(layer)])

    canvas.show()
    app.exec_()

    # exit qgis
    app.exitQgis()
main()