texts: Trying to open InfoBox with PushPin click event and Bing Maps / JavaScript

texts: I am experimenting with the sample code on the Bing SDK site but am unable to get the click event to work with the pushpins I am adding in a JS .each loop that pulls in longitude, latitude coordinates from a sql server.  I can get the push pins to display fine, I can get the InfoBoxes to display fine if I set their visible to true in the loop, but if I set the visible property to false in the loop and then try to set visible to true with the pushpin click event nothing happens.


texts: Creating shortest route using line-segment layer as network locations?

texts:
I'm currently using Arc10.2.1 and new to the network analyst tool. I'm trying to create a truck route that begins at one location on a county street grid and ends up in the same place, following a feature class of line segments of guard rails throughout the whole county - we need to create the most efficient path possible.

I understand the concept of network analysis objects and network attributes, but need to use these line segments as such. However, the only line-based network analysis objects that can be defined as network locations are line and polygon barriers. I was successful in using my guardrail feature class to create the shortest route that avoids each guardrail, but not one that follows it. When I attempt to use the segments as "stop" input features it tells me that it is an incorrect input.

I thought of creating centroids from each segment to use as stops, but that provides little information for the truck drivers to know exactly where along the roadway the guardrails are located.

This seems like it would be a common problem, yet I haven't been able to find anything on it.


texts: What are the default units of elevation/altitude/z in GeoJSON?

texts:
The GeoJSON spec says "The default CRS is a geographic coordinate reference system, using the WGS84 datum, and with longitude and latitude units of decimal degrees".   It doesn't seem to specify what the units of elevation/altitude/z are for points.

Is there a default unit of altitude for GeoJSON?  If not, are there common conventions, or a way to specify units?


texts: Is there a software package that allows users to create map tiles?

texts: We would like to create map tiles to be used via mobile device in the field in an offline environment.  The imagery will come from our personal collection of aerial images taken via UAV.


texts: Is there a way to make Google Earth only display the outline of continents?

texts:
I want to do a visualization in Google Earth and I don't want to see all the different colours of the satellite images. Instead I'd like just the outline of the continents/coastlines, maybe a colour distinction between land and water, but that's it. Is there a way to set Google Earth so it doe this?

I don't want any textures, just solid colour preferably. Like the ocean floor, I'd like to not see that. Same with land, just one colour would be preferable.


texts: 999999 error when executing StageService_Server to create service definition file in ArcGIS Pro

texts:
Oh, the dredded 999999 error. I am trying to create a service definition in arcpy for ArcGIS Pro. I succeed in creating a .sddraft but I fail to create a .sd

sharing_draft = mlist[0].getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", "Active_Projects")

analysis = {}
try:
    analysis = sharing_draft.exportToSDDraft(sddraft_output_filename)
    print("draft export success")
except Exception as e:
    print("Draft export failed: {}".format(e))
#stage service by creating an .sd file
if analysis is not None:
    print("analysis: " + str(analysis.values))
else:
    print("draft analysis has no errors")
#create .sd file
sd_output_filename = outdir + sd_filename
print("sd_output_filename:" + sd_output_filename)
try:
    arcpy.StageService_server(sddraft_output_filename, sd_output_filename)
    print("stage successful")
except Exception as e:
    print("stage failed:{}".format(str(e)))

I get the following output

draft export success
draft analysis has no errors
stage failed:ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Failed to execute (StageService).

The draft has no errors...or does it? I am using double backslash the paths. I looked at this answer: (https://community.esri.com/thread/90453) but it is from 2014.

Edit:
Do you think it has to do with the first line? I tried the following

mlist = aprx.listMaps()

sharing_draft = mlist[0].getWebLayerSharingDraft("FEDERATED_SERVER", "MAP_IMAGE", "Active_DDC_Projects")

sharing_draft = mlist[0].getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", "Active_DDC_Projects")

I am trying to publish an mxd file.


texts:
Using QGIS 3.6

Currently trying to dissolve a polygon layer by FIELD values. QGIS 3.6 and the fields won't show up. In fact I am unable to dissolve by FIELD for any layer in my entire project.

If I select the polygons manually and dissolve it works.(as expected)
If I select dissolve with no polygons selected it dissolves the entire layer. (as expected).

But dissolve by fields despite the FIELDS having every type (String, Real, Integer) wont work.

Merging/Dissolving polygons by Common Attribute Field in QGIS? appears to be the only mention of this issue. Solutions are to create non-float FIELDS (I've done) and Fix Geometry(done as well).


texts: DEM elevations not appearing when rendered to single band pseudocolor

texts: When rendering DEM file to single-band pseudocolor, the elevation values are not appearing. Attached are images of the proper template and my layer properties. Please let me know what other data would be helpful.


texts: How Oracle is related with GIS (Professional wise)

texts: I am GIS B.Tech Graduate. In the aiming of becoming GIS Developer .I temporairly changed my profession from GIS Analyst to Software Engineer. But what I got in this software company is oracle (not .net or Python). I want know with gaining oracle experience how Can I comeback To GIS Domain any suggestions?


texts: Executing Power Equations in Raster Calculator?

texts:
I am attempting to conduct a calculation in raster calculator, however I am coming up with numbers that I know are incorrect.

The equation I am attempting to execute is as follows:
84.146e-.00006x

I have placed the above equation into raster calculator as follows:
Power(84.146,(-.00006*"NortheastTerrain"))

Where "NortheastTerrain" is the raster layer I am using to calculate.

How can I correct this error?


texts: pgr_createTopology() 'Connection to the server has been lost'

texts:
When trying to create topology from pgAdmin 4 (version 2.1) with the pgr_createTopology function I get an error:

"Connection to the server has been lost."

The database is on localhost. The input network data set contains 865609 road features from Open Street Map.

When executing the query it starts running and shows the messages such as '1000 edges processed', indicating that the initial function execution is correct. Since the data set is rather large I do not look (on the monitor) at the entire process. But three times now when I came back I saw the error.

Connection error in the pgAdmin documentation only provides explanation about initializing the connection. That does not seem to be the problem as query execution starts normally.

I have previously tried with smaller datasets with succes, so my guess is that the size/processing time is the culprit here.

How can I prevent the 'connection to the server has been lost' error from showing up when executing the pgr_createTopology() function?

Version info:
POSTGIS="2.4.3 r16312" PGSQL="100" GEOS="3.6.2-CAPI-1.10.2 4d2925d" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.3, released 2017/11/20" LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" RASTER


texts: Seeking - Gurugram, (Haryana India) tehsil land use\Land cover statistics

texts:
I need landuse and land cover statistics for GURUGRAM district's four tehsils named-

Gurugram,
Manesar,
Sohna,
Farrukhnagar.

LULC layers may be like Agricultural land, Builtup area, Open area, Wasteland, hilly area etc.


texts: I have an ESRI feature class whose coordinates are 38.263, -122.672 Meters.  When I load it into a data frame that uses the GCS_NAD_1983_NSRS2007 datum and the NAD_1983_NSRS2007_California_Teale_Albers projection, it shows up a) very very small, and b) in the Sierra Nevada foothills rather than near San Fancisco Bay (which is at 38 degrees North and 122 degrees West).  I think the problem would be solved if the feature class's linear unit was changed from Meter to Degree.  How do I do this?


texts: Average of points within range of a point using FME without buffering?

texts:
There are a series of reference points along a track and another set of observation points nearby with an observed value as an attribute. For each reference point it is necessary to find the average of the attribute of all observation points that are within some distance (e.g. 20 meters).

Ideally this would be done without buffering and the number of related points is also recorded.


texts: Getting geocodes of US highway EXITS using Google Maps API?

texts:
I am developing an application on Laravel where I would show nearby hotels around the user's current location. I have successfully done that part. Now if the user is going on the highway, I need to find the next EXIT point of that highway and getting the coordinates of that EXIT point, I have to show nearby hotels around that coordinates. How can I get geocodes for the EXIT points of highway ?

I did some research on HERE.com and ArcGIS for the API's but I am not getting exactly what I am searching.


texts: QGIS dll load fail with from qgis._core import *

texts:
I have a error in console python, I tried using pyqgis without qgis interface.

My problem is when I use: from qgis.core import *

Console's the message is:

from qgis.core import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\OSGeo4W64\apps\qgis\python\qgis\core\__init__.py", line 25, in <module>
    from qgis._core import *
ImportError: DLL load failed: No se encontr¾ el proceso especificado.

my variables are:

Path:

C:\Python27\Scripts;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%SYSTEMROOT%\System32\OpenSSH\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Python27;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\Python27\Lib\site-packages\PyQt4;C:\OSGeo4W64\apps\qgis-dev\bin;C:\OSGeo4W64\apps\qgis-ltr\bin;C:\OSGeo4W64\apps\qgis-ltr-dev\bin;C:\OSGeo4W64;C:\OSGeo4W64\bin;
PYTHONPATH: C:\OSGeo4W64\apps\qgis\python;C:\Users\Paola Flores\python-qt5;C:\OSGeo4W64\apps\Python27;C:\OSGeo4W64\apps\Python27\Lib\site-packages;C:\OSGeo4W64\apps\qgis\python\qgis;C:\OSGeo4W64\apps\qgis-ltr\bin;C:\OSGeo4W64\apps\qgis-dev\bin;C:\OSGeo4W64\apps\qgis-ltr-dev\bin;C:\OSGeo4W64;C:\OSGeo4W64\apps\qgis-dev\python;C:\OSGeo4W64\apps\qgis-ltr\python;C:\OSGeo4W64\apps\qgis-dev\;


texts:
I have developed a plugin where I am filling my GUI Control like (Drop down) in initGui Event. But the problem is that if I open my plugin it's only exectures Run events. Its initGui event doesn't fire and my control are not updating with data. As you can see in my initGui Event I also print a message which is also not showing as my plugin start.

  def initGui(self):
        """Create the menu entries and toolbar icons inside the QGIS GUI."""

        icon_path = ':/plugins/TaskAutomation/icon.png'

        self.add_action(
            icon_path,
            text=self.tr(u'TLL Task Automation'),
            callback=self.run,
            parent=self.iface.mainWindow())
        self.AttachBtnClicked()
        self.AllCBLayersFill()
        self.AttachCBLayersIndexChange()
        print 'initGui  method' #this message is not showing when plugin start

    def unload(self):
        """Removes the plugin menu item and icon from QGIS GUI."""
        for action in self.actions:
            self.iface.removePluginMenu(
                self.tr(u'&TLL QGIS Task Automation'),
                action)
            self.iface.removeToolBarIcon(action)
        # remove the toolbar
        del self.toolbar
        print 'unload  method'

    def run(self):

        """Run method that performs all the real work"""
        print 'run  method 123'
        # show the dialog
        self.dlg.show()
        # Run the dialog event loop
        result = self.dlg.exec_()
        # See if OK was pressed
        if result:
            # Do something useful here - delete the line containing pass and
            # substitute with your code.
            pass


texts: Upgrading custom Java script tool (ver. 1.3 to 3.1 ) for ArcGIS Java Script API and getting error?

texts:
I have found useful tool here (All US States and counties on combo-box) its using Java script API 1.3 version.

I have downloaded the tool and trying use but its gives an store error (using version 3.1) but when I change the version to 2.8 its working fine..so how do I implement it for 3.1 version.

Is there any document or instructions ?? (Because Esri mentions that only upgrade the version no. ex.  2.8 to 3.1 )..

Software that I am using is ArcGIS Java Script API ver 3.0 & ArcGIS Server 10.1,Desktop 10.1


texts: Obtaining length of non projected feature (gcs_wgs_84) in meters instead of decimal degrees?

texts:
I could not find a post which answered to my problem and I hope I didn't miss it, in case I did I apologize.

I'm working with Arcgis 10 and I have a multiple lines feature with gcs_wgs_1984 geographic coordinate system (same of the data frame).

I'm not very familiar with coordinate systems and projections and I've being stuck with this problem for a while, so I hope you can help.

I want to see in the attribute table of the feature the length of each line, but it is obviously shown in decimal degrees.

Which is the best solution to get that length in meters?
Should I project my feature in a projected coordinate system?
Which system would suit me better for this porpose?
If I project a feature in a projected coordinate system will it still appear on the non projected data frame?

I tried to project it (project tool) in wgs84 Utm 32N but it gives me unknown error 999998.

The zone I'm working on is the city of Milan in Italy, if that's of any use.


texts: Convert multiple csv (specific date range) to shp using ArcPy

texts:
I have multiples CSV files. Every CSV file contains 365 days of different weather parameters for different location. I want to take specific month from every csv row and export it to point shp file using ArcPy. Can you help me to do it using ArcPy. In csv date format is (MM DD YY)
Below i have attached my python code.This code giving me error while i running date specific

import arcpy,os
... shpworkspace = r"D:\SWAT-WEATHER-DATA2"
... arcpy.env.workspace = shpworkspace
... arcpy.env.overwriteOutput = True
...
... csvlist = arcpy.ListFiles("*.csv")
...
... for csvfile in csvlist:
    print csvfile
    outlayer = "CSVEventLayer"
    spatialreference = "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision"
    arcpy.MakeXYEventLayer_management(csvfile,"Longitude","Latitude","Date 1/1/2013-1/31/2013",outlayer,spatialreference,"#")

    shpfile = os.path.splitext(csvfile)[0].replace('-','_')
    arcpy.CopyFeatures_management(outlayer,shpfile)

    del outlayer

I have edited my code based on suggestions from different expert. Still i am getting error. Kindly guide me to solve this issue.

import arcpy,os
... shpworkspace = r"D:\SWAT-WEATHER-DATA4"
... arcpy.env.workspace = shpworkspace
... arcpy.env.overwriteOutput = True
...
... csvlist = arcpy.ListFiles("*.csv")
...
... for csvfile in csvlist:
    print csvfile
    outlayer = "CSVEventLayer"
    spatialreference = "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision"
    arcpy.MakeXYEventLayer_management(csvfile,"Longitude","Latitude",outlayer,spatialreference,"#")
    arcpy.SelectLayerByAttribute_management(outlayer, "NEW_SELECTION", "Date" >= date "01/01/2013 00:00:00" AND "Date" < date "01/31/2013 00:00:00")
    shpfile = os.path.splitext(csvfile)[0].replace('-','_')
    arcpy.CopyFeatures_management(outlayer,shpfile)

    del outlayer


texts: QGIS create layer with the points of the beginnings and ends of a polylines layer (without duplicate points)

texts: In QGIS, i would like to create a new layer containing the beginning and end points of a polylines layer, but without the duplicate points that would result of adjacent polylines.


texts: Merge DWGs to 1DWG and put all corresponding objects to one new layer named as the original filename

texts:
I have 1000 dwg that has text and lines on 2 layer, i want to merge them all in one dwg and the final dwg should have as layer names all the filename and all the objects (text,lines) should be in only one layer which is the filename the come from.

e.g   t1.dwg, t2.dwg... -> merge.dwg (with two layer t1,t2...) every object from t1.dwg should be inside t1 layer in the merged dwg, same with the object from t2.dwg should be all inside t2 layer on the merged dwg, and so one for all the dwgs used as input.

Software used Fme Desktop.


texts: Getting error 000732 when running python script

texts:
I created a tool for a team, which worked perfectly. Once I started changing the directories of where things are saved it stopped working. I keep getting error 000732 for my code. I think it's because where the team are working, their folders have path names

Below are the first few lines of code, and where the error occurs

import arcpy, os, sys, datetime, xlrd, csv
from arcpy import env

env.workspace = r"S:\Acoustics\Projects\T3487.3 - C231 HS2 Phase 2b\10 Baseline Modelling\08 Datasets Input and Output Toolbox\Ronan_Test.mxd"
arcpy.env.overwriteOutput = True
pointfc = arcpy.GetParameter(0) # This is a point feature class
excel = arcpy.GetParameterAsText(1) #this is their excel sheet
outputloc = arcpy.GetParameterAsText(2) # this is a GDB to store results
Name = arcpy.GetParameterAsText(3) #String
Model_Run = arcpy.GetParameterAsText(4) #String
today = datetime.datetime.today().strftime('%y%m%d')

# This is to convert the excel into a CSV file that can be put through the tool
def csv_from_excel():
    wb = xlrd.open_workbook(excel)
    sh = wb.sheet_by_index(0)
    csv_temp = open('csv_temp.csv', 'w')
    wr = csv.writer(csv_temp, quoting=csv.QUOTE_ALL)
    for rownum in range(sh.nrows):
        wr.writerow(sh.row_values(rownum))
    csv_temp.close()

csv_from_excel()

excelscript = r"S:\Acoustics\Projects\T3487.3 - C231 HS2 Phase 2b\10 Baseline Modelling\08 Datasets Input and Output Toolbox\Ronan Scripts\csv_temp.csv"

# This is to copy to the points layer, to append the data from the excel sheet to it and save it out
arcpy.CopyRows_management(excelscript, r"S:\Acoustics\Projects\T3487.3 - C231 HS2 Phase 2b\10 Baseline Modelling\08 Datasets Input and Output Toolbox\Ronan Scripts\Testsheet")
pfc_temp = r"S:\Acoustics\Projects\T3487.3 - C231 HS2 Phase 2b\10 Baseline Modelling\08 Datasets Input and Output Toolbox\Ronan Scripts\Testsheet"
arcpy.FeatureClassToFeatureClass_conversion(pointfc, outputloc, "pfc_temp2")
pfc_temp2 = r"S:\Acoustics\Projects\T3487.3 - C231 HS2 Phase 2b\10 Baseline Modelling\08 Datasets Input and Output Toolbox\Ronan Scripts\pfc_temp2"
arcpy.JoinField_management(pfc_temp2, "al_id", pfc_temp, "al_id")

When working from my C drive with folders that have no spaces it works fine, but not with the new folders. The most common error I get is;

spaces in the path or file name are not supported for INFO tables or coverages.

Is there a work around? I'm not sure it's feasible for me to rename all the folders on other teams as it may mess up work they have going on in different areas.


texts: Tool to expand one feature to align with another

texts:
I have an island (grey) and ocean (blue). These are individual features in the same layer. There are several areas where the ocean feature does not meet the land.

I can create a map topology and use the Align Edge tool to fix the gaps on an individual basis, but I want to find one tool that will expand the surrounding polygon (blue) to meet the edge of the island polygon.

Is there a simple tool that exists for this, or another process within an edit session? I have an Advanced License so I would be very surprised if there is nothing like this.


texts: Finding which side of closest polyline point lies on in QGIS?

texts:
I would like to find on which side of the line (left or right) my points are located with respect to the direction of the line (like knowing the rivers bank along a meandering river). But, if there are several lines, I am only interested in the closest line.

I know that I could use one sided buffers like it is suggested in this post, but this doesn't work well when several lines are close to each other near the point.

For instance, there are sometimes two (or more) lines close to my point of interest, which then create two (or more) overlapping polygons covering this point. In this case, the point could be on the left of one line and on the right of the other.

I only want to know the side of the closest road to the point (avoiding multiple buffers and selections because the database is very large. A single query maybe.)


texts: Getting LayerTree reference in Processing script in QGIS 3

texts:
Let's say my algorithm returns many layers and I need to insert those layers into the specific index in layer list, while running algorithm.

QgsProject.instance().layerTreeRoot() worked in QGIS 2 and I could change layers indexes as described in QGIS Layer Tree API (Part 2), while Processing algorithm was running.

How can I do the same thing in QGIS 3 Processing script?

I took a glance at QgsProcessingAlgorithm Class Reference. There are some functions like parameterAs****(). I thought one of them could help me. But I couldn't find useful function. I can get layer, layer list, crs etc. by means of some. But I can't get the layer tree (layerTreeRoot) or the project (QgsProject) reference.


texts: Can QGIS Sextante batch extract vertices from KML polygons and calculate coordinates?

texts:
I want to know how to extract the vertices of any KML polygon and also calculate the co-ordinates of such vertices in Degree Decimal format. I am looking at a batch process.

Can we use QGIS Sextante to do such a thing?


texts: How to save shapefile as type 1 point file in QGIS?

texts:
QGIS saves point shapefiles as type 8 - Multipoint as default. I need QGIS to save as type-1 Point file.

How?


texts: Creating lines from polygon borders with polygon attributes using ArcGIS/ArcPy?

texts:
I have a shapefile of polygons that border each other perfectly, each with a numerical attriubte.  I'd to create a shapefile of lines, where every line is created from the border between two polygons, and those lines have the attributes of both the polygons that they border.

How do I do this using ArcGIS for Desktop?


texts: Export multiple layers with the same name in the TOC to separate layers with unique names

texts:
I need help using the arcpy mapping module to export multiple layers (with the same name) in my table of contents to new shapefiles with unique names.  Here's a screenshot of my TOC:

I want to export each SGravityMain layer and append the last character in the group layer name (a b or c) to the new shapefile.  I am stuck.

Here is my code:

import os, arcpy

folder = "path\to\folder"

#Get name of vector layers in the TOC
mxd = arcpy.mapping.MapDocument("current")
df = arcpy.mapping.ListDataFrames(mxd)[0]
layers = [f.name for f in arcpy.mapping.ListLayers(mxd, "*", df) if f.isFeatureLayer]

for layer in layers:
    #Join output folder to layer name and append .shp
    shp_out = os.path.join(folder, "{}.shp".format(layer))
    arcpy.CopyFeatures_management(layer, shp_out)

This is just a sub set of data and I actually have around 300 group layers in my MXD.

Can someone please help?


texts: Processing modeler in QGIS 3.16: connection line and wedge buffer for several points

texts:
I would like to automate two tasks using the processing modeler of QGIS 3.16. The two layers A (shown in blue) and B (orange) consists of point geometries. They should be used as input by the user and have an unknown data model.
Step 1: The first task is to create a line (output=linestring) between all the points of layer A to all the points of layer B (n:n relationship). I thought of the tool "distance to the nearest hub", but then only the nearest point would be included and not all the points of B. The tool "hub lines" from vector analysis doesn't seem appropriate to me either, because the data model of the input is too diverse.
Step 2: In the next step a wedge buffer should be generated. The connecting lines from step 1 should be used as the respective azimuth. As input I will use all geometries of point A. Wedge with = 30 degrees, inner radius = 1000 meters and outer radius = 2000 meters.
In the picture you can see the result of two points from layer A to one point from layer B. In addition to the other points from layer B, I want to have a connection line and a wedge buffer created.

Do you have some hints for me? How can I address the geometry of all features of two different layers (e.g. with collecting by aggregate)?


texts:
I have found several solutions for crazy polygon detecting algorithms, however, my problem is a bit simpler.
I have a line created by an array of indexed points. Each click on map creates a new point and appends it to the end of the array, and creates a new line from the previous end to the new one.

I would like to detect when you create a point in a way that the line folds on itself and creates a polygon. I currently create a polygon when you click the first point again. Then all the points inside get selected.

Here the 4th point was created and the line closed creating a triangle. Is there a simple solution to detect this?

Edit: Using leaflet library


texts:
I found this thread in the old ESRI forums with the same type of problem I am facing today. The solution to the problem is explained in little detail and since I am not an expert, I was wondering if somebody could describe it to me in little more detail.

We are doing a mental map analysis. We have let's say 50 polygons of a certain city square which are all different in shape, size and location. Our goal is to create a single polygon which would represent the answers from our whole input data. So basically, we need a method for generating a single polygon out of these 50 which would be an "average" polygon in size, shape and location.

Can somebody explain the process?


texts: Why is QgsFeatureIterator returning bad data?

texts:
This is a spin-off of another question I asked previously, but it has grown in scope and deserves its own thread.

While iterating over a vector layer (shapefile) I included the following if-statement with a breakpoint to check for none NULL values. I started noticing that it was finding values even with an empty field "class" (i.e. all values should be NULL)

if feature.attributes()[fieldIdx["class"]] != None:
    log.write("We got one!!")

Most of the time this behaves as expected (i.e. it is skipped), but occasionally this is triggered. While in the interactive debugging console I poked around a bit.

feature.attributes()
>>> [NULL, NULL, NULL, NULL, 388.0, 9.0, 8.0, 8.0, 1.0, 1, NULL, NULL, u'******************************************************************************************']

This is strange on many levels. The first 4 fields should be defined, but they are NULL. In particular the first field is the feature ID. The order is not mixed. The values are just... wrong. fieldNameIndex shows the expected index.

feature.fieldNameIndex("class")
>>> 9
feature.fieldNameIndex("ID")
>>> 0

Furthermore, if I try grabbing the feature again. I get the correct values with the NULL in the right place.

prov = layer.dataProvider()
f = prov.getFeatures(QgsFeatureRequest(4089)).next()
f.attributes()
>>> [4089, 87758.61373109999, 88258.61373109999, 67765.346125, 68265.346125, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL]

Is my file corrupt? Is this a bug in QgsFeatureIterator?

EDIT: I still can't reproduce the behavior with the most minimal code, even using the original file.

layer = iface.mapCanvas().layer(0)
prov = layer.dataProvider()
layer.startEditing()
if prov.fieldNameIndex("class") == -1:
    prov.addAttributes([QgsField("class",QVariant.Int)])
if prov.fieldNameIndex("testField") == -1:
    prov.addAttributes([QgsField("testField",QVariant.Double)])

layer.updateFields()
layer.commitChanges()
idx = prov.fieldNameIndex("class")
testIdx = prov.fieldNameIndex("testField")

featureator = layer.getFeatures()
for feature in featureator:
    ID = feature.id()

    if feature.attributes()[idx] != None:
        print ID
        print feature.attributes()
        message = "feature {0} has a non-NULL class and the following attributes: {1}".format(ID,feature.attributes())
        QgsMessageLog.logMessage(message,  "Debug",  0)
        break

    # perhaps frequent editing/committing in loop can create problems?
    layer.startEditing()
    layer.changeAttributeValue(ID, testIdx, ID/3)
    layer.commitChanges()


texts: Using Esri leaflet feature layer toggle?

texts:
I have a feature layer that I am trying to toggle on / off via click. The problem I am having is that if I toggle the layer on and then off, it does not update to the screen unless I zoom in / out and the screen refreshes.

Is there any way around this?

The toggle is in the upper right corner "Markers".

This example does not work with IE 11 for some reason.

https://plnkr.co/fjPvS5AVBSIztzRxNfVV

I just discovered the refresh() method.

This does not work in all my scenarios, however. When I perform a query, the search results are added via a separate layer and zoomed to bounds. If the feature layer is already visible, it works as expected. But if I activate the layer after the search has taken place, the layer does not show unless I zoom in / out. If I can not figure this out, I will add a query to the plunker.

You can see this behaviour in the current plunker .

Turn off the feature layer.
Zoom the map either in or out.
Turn on the feature layer, no features will appear.
Zoom in or out and the features will appear.

Is there maybe an event or something I am missing?


texts: Getting rid of warning messages when selecting by location using PyQGIS?

texts:
I am running a Python script in QGIS 2.18.26 and I have a select by location with a code like that:

indir = "C:/Infolder/"
outdir = "C:/Outfolder/"

os.chdir(indir)

for fname in glob.glob("*.shp"):
    layerResult = processing.getObject(fname)

    QgsMapLayerRegistry.instance().addMapLayer(layerResult)
    processing.runalg("qgis:selectbylocation", layerResult, "C:/SomePolygon.shp", u'within',0,0)

    result= outdir + 'Test' + fname
    processing.runalg('qgis:saveselectedfeatures', layerResult, result)
    #processing.load(result)
    QgsMapLayerRegistry.instance().removeMapLayers( [layerResult.id()] )

In case there is no section, I receive a pop-up window as follows:

I want to avoid that pop-up window because it slows down the whole process.

Can you please advise how I can get rid of it?


texts: R - multicore approach to extract raster values using spatial points

texts:
It might look like this question is duplicated, but I'm asking about data extraction by points, rather than by polygons, and I couldn't find hints about point extraction. Therefore, please bare with me.

I am working with a massive amount of climate files whose values need to be extracted and converted to data frames in order to serve as a database for a Shiny application.

Specifically, I need to extract daily temperature values from a raster stack for 655 locations (points) and store those values in a data frame. Given the amount of data, I estimate the final data frame to be around 30 GB in size.

Since it is such a big amount of data, I am looking to use a multicore (parallel) approach that benefits from a quad core (8 threads) system. I also consider to process these data on an Amazon EC2 instance, so I need to speed up the code as much as I can in order to prevent wasting time (i.e. money).

I know that the raster package provides the multicore function beginCluster that might help me, but according to the documentation it only works when extracting data using polygons, not points.

Please take a look at the code that reproduces my procedure using a simplified version of my raster stack:

library(raster)

# Create date sequence
idx <- seq(as.Date("2010/1/1"), as.Date("2099/12/31"), by = "day")

# Create raster stack and assign dates
# WARNING: raster stack will be ~ 400 MB in size
r <- raster(ncol=5, nrow=5)
s <- stack(lapply(1:length(idx), function(x) setValues(r, runif(ncell(r)))))
s <- setZ(s, idx)

# Create random spatial points
pts <- SpatialPoints(cbind(x=runif(655, -180, 180),
                           y=runif(655, -90, 90)),
                     proj4string=CRS(projection(s)))

# Extract values to a data frame
e.df <- extract(s, pts, df=TRUE)

# Fix resulting data frame
DF <- data.frame(t(e.df[-1])); row.names(DF)=NULL
DF <- cbind(getZ(s), DF)
names(DF)[1] <- "Date";
names(DF)[2:length(names(DF))] <- paste0('Point ', 1:length(pts))

In the code above, clearly the slowest part of the process is the data extraction itself.

Is there any way to improve the speed of this data extraction procedure?

Any way to implement it under a multicore function?


texts: QGIS processing tools - saving/exporting graph

texts:
I just tried QGIS processing tools for the first time.

When using shortest path search for the first time, the algorithm is building a path graph (of course). However, the graph is never re-used. Every time the algorithm is used, the graph building starts again. I am not familiar with the exact code used for it, but I guess the graph is network-wide, not related to the specific points I selected. So is there a way to re-use the graph? Er even export it to a file?

My network is large (more than 200k features), so efficiency is important. The network is rarely updated, so calculating a graph could easily be done just once in a while.

I looked up the docs and settings of processing tools, and this option seems to be unavailable (which is surprising). So maybe I am missing something, or maybe someone could suggest a way to serialize the graph and save it using python code? I am using QGIS 3.1 (A Coruna).

This is a programming question so I took liberty to repost it to stack overflow.


texts: How to extract vegetation polygons from Imagery using Python?

texts:
I have been trying to roughly polygonize vegetation areas from Imagery (RGB). I tried using Iso Cluster Unsupervised Classification (Spatial Analyst) but it is still too detailed for my purpose. I just need to roughly draw polygons wherever I have dense vegetation as can be seen here:

Any idea/ thought to put me on the right track is much appreciated.


texts: QGIS 3.4, how to add .qml style to sink in processing

texts:
How can I import a .qml style from a file and apply it to a sink?

In QGIS 2.18, I used something like that script:

output=QgsVectorLayer ('Point?crs=EPSG:2154','output', 'memory')
path_style='./path/to/style.qml'
output.loadNamedStyle(path_style)
output.triggerRepaint()

But when I tried it on anita graser's example of QGIS3 script, .loadNamedStyle() wouldn't work on the sink OUTPUT:

from qgis.PyQt.QtCore import QCoreApplication, QVariant
from qgis.core import (QgsField, QgsFeature, QgsFeatureSink, QgsFeatureRequest, QgsProcessing, QgsProcessingAlgorithm, QgsProcessingParameterFeatureSource, QgsProcessingParameterFeatureSink)

class ExAlgo(QgsProcessingAlgorithm):
    INPUT = 'INPUT'
    OUTPUT = 'OUTPUT'
    def __init__(self):
        super().__init__()
    def name(self):
        return "exalgo"
    def tr(self, text):
        return QCoreApplication.translate("exalgo", text)
    def createInstance(self):
        return type(self)()

    def initAlgorithm(self, config=None):
        self.addParameter(QgsProcessingParameterFeatureSource(
            self.INPUT,
            self.tr("Input layer"),
            [QgsProcessing.TypeVectorAnyGeometry]))
        self.addParameter(QgsProcessingParameterFeatureSink(
            self.OUTPUT,
            self.tr("Output layer"),
            QgsProcessing.TypeVectorAnyGeometry))

    def processAlgorithm(self, parameters, context, feedback):
        source = self.parameterAsSource(parameters, self.INPUT, context)
        (sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context,
                                               source.fields(), source.wkbType(), source.sourceCrs())

        features = source.getFeatures(QgsFeatureRequest())
        for feat in features:
            out_feat = QgsFeature()
            out_feat.setGeometry(feat.geometry())
            out_feat.setAttributes(feat.attributes())
            sink.addFeature(out_feat, QgsFeatureSink.FastInsert)

        # --------------------the part that doesn't work:
        path_style='./path/to/style.qml'
        sink.loadNamedStyle(path_style)
        sink.triggerRepaint()
        #--------------------

        return {self.OUTPUT: dest_id}

Is there a simple way to load and apply a style in the new QGIS Processing?


texts: Identifying name of isolated projection?

texts:
Houdini has plugins that allow you to import an OSM file.  For example an area of a city, bound by a rectangle of northeast and southwest latitudes and longitudes.

When you input the OSM data into Houdini it runs it through a small python script that calculates the area height in meters along the latitude (taking into consideration the curvature of the earth).  Same for width in meters along longitude.

It then converts all the lat,lon points in the area and makes them relative to the southwest (min) corner, in the range of 0.0 to 1.0.

Finally it multiplies each point by the width and height values.  This gives you points in a 2D plane, in meters that are scaled very closely to the source area.

What is this type of isolated projection called?


texts: Spatial Join on two point featureclasses produces empty output featureclass

texts:
I have two point featureclasses that intersect each other. They are in the same projection and dataframe. The issue is, when I perform a Spatial Join the output point featureclass is empty. The file is created and the attribute table contains fields, but the points are not created where they intersect.

In reverse this operation works successfully (proving they do intersect), but I obviously end up with the wrong attributes in the output file. I have searched this issue, but have yet to come up with a plausible solution.

I suspect this may have something to do with the fields used to uniquely identify the points within each featureclass, but so far I have yet to find a problem. I even attempted to delete extraneous fields from each file, since I only really want to transfer one attribute field across the featureclasses.

Edit: This questions is related to my previous post.

Edit 2: As some have suggested I have incremented the search tolerance without change.


texts: Condensing sparse geocodes to weighted Geo-Circles?

texts:
I have a dataset comprising 3 million records having latitude and longitude information associated with them. I want to condense it to form few thousands Geo-Circles, with radius and weight depending upon the records comprising in it.

Any suggestion regarding this kind of approximation algorithm or tool helping to build this?


texts: Allow web user to add a new raster layer to the OWS service

texts:
Suppose that we have a web application that is showing a basemap. We want to allow users to upload their raster file into the server and server shows the new added raster file automatically after upload is done. Is it possible?

If yes, which OGC standard protocol should I use (WMS, WFS, WCS)?


texts: What is a crash dumped / crash minidump?

texts:
There are lots of posts to do with QGIS crashing; they tend to deal with specific instances and conditions.

But this has led me to want to know what is a crash minidump?

What is happening, is there a simple answer?

The background leading up to this is that I have a user that has a crash minidump every time that they close QGIS (2.14.9), even though many others are using the same version, on exactly the same machines, of the same age and make without issue.

Then myself, using QGIS 2.16 , I was testing out an answer from Merging attribute and geometric features in QGIS? it gave me a crash minidump each time I tried dissolve vectors. So I decided to uninstall 2.16, and install 2.18

But before I did this I looked for information on crash minidump and yes, the main accepted advice, which works, is to Delete C:\users\name.qgis2 before re-installing

But what is a crash minidump, what’s happening?

Edit added

The user mentioned above, after a of week of no crash mini dump's, is again reporting that the issue is back. Again every time they close QGIS?

What actually causes QGIS to crash? Could it be a hardware issue possibly?


texts: Creating Virtual Layer with only desired fields

texts:
My question is very similar to this one. The difference being I want multiple fields where they wanted only a single field.
I'm trying to create a virtual copy of my layer with only the following fields:
"Acres", "Zoning", and "LinktoSOA".
I've tried these queries, but neither worked.
Select geometry, IN ["Acres", "Zoning", "LinktoSOA"]
from "WilmingtonParcels"

Select geometry, IN {"Acres", "Zoning", "LinktoSOA"}
from "WilmingtonParcels"

Select geometry, IN ("Acres", "Zoning", "LinktoSOA")
from "WilmingtonParcels"


texts: Method of inputing time series data in ArcGIS

texts:
I have weather stations with its geographical location ( lat,long, ht) along with daily temperature and rainfall data in time series format. I would like to use this meteorological data to interpolate for the remaining area ( no stations area) using around 5 stations.
However, I have faced problem while trying to trying to interpolate using kriging method, as my daily meteorological data is associated with geographical coordinates of the station. ( the input data was generated from CSV file with following column : latitude, longitude, height, temperature, rainfall- so if I have 100 records of temperature and rainfall records of station A, then I have same number of geographical records of station A).

If anyone could suggest me how to input data with time series data in arcmap for single station A without duplicating the location in attribute table?


texts: Does anyone know of an explicit formula that I can plug-n-chug with to convert WGS84 lat lon to kilometers or miles?

texts: I have a lot of lat lon coordinates in WGS84 format and I'm trying to get those into kilometers so that I'm able to calculate distance.


texts: traveling salesman without u-turn v.net.salesman grass

texts:
I want to compute a traveling salesman path with GRASS GIS 7.2.1 which avoids u-turns.

I made a network with v.net connect.
I made a turntable using this network.
I updated layer 3 of the turntable with costs=-1 where angle>3.14 (+/-180deg).
It looks to be ok because ln_from and ln_to are the same with this query.

I try v.net.salesman using the turntable (layer 1 to 4) but the result is bad. U-turns are still present and there's a lot of superimposed lines in the result.


texts: Prevent GeoWebCache from re-rendering tiles when the data is updated

texts:
How can I prevent GeoWebCache from re-rendering the map tiles when the underlying data has changed?

There's a script which deletes the cache every X seconds. I want GeoWebCache to only re-render tiles when my script has deleted the cache. Currently, GeoWebCache does re-render when the cache has been cleared however it also re-renders when the data changes.


texts: Extra square brackets in variable substitution - GeoServer SLD

texts:
I am trying to create a SLD in GeoServer to change the layer style based on the attribute passed. I am using GoeServer Variable substitution. The following is block of my SLD.

<Rule>
<Name>Name</Name>
<Title>Title</Title>
<ogc:Filter>
    <ogc:PropertyIsLessThan>
        <ogc:Function name="property">
            <ogc:Function name="env">
                <ogc:Literal>attribute</ogc:Literal>
                <ogc:Literal>default_attribute</ogc:Literal>
            </ogc:Function>
        </ogc:Function>
        <ogc:Literal>20000</ogc:Literal>
    </ogc:PropertyIsLessThan>
</ogc:Filter>
<PolygonSymbolizer>
    <Fill>
        <CssParameter name="fill">#edf8fb</CssParameter>
        <CssParameter name="fill-opacity">0.5</CssParameter>
    </Fill>
</PolygonSymbolizer>

For example if I am passing the string 'atr1' through environment variable like this.

  ...&env=attribute:atr1&...

I am getting the exception as follows

  The requested Style can not be used with this layer. The style specifies an attribute of [[atr1]] and the layer is: workspace:layer_name

Two square brackets gets added to the string which I passed. If I didn't pass any value for variable, the layer is getting displayed using default attribute.
How to avoid those square brackets ?

I am using GeoServer version is 2.10.1


texts:
I am trying to stitch together several GEO Tiffs that come in pairs (north -south) but when i load them into QGIS they display completely overlapped.  That is the north south pair match up ok (display next to one another) but when I add a second north-south pair they completely overlap the previous layers rather than being positioned next to the previous pair.

I recently found a tutorial that had a command in qgis to lay them out of the canvas correctly but I cannot find it now for some reason.

Has anyone else had this problem ??


texts: Making pop-ups offset from default location in ArcGIS Online to avoid covering of area under consideration?

texts:
I am working on a property parcel and have to show the pop-ups in ArcGIS Online. But when I  click on the property the pop-ups partially cover the property. The goal is the take screenshot of property plus the pop-up.

How can I make the pop-ups offset from the property?


texts: Why does GPS not give any info before it has a fix?

texts:
All GPS devices tell me how much positioning error there is in the fix (e.g. 12 meters). Then why does it not tell me anything before it has a very accurate fix?

When a device is looking for its location, I can see that it receives certain satellites, so it surely knows which side of the world I'm on. I'm assuming that at some point it will know which part of the country I'm in, even if it doesn't have it down to street level.

Is there something in the physics that prevent this, is it a hardware/firmware thing that I cannot fix even if I could rewrite the software part, or is it just the software giving up when it has too much error?


texts: QGIS 2.18.28 Dissolve Error: "-2147483645 See log for more details"

texts:
I am doing property research on a county in Texas. I have all the parcel data and am trying to dissolve by Owner Name so that I can use the info tool to quickly see all the properties a given person owns in the county. I have dissolved successfully in two other counties already and have employed the same process for this county. But for some reason when I hit "Run" in the dissolve tool, I keep getting the same error message. "-2147483645 See log for more details" See a picture of the error box below.

Unless I don't know where to look, I am not seeing any information on what the issue is. I have googled the error message with 0 results.


texts: What is the meaning of "SI-D-48-Gauss_Kruger" projection used in an ESRI WKT string?

texts:
Recently I encountered the following WKT CRS definition from an ArcMap project:

PROJCS["SI-D-48-Gauss_Kruger",GEOGCS["GCS_Bessel_1841",DATUM["D_Bessel_1841",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Gauss_Kruger"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",-5000000.0],PARAMETER["Central_Meridian",15.0],PARAMETER["Scale_Factor",0.9999],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

While this is identified in ArcMap as EPSG:3912, the definition varies from the standard definition of EPSG:3912. I can't find any reference to the "SI-D-48-Gauss_Kruger" projection, or the "D_Bessel_1841" datum online.

I'm seeking any background anyone may have on this particular projection (and datum), and why they have been used in the WKT definition of this CRS.


texts:
I'm trying to install lizmap web client, following the steps present in here: http://www.3liz.com/blog/rldhont/index.php?post/2012/11/06/Test-LizMap-on-Windows-with-OSGEO4W.
But unfourtunally i can't get by step 20, this because when i install OSGeo4W it does not create the temp folder that is necessary to store lizmap temporare files.
Can anyome help?
Sorry for the english, i'm portuguese.


texts: Adding color to polylines in leaflet in R


texts: Can I access Trimble logged positions in ArcMap10?

texts:
We recently walked a fence perimeter with a Trimble Ranger, auto-logging positions at 5 second intervals in a generic point file. The exported file acknowledges over 800 points, but only displays the specifically recorded points (far fewer than 800). Is it possible to access the internally logged points and convert/display them as features in Arc?

My apologies if this is common knowledge, I've had no luck in over an hour of browsing forums. Thanks in advance for any help.


texts:
I am using CESIUM JS. I posted a message in cesium forum some days ago, but I didn't manage to find a solution.

I have a 3D camera moving freely on a map.
I have a 2D map (let's call it minimap) that show a flat representation of the current location.

In the Minimap, I would like to represent the rotation (only heading since it's 2D) of the camera.

Now, since the 2d MAP always point to the globe north, and the camera is free to rotate in all the direction, I need to represent the rotation of the camera relative to East North Up coordinate (ENU) to use the correct heading for the minimap.

Cesium provide a lot of tools https://cesium.com/docs/cesiumjs-ref-doc/Transforms.html?classFilter=Transform#.eastNorthUpToFixedFrame

and I tried to use them, but it's really confusing and I don't quite get exactly how it works.

I tried for exemple

// get a fixed frame (matrix4) at my current position with the correct ENU
matrix = Cesium.Transforms.eastNorthUpToFixedFrame(camera.position)
// use the matrix 4 to get heading pitch roll at the current fixed frame
headpitchroll = Cesium.Transforms.fixedFrameToHeadingPitchRoll(matrix)
// substract current north to the camera rotation
heading = camera.heading - headpitchroll.heading

But is not displaying the correct rotation.

Should I do something similar to this ?

get a fixed frame with no rotation of the current ENU
apply the camera rotation in this frame
get the heading of that rotation in that frame


texts:
I have a simple map that has 3 radio buttons, depending on the button selected defines how my layer is filtered. I was able to look at Leaflet : filter with condition and I can get my data added to the map. But I'm missing the logic to remove the layer when I switch radio buttons. So I just keep adding layers the more I change buttons.

map.removeLayer(ci_data); does not seem to work.

I have a limitation to use the same layer name as my app needs the ability to edit the GeoJSON layer coming from the database.

function refilterLayer(theLayerUsed) {

    ci_data = L.geoJson(null, {

        pointToLayer: function(feature, latlng) {

            return L.circleMarker(latlng, {
                color:'black',
                fillColor:  setColor(feature.properties.Verified),
                fillOpacity: 1,
                radius: 8
            })
        },
        filter: function(feature, layer) {

              if (theLayerUsed == 1) {
             return (feature.properties.Verified == "Y" );
              }
              else if (theLayerUsed == 2) {
                return (feature.properties.Verified == "N");
               }
               else {
                 return (feature.properties.Verified == "N")  || (feature.properties.Verified == "Y" );
               }
        },

    }).addTo(map);

    $.getJSON(url2data, function(data) {
        ci_data.addData(data);
     });

}


texts: aggregate raster using the most frequent value

texts: Does anyone have an idea how I could aggregate my raster so that in the output the most frequent value is used, as shown on the picture?


texts: Making simple election results map using CartoDB?

texts:
I'm creating a simple map in Cartodb to show the results of a local school referendum vote.

https://tmeyer1969.cartodb.com/viz/9a87c650-e8e2-11e5-8f7f-0e31c9be1b51/public_map

I think I've got the basics figured out in just one day but I'm hoping to shade each precinct in a gradient based on ranges of the margin of victory (positive if 'yes' wins, negative if 'no' wins). For example, > 10% would get the greenest green, 7.5-9.99% slightly lighter, 5.0-7.49 slightly lighter, < 0% pale red, < -10% dark red, etc .. Pretty much like conditional formatting in excel. Is this possible ?


texts: Performance improvement methods in a shapely environment

texts:
I am trying to use the Shapely and Fiona libraries to eliminate polygons from one layer (some triangles) from another layer (which represents the world's oceans).

I am looking for suggestions to improve the performance of how I've implemented this operation. I think I indexing the layers will help - using rtree or similar, but I haven't managed to get it to work.

Input Data:

layer with polygon (7,3 MB) of the oceans worldwide
layer with many triangles (300.000 aprox)

My goal is to find the fastest way to see whether or not the triangles are contained in the ocean polygons (1). For that, i have checked the prep method in shapely, but there are other methods such as str-packed-r-tree or using the library rtree in itself.

I was wondering what was the difference between them, how do they work, etc, to be able to guess what's the best to use in this case, and also to understand them better.

Below is the code of the function I wrote:

def clean_ocean(pathSourceOceans, pathSourceTriangles, pathOutput) :

    listGpkg = et1.fichiers_a_traiter(pathSourceTriangles,['gpkg'])
    print "list shapes", listGpkg

    for i in listGpkg :

        cheminOutput =  pathOutput+'netO_'+str(i)
        with fiona.open(pathSourceTriangles+i, 'r') as layerTriangles:

            with fiona.open(pathSourceOceans, 'r') as layerOcean:

                polygonOcean = asShape(layerOcean[1]['geometry'])
                prepPolygonOcean = prep(polygonOcean)

                # Create new schema
                layerOutput_schema = {'geometry': 'Polygon','properties':{}}

                with fiona.open(
                        cheminOutput, 'w',
                        crs=layerTriangles.crs,
                        driver=layerTriangles.driver,
                        schema=layerOutput_schema,
                        ) as layerOutput:

                    #do stuff:

                    for f in layerTriangles:
                        try:
                            # object.contains(other) "returns True if no points of other lie in the exterior of the object and at least one point of the interior of other lies in the interior of object.""
                            if not prepPolygonOcean.contains(asShape(f['geometry'])) :
                                layerOutput.write(f)

                        except Exception, e:
                            logging.exception("Error processing feature %s:", f['id'])


texts:
I have a layer of Points with some attributes in GeoServer. Is it possible to create a style that would combine all the points in this layer in a line according to "date" attribute order? I want to receive a list of points through WFS service and single line through WMS service from the same  layer.

EDIT: I use PostgreSQL with PostGIS.


texts: Scale and Numpixel in Unsupervised classification in Google Earth Engine

texts:
I used the sample code available in GEE website for unsupervised classification of Landsat data and I changed it to use Sentinel 2 L2A data.
var S2 = ee.ImageCollection("COPERNICUS/S2_SR");
S2 = S2.filterBounds(area);
S2 = S2.filterDate("2020-01-01", "2020-05-11");

var training = image.sample({
region: area,
scale: 30,
numPixels: 5000
});

The scale in the sample code is 30 due to Landsat resolution.
Since the minimum resolution of Sentinel-2 imagery are 10m (and this is my desired final resolution), can I set the scale to 10 without changing anything else?
Will that resample the 20m and 60m bands?
As for numPixel, should I change the 5000 values?
If yes, based on what?


texts: Change the order of the data frame when creating a layout

texts:
I need to change the order of the Data Frames in the .mxd that I created as a template so that the task of changing the layout is done easily.
My question is this: ArcGIS 10.1 Changing default Data Frame Order
However, the solution presented to change the data frame up or down in the table of contents does not work. The first DataFrame in the Table of Contents list is not the DataFrame labeled "1" when I need to load this .mxd to change the layout.


texts: Move a polygon to a different place on the globe, while maintaining its true geographical size? (QGIS)

texts:
I'm trying to do something similar to the Greenland vs Africa comparison -- superimpose one country over another, showing how their true sizes compare (the example on the right).

Thought this would be a simple thing to do, but now that I am trying to do it, I'm having a hard time figuring it out. Is there a simple way to do this, ideally using Qgis?


texts: Portal for ArcGIS 10.3.1 bad visualization after installation

texts:
It's been a week now since we upgraded our version from 10.3 to 10.3.1 and right after the upgrade we had many visual problems when browsing the portal on IE, such as bad width of the top menu bar when the "My organization" button shows up in 2 lines, the search bar shows up always on the left side beneath the menu bar instead of being at the right side, maps got scrambled like a puzzle in a very weird way and more... see attached screenshots

Today I removed the Portal + Web Adaptor + Data Store + deleted their libraries! which means pretty much a complete clean re-installation from scratch with no previous settings or content.

Installed it again, and the same problems shows up! - no scrambled maps, but all other visual problems I've mentioned (see attach screenshots).

Removed everything again! installed IE version 11 and then tried to reinstall the portal again, and still nothing changed - you can see it's wrong immediately at the first portal window when he asks to create a new user - screenshot file named clean_installation!

Do anyone knows or ever experienced this issue?? I got some support from ESRI and others but still no one managed to reproduce or understand where this issues comes from.

I should also add that it happens ONLY on IE (any version!) and not other browsers - my organization is not going to leave IE anytime soon so it's not a choice.

Pretty sure it's a server side installation issue since the behavior is the same from any machine browsing to the portal regardless the IE version and the ArcGIS Online version is shown great at that same IE that shows all problems.

When I browse to the online version with that same IE (that shows all those problems), everything is shown perfectly fine!


texts: How to fix label texts when exporting .mxd to pdf?

texts:
I have exported an .mxd to pdf but once I open the pdf, most of my text labels are mis-represented (altered in someway). This is the first time I've had this issue.
- What I did when creating the map was change labels to annotations and changed font style and size.
Note: one of my layers' labels show up just fine but the other is in some unrecognizable font, this includes the tables in the map.

Any helpful suggestions?


texts: QGIS 3.10 Page settings won't except changes of page size A3

texts: What can I do to change the page layout to A3 under QGIS FreeBSD 12 . The settings for layout_page_width/ layout_page_height are not enabled for editing, and page settings to A3 for from the printer dialog are not adopted.


texts: Geoserver MapFish plugin: absolutely positioning scale bar

texts:
I have a map printed full page on A4 paper. I would like to put a scalebar over the map without printing in on the next page. Is it possible? My config.yaml currently looks like this:

#-------------------------------------------------------------------------
mainPage:
  pageSize: A4
  marginBottom: 0
  marginTop: 0
  rotation: true
  items:
    - !map
      spacingAfter: 0
      width: 595
      height: 842
    - !scalebar
      type: bar
      maxSize: 100
      barBgColor: white
      fontSize: 8
      align: right
    - !text
      font: Helvetica
      fontSize: 9
      align: right
      text: '1:${scale}'


texts:
I want to read large image. The image size is 92117 x 30313 pixels. So far I know cv2.imread can not read large size.

How can I read using GDAL API?


texts:
I'm trying to implement a clustering solution for a Google Maps JavaScript application where I create nxn bounding boxes at a current position.
I've tried to draw what I'm trying to implement

(I couldn't draw accurate boxes in Gimp!).
The boxes are to be redrawn upon each movement of the map (so they won't be fixed to a single position or height). In the image example there would be a 4x3 series of bounding boxes. What I plan on doing is iterate over each bounding boxes and perform an ElasticSearch query on that bounding box and place a marker within that box of how many results there are for that section. Which should be faster than returning thousands of points in a GeoJSON response and trying to cluster the markers.
What I can't figure out, or find examples by others, is how to calculate the positions of each bounding box/rectangle.
Also, I'm not sure if a defined 4x3 would always be the best solution, viewing at a higher level may require fewer boxes than that at a lower (zoomed in) level.
How can I starting from the top left of the viewable map draw n bounding box/rectangle across and and below?


texts: Error when using vector field parameter in field calculator with graphical modeler in QGIS 3

texts:
When trying to divide a vector field parameter with an output calculated during the model process I get a No root node, parsing failed! error at the point in which the field calculator in the model tries to run.

My aim is for the vector field parameter @testfield to be divided by another field created in a step previous @Join_attributes_by_location__test2__OUTPUT  which itself is based of another vector field parameter.

The expression I have tried is @testfield / @Join_attributes_by_location__test2__OUTPUT


texts: How accurate is ESRI world imagery basemap in ArcGIS?

texts: I have an aerial photo which doesn't match up with  ESRI world imagery basemap in ArcGIS 10.2. I didn't add the AP or georeference it. It was already in the project when I started. I'd really like to know how accurate that ESRI basemap world imagery is? I know Google imagery has issues, it shifts in Google Earth or QGISfor example. Does the ESRI world imagery basemap suffer the same sort of unreliability problem. I cannot find any information on this, but I need  to know whether to trust the AP.


texts: How do I add use a method to add a FeatureLayer to a Map?

texts:
I'm using Angular 6 with the ESRI API for JavaScript 4.9. I have a working application but now it's time to refactor and make this project more polished. I have a series of FeatureLayers added to the Map and I want to extract the layer add operations to their own method. How do I create a layer, or layers, in a method?

The code below shows my main method, initializeMap(), called from the Angular OnInit() lifecycle event. InitializeMap() adds the FeatureLayers using map.add() - this is what I want extracted. The problem is, when I create the method, all of the ESRI modules loaded in initializeMap() fall out of scope. What's the solution?

ngOnInit() {
    this.initializeMap();
}

async initializeMap(){

   const [Map, MapView, SpatialReference, Extent, FeatureLayer, Legend, Query, Point] = await loadModules([
    'esri/Map',
    'esri/views/MapView',
    'esri/geometry/SpatialReference',
    'esri/geometry/Extent',
    'esri/layers/FeatureLayer',
    'esri/widgets/Legend',
    'esri/tasks/support/Query',
    'esri/geometry/Point'
  ]);

const map = new Map();

const mapView = new MapView({
  container: this.mapViewEl.nativeElement,
  map: map,
  extent:  new Extent({ // stuff omitted })
});

map.add(new FeatureLayer({
  id: "id01",
  url: "https://xxx/MapServer/0",
  opacity: 0.50
}));


texts: I am being tasked with converting a AGS geoprocessing toolkit currently written in AO 10 C# SDK to AO 10 Java SDK.  Are there any resources out there which show an end to end example of creating an AGS 10 Java deployable toolkit?


texts:
In the query widget in the Web AppBuilder, I am trying to get one of the result fields to display as a hyperlink, but I am having trouble.

In the “Results Setting” tab in the query widget, I’ve set the URL field’s Special Type as “Link”. I click OK and save the Web App.

When the query is run, the results display the field, but the hyperlink in the results window is not active. Nor is the hyperlink active in the pop up when one of these results is clicked on the map.

However, the link is active if the result layer’s attribute table is open.

If I go back to edit mode in the query widget, the Special Type for the field is back to “None”. The “Link” type does not hold.

Is there a way to get the Special Type to remain “Link”? I don’t believe it is a problem with the URL itself, as the hyperlink is activated and working in the attribute table.

The app is using a Map Service that was uploaded onto AGOL from a local server.


texts: QGIS - Imported shapefile CRS is listed as OSGB but being projected as WGS 84

texts:
I have imported a shapefile containing land use data for the UK. The layer says that its' coordinate system is EPSG:2770 OSGB 1936, however, when I display the image over a basemap it becomes obvious that the shapefile CRS is using WGS 84.

The first image is when the basemap CRS is set to EPSG:3857 and shapefile CRS is OSGB 1936. The second image when the basemap CRS is set to OSGB 1936 and shapefile CRS is OSGB 1936.

Here is the metadata for the shapefile:

  General

  Storage type of this layer ESRI Shapefile

  Description of this provider OGR data provider (compiled against GDAL/OGR library version 2.4.0, running against GDAL/OGR library version 2.4.0)

  Source for this layer C:/Users/OneDrive/Ecology/CRS/1_q3/LCM.shp

  Geometry type of the features in this layer Polygon (WKB type: "Polygon")

  The number of features in this layer 6737558

  Capabilities of this layer Add Features, Delete Features, Change, Attribute Values, Add Attributes, Delete Attributes, Rename, Attributes, Create Spatial Index, Create Attribute Indexes, Fast, Access to Features at ID, Change Geometries

  Extents In layer spatial reference system units xMin,yMin
  54236.5,5333.81 : xMax,yMax 655649.84,1220310.00

  Layer Spatial Reference System +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs

Is there anyway I can fix this? I have tried a variety of transformations in both QGIS 2 and 3.

EDIT: Problem fixed by using the 'Reproject Layer' tool to reproject the shapefile to WGS 84


texts:
I want to publish a layer automatically in geoserver. Each layer is a database table in postgis db. I can see the table in geoserver store(already contains some layer tables of that particular db) as soon as I create it in postgis but publishing it should be done manually. Can I find any php script for just publishing the layer....

Does "Adding a postgis table" section in http://docs.geoserver.org/2.0.x/en/user/extensions/rest/rest-config-examples-curl.html also publishes the layer????


texts: Calculate difference of subsequent images in a collection

texts:
how do I call a Specific Image inside a Collection, to loop over it?

this is for calculating the difference of images for each set of two subsequent images in a collection

dImage= Image(t=i+1)-Image(t=1)

First problem Solved,
I now got the List with the Gradient. But how do I pick an image from that List?

Map.addLayer(ic_grad.get(1), {},'ic')

returns an error:"Cannot add an object of type  to the map."

normaly adding a calculated Image to the Map is possible.


texts: Generate ID for the grid of points from top-left corner down

texts:
I have a grid of points extracted from a raster. I need to give them a new ID value to be able to join values from it to another grid in rotated system of coordinates.The automatically generated ID goes from top-left to the right and I need it to be from top-left down.
Something like this:

Current:

1   2   3   4

5   6   7   8

9 10 11 12

What is needed:

1  5  9

2  6  10

3  7  11

4  8  12

I have 122140 features so I'd rather not do it manually. I use QGIS 2.8.2 and ArcGIS 10.1. No programming skills for the time being.


texts: How to combine polygons in a vector with GRASS?

texts:
I need to combine polygons of similar geological classes which are stored in a vector file called geology.  I was looking for somethiing like "union selected features" or similar. In the GRASS Book 3ed I found that v.overlay could be useful, however I did not manage to merge/union my classes.

To illustrate it, here an example: I have a polygon with class (column MAIN_LITHO) 'biotite granite' but also 'biotite granite (foliated) and others. These should be all combined into one single multipolygon 'biotite granite'. Later, I want to turn that vector into a raster map but that should be easy.

here is also an image of that example

thank you in advance!


texts: How to publish multiple languages in geoserver, data from osm

texts:
I need to generate maps with labels in multiple languages. Currently I have already imported the osm data into postgis and pusblish it with geoserver, but apparently after querying the feature (using the geoserver preview layer feature), I only see one column with name 'name'.

How can I import and then publish labels in multiple languages in the same layer. The result should be that for a given feature the label in the concatenation of the OSM tags values 'name' and 'name:en' (if the later exists, some features are missing this).

Update: For further reference.
After searching more I found that the way you filter what gets imported into the db is using the 'style' file (defaults to default.style). In that file one need to add the second of the following lines to also import the name of a feature in English:

node,way    name    text    linear
node,way    name:en    text    linear

This tells osm2pgsql to create another column named 'name:en' of type text and store in it the values of the tags with key 'name:en'.


texts: How can I host a map service that uses an online basemap as well as my own dynamic layers?

texts:
I have a flex web application with an ArcGIS Server backend that I want to start using an online basemap for.  The application includes a printing capability that prints a layout from an arcGIS map service.  If I use an online basemap, as well as our own local dynamic layers in the application, then how can I create a print layout that includes all of those layers?

I attempted something similar to this a couple years ago, but it didn't work and these knowledge base links indicate that it's a bad idea:

http://resources.arcgis.com/content/kbase?fa=articleShow&d=35903

http://resources.arcgis.com/content/kbase?fa=articleShow&d=34552

Is there no way to print a layout that includes the multiple services used by the application?

The reason the mashup needs to happen on the server is that the printed map is in a layout which includes legend, north arrow, scale bar, etc.  simply grabbing several map images and overlaying them would be fine if not for the need for marginalia.

I'll try to be more specific:

Our users see a base map as well as several client-specific data layers overlayed.  They have the ability to turn their data layers on and off.  At any point, they can request a layout to be saved as an image, or sent directly to a printer.  The layout should contain all of the layers they see in the map (basemap and data layers) as well as some marginalia.  The user does not have control over the marginalia, however the application administrator needs to be able to modify the layouts/marginalia by editing the mxd in arcmap.

So, what I need to do is either be able to cascade services in order to host the print layout service in arcgis server, or I need a way to propagate marginalia from an mxd to the flex client for printing.  I haven't looked into the second option, but I'm guessing it's a no-go.


texts: Erdas Imagine Error: Performance warning: Covariance calculation requires stack processing but input layer stack isn't suitable. How to solve it?

texts:
I am collecting signatures right now and when I am adding them to the Signature Editor Erdas says:

  Performance warning: Covariance calculation requires stack  processing
  but input layer stack isn't suitable

How do I solve it, since I am using a stacked and georeferenced source layer already?


texts: Using NDVI along with regular RGB and NIR bands for image classification

texts:
Is it plausible to use NDVI along with other regular bands for image classification related data processing?

Recently, I came across a comment that RED and NIR band might interfere with NDVI or vice versa during the processing and overfit the model.

I am working on a project where I want to classify healthy and stressed crop patches using satellite imagery, and I am using all four bands (RGB and NIR) along with NDVI to train the model and classify the satellite images.

For the classification, I am using Random Forest algorithm.


texts: How to generate a column with a count of number of points in a polygon AND have 0 for the rows where there are no points in the polygon?

texts:
I have two data sets with a large number of points that I’m organizing into a hexbin grid.
I'm associating these points with the hexbin polygons by using PostGIS to determine if a point falls within a hexbin polygon. The problem with my initial query is that if st_contains or st_intersects returned false, then I didn’t get the polygon geometry at all. It was simply a hexagon shaped hole in my map. What I wanted to return, instead, was the geometry and then a count of 0. So, when there is an intersection, return the polygon + the count (this is a common operation and many previous questions cover how to do this). But I also want to return the rows where st_disjoints is true and have the count (of points in the polygon) be 0. I can do this with these CTEs and a union:
with disjoint_table as (
    select
        a.the_geom_webmercator,
        a.cartodb_id,
        0 as count
    from
        hexbin_polygons_table a
        LEFT join points_table b on st_intersects(a.the_geom_webmercator, b.the_geom_webmercator)
    where
        b.the_geom_webmercator IS NULL
),
intersect_table as (
    select
        a.the_geom_webmercator,
        a.cartodb_id,
        count(b.the_geom_webmercator)
    from
        hexbin_polygons_table a
        join points_table b on st_contains(a.the_geom_webmercator, b.the_geom_webmercator)
    group by
        a.the_geom_webmercator,
        a.cartodb_id
)
select
    *
from
    disjoint_table
union
select
    *
from
    intersect_table

The disjoint_table part (left join where is NULL...etc.) comes from Paul Ramsey's answer here
This CTE + union works but is very slow. Is there a simpler or better way to get this sort of thing?


texts:
I currently have a problem on QGIS with my Wacom tablet and polygonal tools.

When I create a shape with the polygonal tool, if I use my Wacom tablet, the cursor moves well, but the path (red dotted) that represents the next potential point does not follow the cursor. While it works perfectly with the mouse.

I made a short video to illustrate the problem: https://vimeo.com/333824677

Is it a bug or a configuration problem?
Is it possible to solve this problem? I would be much faster with my pen tablet.

QGIS 3.6
Mac Pro 2013 + OS X 10.13.6
Wacom Intuos Pro (PTH-860) + 6.3.33-5
Logitech G502.


texts: QGIS re-entering my database credentials

texts: Whenever I have a disconnection from the internet I can't upload any of my edits to the database. I then have to restart my QGIS to get connected again and enter my credentials. Is there a way to do so without having to restart my QGIS and lose all of my unsaved edits?


texts: Making Shaded Area Polygon from HILLSHADE raster in ArcGIS Desktop?

texts:
How am I suppose to extract the values ( Value<=100 ) from this HILLSHADE raster, and then make the extracted values as a VECTOR POLYGON (shapefile)
---I'm using ArcGIS 9.3 (ArcInfo with all extensions)---
Can you please give me the work flow.

.


texts: Export canvas with jspdf returns black map PDF

texts:
I built a basic webmap interface with some vector layers and basemaps (eg. openstreetmap) in OpenLayers. When I try to export the canvas with jspdf, the corresponding pdf-file shows a completely black map. How can I export the actual canvas? I don't have a lot of experience in JS yet and have been searching for quite some time, but can't find the mistake in this code.
var dims = {
    a0: [1189, 841],
    a1: [841, 594],
    a2: [594, 420],
    a3: [420, 297],
    a4: [297, 210],
    a5: [210, 148],
};

var exportButton = document.getElementById('export-pdf');

exportButton.addEventListener('click', function () {
    exportButton.disabled = true;
    document.body.style.cursor = 'progress';

    var format = 'a4'
    var resolution = '300'
    var dim = dims[format];
    var width = Math.round((dim[0] * resolution) / 25.4);
    var height = Math.round((dim[1] * resolution) / 25.4);
    var size = map.getSize();
    var viewResolution = map.getView().getResolution();

    map.once('rendercomplete', function () {
      var mapCanvas = document.createElement('canvas');
      mapCanvas.width = width;
      mapCanvas.height = height;
      var mapContext = mapCanvas.getContext('2d');
      Array.prototype.forEach.call(
        document.querySelectorAll('.ol-layer canvas'),
        function (canvas) {
          if (canvas.width > 0) {
            var opacity = canvas.parentNode.style.opacity;
            mapContext.globalAlpha = opacity === '' ? 1 : Number(opacity);
            var transform = canvas.style.transform;
            // Get the transform parameters from the style's transform matrix
            var matrix = transform
              .match(/^matrix\(([^\(]*)\)$/)[1]
              .split(',')
              .map(Number);
            // Apply the transform to the export map context
            CanvasRenderingContext2D.prototype.setTransform.apply(
              mapContext,
              matrix
            );
            mapContext.drawImage(canvas, 0, 0);
          }
        }
      );
      var pdf = new jsPDF('landscape', undefined, format);
      pdf.addImage(
        mapCanvas.toDataURL('image/jpeg'),
        'JPEG',
        0,
        0,
        dim[0],
        dim[1]
      );
      pdf.save('map.pdf');
      // Reset original map size
      map.setSize(size);
      map.getView().setResolution(viewResolution);
      exportButton.disabled = false;
      document.body.style.cursor = 'auto';
    });

    // Set print size
    var printSize = [width, height];
    map.setSize(printSize);
    var scaling = Math.min(width / size[0], height / size[1]);
    map.getView().setResolution(viewResolution / scaling);
  },
  false
);


texts:
I am new to GIS and I want to merge xyz tiles to one raster tiff.

Here is the source to the xyz files:
dgm1_05314000_Bonn_EPSG4647_XYZ.zip

I have downloaded the tiles as .xyz files, then sorted the coordinates with this bash command (since they are for some reason not in the standard format):

for file in *.xyz;
    # sort coordinates
    do sort -k2 -n -k1 "$file" -o "$file";
done

gdalinfo for one of the tiles gives me:

Driver: XYZ/ASCII Gridded XYZ
Files: dgm1_32372_5622_2_nw.xyz
Size is 2000, 2000
Coordinate System is `'
Origin = (32371999.500000000000000,5621999.500000000000000)
Pixel Size = (1.000000000000000,1.000000000000000)
Corner Coordinates:
Upper Left  (32371999.500, 5621999.500)
Lower Left  (32371999.500, 5623999.500)
Upper Right (32373999.500, 5621999.500)
Lower Right (32373999.500, 5623999.500)
Center      (32372999.500, 5622999.500)
Band 1 Block=2000x1 Type=Float32, ColorInterp=Undefined
  Min=87.800 Max=160.880

Then I want to run to get a .vrt file:

gdalbuildvrt mosaic.vrt *.xyz

But I am getting the following error:

Warning 6: gdalbuildvrt does not support positive NS resolution. Skipping (filename).xyz

How can I now merge these tiles to one raster tiff?

Any alternatives are also welcome.


texts: Cloudfree images in small area from Sentinel-2

texts:
I have a similar question to this one here: Filter Landsat images base on cloud cover over a region of interest

Different from the linked question I would like to find a more general solution that is not just working for landsat.

I have some small areas (up to 1 km²) where I would like to get all the images that are completely cloud free.

Using the .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 5)) on the cropped image checks the entire scene for clouds and not just the small area. Is there something comparable to ee.Algorithms.Landsat.simpleCloudScore(image).select('cloud'); that would work for Sentinel 2?

Here is what I tried:

var rectangle = ee.Geometry.Rectangle([16.9, 78.31, 17.1, 78.33]);

var collection = ee.ImageCollection('COPERNICUS/S2')
    .filterDate('2018-05-01', '2018-10-30')
    .filterBounds(rectangle);

var clip_collection = collection.map(function(image) { return image.clip(rectangle); });

var coll_s2_filtered = clip_collection.filterBounds(rectangle)
                      .filter(ee.Filter.lte('CLOUDY_PIXEL_PERCENTAGE', 5))
                      .sort('system:time_start',false);

And I tried using the ee.Algorithms.Landsat.simpleCloudScore(image) but then I get

  "Error in map(ID=20180501T122701_20180501T122655_T33XWG):
  Landsat.simpleCloudScore: Image is not a Landsat scene or is missing
  SENSOR_ID metadata."


texts: Create individual feature classes for every record in a single feature class

texts: I have arc desktop 10.3.  I have a feature class (nycd) with 59 records in it.  I'm trying to create a simple map with an inset that shows where each community district is located in that borough. I'd like to create an individual feature class for every record (with every field included) and put them in a file geodatabase (Comm_Snap) and am looking for different ways to do this. I'm not very familiar with arcpy but want to start utilizing it. I was initially thinking a simple script with a Search Cursor and a data management tool would work. Any suggestions?


texts: Obtaining friendly names for ArcMap layer data types

texts:
Using ArcObjects, is there a way to programmatically obtain the "friendly name" for a layer's data type as seen in the ArcMap Source tab for layers in a map document?

e.g.:

File System Raster
Shapefile Feature Class
Tiled Internet Layer

Or is this ArcMap-specific code and not exposed to ArcObjects?


texts: Some items have coordinates switched when loading PostGIS layers in QGIS

texts:
I am having problem with strange coordinates switching when loading PostGIS layers in QGIS. First, I thought, that problem may be cause by the use of GROUP_BY feature in layer query, but later the problem started to appear in other queries not using this feature and finally it happens also with single table actually containing the geometry multilinestring data (with srid 4326). The problem sometimes strangely disappear when local copy of the sama data (shapefile) is already loaded.

When the problem appears, coordinates of some items are switched, like this:

Correct: LINESTRING(16.87593599289347779 49.7559793078007857, ...
Switched:LINESTRING(49.7559793078007857 16.87593599289347779, ...

The data themselves are fine, because if I export table to shapefile, all coordinates are correct. I tried to look at PostgreSQL log (all statements are logged) but no errors were found.

I am using:

PostgreSQL 9.1
PostGIS 2.1 (full version "POSTGIS="2.1.0 r11822" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.7.1, 23 September 2009" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.8.0" TOPOLOGY RASTER")
QGIS 2.4

EDIT:
Some further observations:

problem appears when I add multiple PostgreSQL layers to QGIS. Some
of the objects become "switched" instantly. The other layer usually
brake after I remove the first one from the view (same "switching
behavior").
problem also appears when I try to create virtual layer
in QGIS DB manager plugin (in most simple cases such as table with
spatial column loaded twice - once through PostGIS layers dialog,
once through DB manager
There also seems to be another related issue, which is likely different, because when the features can't be seen, they can still be selected. In this case, "switching" happens on reload (or zoom). On another one, lines appear correctly, only to disappear again on another reload.

Also, the problem appeared on PostGIS 2.0 ("POSTGIS="2.0.1 r9979" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8" TOPOLOGY RASTER")

To help understand my issue better, I created screencast at http://youtu.be/rqS6kaFfUaQ


texts: Self intersections for polygons, how to solve?

texts:
I have a question about repairing a self intersecting polygon shapefile. I have a shapefile containing Polygons (ZM) which have self intersecting features. If I use the "repair geometry" tool, it finds several self intersections and fixes them. Hurray!

But when I make an export of this file (or a selection of it), this export contains self intersections again. This happens on all the tries I've done to handle the problem, which include:

Use the tool "repair geometry", failed;
Dissolve the polygons based on all of their attributes, failed;
Dispose of the ZM properties, and then do all of above, failed;

Even when I import this shapefile into an Geodatabase using ArcCatalog, it imports correctly, but when I make an export from the database, the self intersections are there again.

So any advice on how to fix this problem would be very much appreciated. If anyone could explain why this type of behaviour exists, it would be wonderful.

I'm using ArcGIS 9.3.1 build 4000 (SP2).


texts: Labelling from non-spatial database table in QGIS

texts:
I have a PostGIS layer in my QGIS project whose id is related to a NON-SPATIAL table in the same database. I cannot join these tables into a new table or view, I have to leave the database exactly intact is it is.

Is it possible to create a labelling expression that will perform a tabular join on the fly inside the database to return the value?

Essentially I need return a label expression with something that would do this:

SELECT
  non_spatial_table.label
FROM
  spatial_table, non_spatial_table
WHERE
  spatial_table.key = non_spatial_table.key

Where spatial_table is the table driving the QGIS layer.


texts: writeAsVectorFormat creates .GPKG instead of .SHP

texts:
I am trying to create a shapefile from the existing layer. Sadly I get a .GPKG file instead of .SHP file. How to correct this?

QGIS - 3.0.1

Here is the code:

from qgis.core import *
import qgis.utils

_layer = QgsVectorLayer("C:/Arundhati/RadioSignal/MasterLine.shp", "MASTERLINE", "ogr")

if not _layer.isValid():
  print("Layer failed to load!")

else:
    print("Layer was loaded successfully!")

_writer = QgsVectorFileWriter.writeAsVectorFormat(_layer,"C:/Arundhati/RadioSignal/MasterLine12.shp",'utf-8')


texts:
I'm using ArcMap 10.1 with Info License. Here is my issue. I have a section of track line with incorrect Z values applied. There are over 15,000 vertexes that I need to update all at once. I know I can do it manually but that would take forever. Basically I just need to add 2 ft. to the existing Z values.

How can I go about doing this?


texts: Selecting pixels in raster using polygon selection tool?

texts:
I want to reclassify landcover image manually with respect to online imagery. I am looking for a software/plugin/script to manually select raster pixels using polygon selection tool and could be able to enter new value.

I have Arcgis with spatial analyst license.


texts: Change QGIS 3 shortcut keys for layout view / print composer

texts:
I wanted to change the keyboard shortcuts in the QGIS 3 layout view / print composer, but I cannot find any buttons from this section, for example: "New layout - Ctrl + N".
How to change it?


texts: Writing Asian Language in WMS QGIS Server

texts:
I have a WMS QGIS Server works perfectly, but it cannot present Asian Fonts (Hebrew). It writes a stranger characters (see picture below).

What can I do to solve this?


texts: Ways to determine winding topographic characteristics of a river

texts:
Are there any methods and/or technical guides on how to classify the degree of winding of river bodies?

I have the following polygon layer of roughly 100,000 water bodies and would like to write an automated process. I want to divide them into sections based on how flat or curvy they are as shown in the image below.

For now, I'm focusing on x and y dimensions. Eventually, I will look into elevation differentials.


texts: Are calculated fields available in any database that Qgis can use

texts:
I'm trying to find a data storage method that can handle up-datable calculated fields (such as population density=population/area). I want to be able to alter the population as the data changes (like next year's survey) and have the density update on my database too. Qgis virtual fields are only stored with the project, not available to any other software and Sqlite and Postgre database systems do not store calculated fields (see https://stackoverflow.com/questions/8250389/computed-calculated-columns-in-postgresql , and https://stackoverflow.com/questions/1124695/can-i-create-computed-columns-in-sqlite ).

Keeping track of something like population density as it changes must be such a basic task of any GIS database that I can't believe I'm finding it so hard to do, what is it I'm missing?


texts: Calling processing algorithm in different file than main file for standalone application

texts:
I need to run a processing algorithm that is coded/called in different file than main file. I've read some posts (1, 2, 3, 4, 5) but they give a solution that runs algorithm in main file. When I use those examples, algorithms work.

But I have three files for standalone QGIS application. The application has a window which includes a layer tree, a map canvas and a button (the following image). The button calls a method, defined in another file, which includes calling a processing algorithm. When I click the button, I get an error: For example: Error: Algorithm native:buffer not found.

I couldn't figure out how/where to add the next lines of code which is presented as a solution.

from qgis.analysis import QgsNativeAlgorithms
import processing
from processing.core.Processing import Processing

Processing.initialize()
QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())

Minimal files' structure:

Example Files:

main.py

import os
import sys
from qgis.core import *
from qgis.PyQt.QtWidgets import QApplication
from qgis.analysis import QgsNativeAlgorithms
import processing
from processing.core.Processing import Processing

from viewer import Viewer

QgsApplication.setPrefixPath(os.environ['QGIS_PREFIX_PATH'], True)
qgs = QgsApplication([], True)
qgs.initQgis()

Processing.initialize()
QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())

# The algorithm works here, but doesn't work in funcs_.py
# params = {...}
# buf = processing.run("native:buffer", params)

app = QApplication(sys.argv)
main_window = Viewer()
main_window.show()
sys.exit(app.exec_())
qgs.exitQgis()

viewer.py

from qgis.core import *
from qgis.gui import *
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
from qgis.PyQt.QtWidgets import *

import funcs_

class Viewer(QMainWindow):

    def __init__(self):
        QMainWindow.__init__(self, None)
        self.initGUI()

    def initGUI(self):
        self.canvas = QgsMapCanvas()
        self.layer = QgsVectorLayer("shapefile_path", 'Layer1', 'ogr')
        QgsProject.instance().addMapLayers([self.layer])

        self.layout = QHBoxLayout()
        self.root = QgsProject.instance().layerTreeRoot()
        self.bridge = QgsLayerTreeMapCanvasBridge(self.root, self.canvas)
        self.model = QgsLayerTreeModel(self.root)

        self.model.setFlag(QgsLayerTreeModel.AllowNodeChangeVisibility)
        self.model.setFlag(QgsLayerTreeModel.ShowLegend)
        self.layer_treeview = QgsLayerTreeView()
        self.layer_treeview.setModel(self.model)

        self.layer_tree_dock = QDockWidget("Layers")
        self.layer_tree_dock.setObjectName("layers")
        self.layer_tree_dock.setWidget(self.layer_treeview)

        self.button = QPushButton("Create Buffer")
        self.button.clicked.connect(self._create_buffer)

        self.splitter = QSplitter()
        self.splitter.addWidget(self.layer_tree_dock)
        self.splitter.addWidget(self.canvas)
        self.splitter.addWidget(self.button)

        self.layout.addWidget(self.splitter)
        self.contents = QWidget()
        self.contents.setLayout(self.layout)
        self.setCentralWidget(self.contents)

    def _create_buffer(self):
        lyr = funcs_.create_buffer(self.layer)
        QgsProject.instance().addMapLayers([lyr])

func_.py

import processing

def create_buffer(lyr):
    params = {'INPUT':lyr, 'DISTANCE':15, 'OUTPUT':'memory:'}
    buf = processing.run("native:buffer", params)

    return buf["OUTPUT"]


texts: How to extract coordinates from a coastline layer?

texts:
I have downloaded QGIS and the Natural Earth base maps. I'd like to somehow get a list of coordinates of a selected coastline.

I've got the 10m_coastline layer selected to what I want but can't see a tool or other table to join this to for coords?


texts: Creating multiple columns for last user edit ArcGIS Portal

texts:
I enabled editing and tracking on the ArcGIS Enterprise Portal. But for this project my manager is asking to store the editing data (username and time stamp) of multiple users (not just the last user).

Can this be done, either on a hosted layer on the portal or a feature layer in a registered database?

She also suggested that instead of making an additional column each time a user edits, we could make a duplicate record.


texts: Geocortex Essentials Workflow - display map tip at the end of a workflow

texts:
I am trying to modify an existing workflow to display a Map Tip. It is a simple zoom and highlight parcel workflow. Currently the result comes up in the Results Panel but I would like it as a Map Tip.

I followed some advice from GE support (invoke Mapi Tip command in External Command Activity) but need some more instructions:

https://support.geocortex.com/essentialsGSCForum?sub-nav=forum&main-nav=essentials&#!/feedtype=SINGLE_QUESTION_DETAIL&criteria=ALLQUESTIONS&id=90660000000Gu31AAC

Here's my workflow:


texts: Split GeoJson Layers into multiple layers in Javascript

texts:
In the Site I am building a user can login and view a map that shows the Region under him (a GeoJSON layer). The user need to split this region into a number of subregions and assign it to some other users(sub users under him)to take care of the operations in that subregion and can view the map of that subregion when he logins. I want to add a page with map of the region under him to edit and split the region (the GeoJSON layer) into subregions and save those region layer data (as geojson data preferably) in DB to reassign. I tried Openlayers 3 and Google Maps javascript APIs and briefly went through leafletjs. But all of them does not seem to offer an option to divide a GeoJSON Layer into multiple layers (only draw and and reshape).

How can I achieve this?


texts: "Bad Allocation" Error importing Large OSM into QGIS and QuickOSM

texts:
I am trying to build a map of the state of Florida for a flight simulator in Unity. I am new to the GIS world.

I have downloaded QGIS, ArcGIS, City Engine, and Unity to do this.

I downloaded my files from the OpenStreetMap website susadary links. The German one.

I have converted the osm.pbf to a OSM file
now when I try to upload this file into QuickOSM, it runs out my memory and says bad allocation and nothing shows up.


texts: QGIS Plugin for creating Quality information

texts: I am planning to create a plugin to create quality information. The plugin should do following actions: 1)  To add Dataset for which the quality information is to be added. 2)  View the quality info if available. 3) Create a new one or edit existing. 4)   Save it to the Database along with the dataset. I need to know whether all the tasks mentioned above is possible to create or not. If possible send me the links where I can get ideas.


texts:
I'm working on GRIB file, In input, I have the file with data from 0 to 360°.

As gdalwarp does not write GRIB file (only gdal_translate), I use gdal warp to projct data from [0,360] & [-90;90] to [-180,180] & [-90;90] and I write a geotiff file.
Then I use gdal_translate to write a grib file from Geotiff.
When I do a gdalinfo on my output from gdal I have a bounding box =[-180,180] & [-90;90] but when I display the output grib file the bounding box is box =[180,540] & [-90;90].

Here are the commands I used:

gdalwarp -t_srs EPSG:4326 -wo SOURCE_EXTRA=100  --config CENTER_LONG 0 -overwrite  -of GTiff input.GR2 output_temp.tiff
gdal_translate -of GRIB --config CENTER_LONG 0 -co "DATA_ENCODING=JPEG2000" output_temp.tiff  output.GR2