texts: ArcGIS 10: AddIn Extension loading toolbox issue

texts:
I have an extension class in an ArcMap addin project of which loads a custom toolbox into ArcToolbox when the user opens ArcMap or opens a previously created map.  My toolbox gets added to ArcToolbox fine except when the user creates a new map from File > New.  My toolbox just disappears (no messages). I'm running AG10 SP2 but it doesn't work in AG10 base either.

Anyone else experience this?  Solutions?

protected override void OnStartUp()
{
   AddToolboxes();
   #region Wire events
   ArcMap.Events.NewDocument += delegate() { ArcMap_NewDocument(); };
   #endregion
}
void ArcMap_NewDocument()
{
   AddToolboxes();
}
void AddToolboxes()
    {

        // Load toolbox into ArcToolbox
        IArcToolboxExtension arcTbxExt;
        try
        {
            arcTbxExt = (IArcToolboxExtension)ArcMap.Application.FindExtensionByName("ESRI ArcToolbox");
            if (arcTbxExt == null) { throw new Exception("ArcToolbox extension could not be found."); }
        }
        catch (Exception ex)
        {
            System.Windows.Forms.MessageBox.Show("Error finding ArcToolbox extension." + Environment.NewLine + " - " + ex.Message);
            return;
        }

        try
        {
            IGPToolbox2 toolbox = Maersk.Functions.Toolbox.OpenToolbox("C:\\Toolboxes\\MyToolbox.tbx");
            arcTbxExt.ArcToolbox.AddToolbox((IGPToolbox)toolbox);
            arcTbxExt.ArcToolbox.Refresh();

        }
        catch (Exception ex)
        {
            System.Windows.Forms.MessageBox.Show("Error launching  toolbox." + Environment.NewLine + " - " + ex.Message);
            return;
        }

    }


texts: Using zonal_stats with python in QGIS to calculate statistics for each image

texts:
I work with Python in QGIS,
I want to calculate statistics for each image that I have with a specify shapefile and save result after,
I tried to do like this:

from rasterstats import zonal_stats
layers = QgsMapLayerRegistry.instance().mapLayers().values()
for layer in layers:
    stats = zonal_stats("/home/myshape.shp",layer)

but it gives me error TypeError: invalid path.

I tried to solve this problem but didn't find how.


texts: qgis-midvatten-plugin - preparing 3D-data for Qgis2threejs plugin

texts:
I'm trying to do a simple task in a 64 bits windows OS - preparing 3D-data for Qgis2threejs plugin, but i have the following error message (https://github.com/jkall/qgis-midvatten-plugin/wiki/7.-Utilities):

2019-03-10T22:31:25     WARNING    Traceback (most recent call last):
              File "C:/Users/Particular/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis-midvatten-plugin-master\midvatten.py", line 177, in
              self.actionPrepareFor2Qgis2ThreeJS.triggered.connect(lambda x: self.prepare_layers_for_qgis2threejs())
              File "C:\Users\Particular\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis-midvatten-plugin-master\tools\midvatten_utils.py", line 1440, in new_func
              result = func(*args, **kwargs)
              File "C:/Users/Particular/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis-midvatten-plugin-master\midvatten.py", line 874, in prepare_layers_for_qgis2threejs
              PrepareForQgis2Threejs(qgis.utils.iface, self.ms.settingsdict)
              File "C:\Users\Particular\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis-midvatten-plugin-master\tools\prepareforqgis2threejs.py", line 48, in __init__
              newkey = 'strat_' + utils.return_lower_ascii_string(key)
              File "C:\Users\Particular\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis-midvatten-plugin-master\tools\midvatten_utils.py", line 439, in return_lower_ascii_string
              filtered_string = filtered_string.lower()
             AttributeError: 'list' object has no attribute 'lower'


texts: QGIS Can't run any GRASS tools from processing toolbox

texts:
MAC OSX 10.11.13
New machine clean install of QGIS from Kyngchaos
Installed Current version 2.14.2-Essen

When I try to run a GRASS command e.g. v.clean

I get the following error:
This algorithm cannot be run :-(
It seems that GRASS GIS 7 is not correctly installed and configured in your system. Please install it before running GRASS GIS 7 algorithms.

I have searched to see if there is a particular issue with this. I did not find a clear solution as it appears this occurs quite often. It does appear that the folders for the GRASS install do not exist on my machine and that likely the install failed to load GRASS.

Is it better to do a reinstall and hope for a better outcome or try to reinstall GRASS alone?


texts:
Every time I import a KML into QGIS the line lengths are wrong. A line that was 191 ft on Google Earth is now 260 feet in QGIS.

How can I solve this problem?


texts: Optimizing/Speeding up GeoServer/GeoWebCache to cache layer groups containing thousands of GeoTIFFs

texts:
I am using the latest GeoServer (2.15.1) and GeoWebCache (1.15.1) in integrated mode on a Windows 2012 server.  My raster data consists of GeoTIFFs (each TIFF is 47MB in size and covers 200m x 200m floor area) that have been uploaded to GeoServer and grouped together into layer groups (all done via the REST API).  Each layer group represents an area in England, UK (therefore I use projection EPSG:27700).  A layer group may contain 100 or so GeoTIFFs or potentially thousands.  I am caching at scales 1:5000, 1:2500, 1:1000 and 1:500.

GeoWebCache works fine when the layer group contains 100 or o GeoTIFFs.  I am able to produce 35,000 or so cached PNG files (total for all 4 scales) in around 20 minutes using all 16 tasks.  I load these in m OpenLayers map via WMTS calls and all works fine.

However, when I attempt to cache a layer group that consists of 2226 GeoTIFFs, GeoWebCache was timimg out (a total of 9.4 million PNG tiles).  Therefore I have tweaked the settings for both GeoServer and GeoWebCache as follows (so it no longer times out).  After 3 hours of caching using 16 tasks, each task has only completed 1,248 tiles and report a further 55 days remaining (though the time remaining does decrease every half hour or so, i.e. after 3.5 hours it states 48 days remaining after 1,632 tiles completed on each thread)!

The time it is taking is no good, as I have a further 25 layer groups to cache! I have kept a close eye on the java process in Task Manager and it never spiked beyond using 5.5 GB of memory.  Currently been fluctuating between 3.5 to 5 GB for past half hour.

GeoServer settings updated (not sure if I am correct to do so):

Increased the Java Heap Space by updating startup.bat (-Xms2048m -Xmx8192m - 2GB and 8GB max).  There is 16GB on the server (the server is dedicated just for Geoserver/GeoWebCache purposes)
Updated the WMS settings vis GeoServer admin GUI for "Resource consumption limits" by setting all 4 settings to 0: Max rendering memory (KB), Max rendering time (s), Max rendering errors (count), Max number of dimension values.  If I am correct then these settings prevent the timeout now.
I have also switched to Production logging and turned off "Log to Std Out"
NOTE: I have not updated any values in gwc-gs.xml such as hardMemoryLimit, concurrenyLevel, etc. Nor have I changed the metatiling size (using default 4 x 4).
I have however enabled CORS and changed the GeoServer serviceStrategy to SPEED (updated web.xml for both these settings)

GeoWebCache settings updated (via GeoServer admin --> Tile Caching --> Caching Defaults):

Tile Locking Mechanism = NIO based lock (interprocessing locking)

Is there any way to optimize GeoServer/GeoWebCache to speed up the caching?  Is it even sensible to cache such huge amounts of GeoTIFFs grouped together into layer groups?  I know I can cache each layer/GeoTIFF individually but that then mean I need to add thousands of layers to my OpenLayers map in order to display/load each layer from the cache which means thousands of http requests per layer.

UPDATE: I have since found this link posted in 2010 by a member of the GeoSolutions team in Italy. It lists the estimated time for GeoWebCache to seed/generate different numbers of tiles. (Not sure how accurate/relevant it is to the current version of GeoWebCache):

https://docs.google.com/spreadsheets/d/1t9OJb-Z9vnHYKw6fWR82Wml4Dj9ePnNoOzqDw3v_PwU/edit#gid=0


texts:
I installed QGIS through OSGeo4W 64 bit version in Windows 8.

QGIS installed correctly, but I cannot add the Orfeo Toolbox.

Any suggestions?


texts: Performing Dynamic Legend Classifications with Data Driven Pages?

texts: I am creating choropleth maps for quantified data.  Each DDP will focus on a new county, which is shown by using a clip of the data frame (by the county boundary).  I want to define quantified legend symbology by equal intervals, which will change for each DDP.  This means that the legend's intervals would change for each page.  For example, Montgomery county may have a data range of 0-20, therefore the legend's intervals would be 0-10, 10-20, 20-30, and 30-40.  Bucks County may have a data range of 0-400, therefore the legend's intervals would be 0-100, 100-200, 200-300, and 300-400.


texts: Does anyone know if there is a way to export the xy data from sketch properties in the editor to a .txt file?


texts: Using one-to-many relationship classe/tabl in ArcGIS Desktop for monitoring?

texts:
I have a water source feature class in my geodatabase that stores point locations and other non-changing information. I want to monitor these water sources year after year and keep track of the data from year to year (so I don't want to overwrite the previous year's data with the following year's data).

I have a table that has the monitoring categories, and I have created a one:many relationship between the feature class and the table.

How can I best incorporate multiple years of data (through checking the geodatabase in and out of ArcPad on my GPS) into a table(s) related to my feature class?


texts: I need to Calculate a Field with modelbuilder, but first I want to make a join with 2 tables, and only after that join I have the parameters to calculate the field. While constructing the model I need to write the expression to calculate the field but I don't have the fields that I need yet because I still didn't make the join. How do I solve this?


texts:
I am using a modified version of script # 3 from the help docs here to update several services each day. Data is copied to the server for this. My modification is only that I loop through several MXD files, so basically just a for loop wrapper around the script at the end of the post here.

The issue is that the arcpy.StageService creates a .sd file as well as folders containing a copy of the data it will upload to the server. As far as I can tell, there is no provision to have this tool clean up after itself after uploading the service.It is trivial to delete the SD file, but the copy of the data I am not sure about. It is placed in folders 0, 1, 2, ...This does not seem to be well documented.
Is there something I am missing? Does anyone know of a reliable way to clean up after this tool, so I don't accumulate copies of my data over time?

import arcpy
from arcpy import env
import xml.dom.minidom as DOM

# Set environment settings
env.workspace = "C:/data"

# Set local variables
inServiceDefinitionDraft = "myMapService.sddraft"
outServiceDefinition = "myMapService.sd"
newType = 'esriServiceDefinitionType_Replacement'

xml = draftPath + in_sd_draft
doc = DOM.parse(xml)
descriptions = doc.getElementsByTagName('Type')
for desc in descriptions:
    if desc.parentNode.tagName == 'SVCManifest':
        if desc.hasChildNodes():
            desc.firstChild.data = newType
outXml = xml
f = open(outXml, 'w')
doc.writexml( f )
f.close()

# Execute StageService
arcpy.StageService_server(inServiceDefinitionDraft, outServiceDefinition)

# Set local variables
inSdFile = outServiceDefinition
inServer = "GIS Servers/myServerConnection"

# Execute UploadServiceDefinition
arcpy.UploadServiceDefinition_server(inSdFile, inServer)


texts: I need to convert my own vector map(stored in Geoserver) to "mbtiles" using MOBAC(Mobile Atlas Creator). For Custom map, we need to write an xml file. I searched every where on internet But no where it is mentioned about where to keep the xml file(which folder) and what should be the name of the file. I am asking this question to you because I didn't get my answer anywhere.Please reply step by step.Thanks.


texts: How to add one or more points to an existing polyline or polygon?

texts:
Using the following code, I make a polyline with two points.

  vl = QgsVectorLayer("LineString", layerName, "memory")
  pr = vl.dataProvider()
  vl.startEditing()
  fet = QgsFeature()
  fet.setGeometry( QgsGeometry.fromPolyline( [QgsPoint(x1,y1), QgsPoint(x2,y2)] ))
  pr.addFeatures( [ fet ] )

What I want is to add a line to this polyline while I keep only one id. So I can not use:

  fet.setGeometry( QgsGeometry.fromPolyline( [QgsPoint(x3,y3), QgsPoint(x4,y4)] ))

because this will save two lines with two different id's.

I can see in the QGIS API that there is a command:

    addPart (const QList< QgsPoint > &points)
    Adds a new island polygon to a multipolygon feature.

but I do not know if it works or how to use it. Does anybody have any idea how to add points or several points to an existing polygon or polyline?


texts:
I'm trying to compute the areas of the new layer I created by intersecting two layers.

How can I write a script that does something equivalent to clicking Export/Add geometry columns?


texts: Transforming points in CSV to linestring / polyline in QGIS

texts:
I have "BeginLat", "BeginLon", "EndLat" and "EndLon" as under in a CSV-file

I am trying to import it as a line string but I cant. I tried to import using
'Create a Layer from a Delimited Text File', it imported the data as a point but I want as a line string instead.

So is used 'XY to Line' but that gives me the incorrect output.

Not too sure what I am doing wrong. Any suggestions or hints?


texts: Install pymodis on Win10 python 2.7 anaconda

texts:
I'm trying to install pyModis on anaconda win10 python 2.7 and I have GDAL and all the other dependencies installed.  I get the following error -

  `PackageNotFoundError: Packages missing in current channels.

I've tried

  pip install
  and
   conda install

The weird thing is when I import pymodis on my ipthon I get no error, and when I search how to install it on https://anaconda.org/search?q=pyModis it does not have windows option.. so I'm not sure if it is possible to install it on windows10.


texts:
I have some plots of land spread across the landscape. Sometimes a parcel is subdivided in different sectors. For each parcel (and, in case of subdivision, for each sub-section) the quality of agricultural yield is known - binary coded as good or bad.

With the ultimate goal to assess what topographic/environmental IV (say, slope, elevation, distance from water reservoirs, etc) may have influenced the binary DV (by using Logistic Regression), I am wondering what could be a sound sampling strategy.

The starting point would be to draw a number of points within the parcels, then for each of them record the value of the DV (whether the quality is optimal or not) and the values of the IVs.

Questions:

I am unsure which is (more) correct: (a) to draw equally-spaced points or (b) to draw random distributed points?
In either approach, since the total area of good quality land is not equal to the total area of bad land, should the number of (random?) points be equal across the two qualities, or proportional to the size of each area?


texts: Make web map editable for group (arcgis.com)

texts:
I've created and web map and shared it with a group on arcgis.com.  I want the other users of the group to be able to edit.

I'm sure its a simple permissions issue, but the other users are only able to "save as" and the "save" is disabled.

When I look at the share settings for the web map, the group is indeed selected.

Web map is shared with the group
The group is private
I have the group contributors set to "All Members"

Are the other users in the group supposed to be able to edit the web map I create?  If so, how can I enable that?

Thanks in advance for any answers.


texts: Nearest Neighbour analysis between points in 2 tables utilizing with distances set along specific polyline roads

texts: I'm trying to do a Nearest Neighbor analysis between points in 2 tables utilizing with distances set along specific polyline road files I have. I am attempting to determine the most cost effective way to undertake works for a local council. I'm using Mapinfo and can get nearest neighbor analysis but it is just straight line distance not using the roads.


texts: Cesium Terrain generated using DSM is way higher than the base map

texts:
Is there any way I can clamp the terrain to the base-map's height? Is the problem with the vertical datum for the data. I tried changing ellipsoid's radius-- but I learnt that the height is relative to the ellipsoid's base height.
I'm using ctb-tiler to generate the terrain. Playing around with terrainExaggeration-- usually setting it 0.1 brings it closer to the base layer, but I'm expecting that it would cause issues while measuring heights-- also it appears extremely flat [undesirable]
Is it due to TIFF being in different CRS, or vertical datum being off? Or is it something that I can correct using cesium options for viewer/terrain provider?


texts: Creating symbology for polygon layer which has opaque outlines but transparent colored fills using ArcGIS for Desktop?

texts:
I am working in ArcGIS 10.2 and I run a Basic license.

Is there a way to make the outlines/borders of a polygon layer 0% transparent, while having the fields themselves show up at around 20% transparent?

I have set the symbology to Unique values so that I can assign a color ramp for the different areas that an attribute is assigned. I have currently set the entire layer to 20% transparent so that lower layers underneath are just slightly visible. In my examples its so that the lower parcel layer becomes visible.

My problem is that when the layer is set to semi transparent, the borders of my different areas are visually lost in some areas. I'd like to find a way to make the borders crisp and have some pop, while setting the inner fill to semi transparent. Is there a way to do this that I'm missing? It could be a setting in the steps to assigning the color ramp that I'm missing. And I don't think the answer is to go into each new feature individually to change these settings. I have over 800 attributes in the color ramp and I just feel like there has to be a better way that I'm missing.

I've attached a few references,
The first is before setting any transparency. The color ramp does its job.

And the second is after setting the transparency. The color ramp still works, but I'd like the outer boundaries to be non transparent so that they stand out from the lines of the parcel layer underneath.

Lastly, I know that they are both fairly ugly. It's not a finished product by any means, I just wanted to illustrate what I'm talking about for clarification. As with many things in ArcMap, it probably comes down to a single check box or tool set that I'm neglecting.


texts: Finding areas which are inside maximum of 2 buffer zones using ArcMap?

texts:
I have a territory with supermarkets. I'd like to find the areas in this territory which has less than 3 supermarket in its vicinity. For that, I created a 1 mile buffer for each POI.

Is there a way to choose the areas in ArcGIS, which are overlayed by maximum 2 buffer zone?


texts: How to make it clickable kml file that has been google maps

texts: I have uploaded a kml file into google maps. Now i need to make it clickable. Can there is a way to do this. or I need to upload by code only?


texts: Failing to get WKT to reference for a multi-line

texts:
I have a shape that I've exported to CSV and GeoJSON to be loaded into CartoDB. Unfortunately, the GeoJSON doesn't work so I am trying to upload the CSV but don't quite understand how to get the array to reference, I am guessing I should convert it somewhere or somehow?

Ideally for free and with low bandwidth (I'm currently in Uganda). Here is the table for reference: https://alissarose.cartodb.com/tables/kcca_scrape_osm_linejoin4

Also, if the GeoJSON would just upload, that would be great. Here's a link to the file that won't load any data into CartoDB https://github.com/alissarose/test_spot/blob/master/kcca_OSMlinejoin.geojson


texts:
I have downloaded what multibeam sonar datasets from the marine geoscience data system website http://www.marine-geo.org/index.php

The files have arrived in a .tar folder which contains multiple files with the name SOME_UNIQUE_ID_raw.all.gz. If I use gunzip to unzip a file I get a .all file which i've never encountered before.

Some googling says it contains multiple files but I've no idea how to open it.

Any ideas how to use it? I'm on the latest version of qGIS


texts: Using Raster Calculator in ArcPy gives ERROR 000989

texts:
I am creating a watermask from the DEM in ArcGIS DEsktop 10.5 python script. After executing the tasks, at the end I am getting the MIN elevation from Statistics_analysis.

Now I am doing RasterCalculator_sa() on the constant raster I have calculated above and executing the following

arcpy.gp.RasterCalculator_sa("\"%constant_raster_ %\" * float(%value%)", rastercalc)
where (value=MIN_elevation)

but my script is breaking at this line and displaying the error which I have attached.

I have exported this script through my model builder and have attached the raster calculator window snapshot.

Can anyone help?

I have also tried running the following

arcpy.gp.RasterCalculator_sa(constant_raster_ * float(value), rastercalc)

Its giving me error:

  Type error: cannot multiply sequence by non-int of type float


texts: How to work around "OGR-failure while deleting field 13. Invalid field index"?

texts:
this post might be related to this one:

QGIS Field Calculator Results Removed When Saving Edits

But there is

no suitable answer for me
It is not allowed to ask another time in the other post I guess so I created a new one.

I have got a Shapefile with all boroughs in France (projection = EPSG:2154 - RGF93 / Lambert-93)
I like to add some columns: area, Population, average income. The answer to make the columns bigger for area calculation does not work because the maximum size seems to be 10 in my Qgis version (1.8 Lisboa). If I like to add simply numbers (population number for example that does not work either. It does not matter if I use "interger" "real" or "string"...while saving it tells me that saving did not work because it was not able to delete attributes. OGR-failure while deleting field 13. Invalid field index

Afterwards the result seems to be different: sometimes it can save the result, sometimes there will be set "NULL". It can not be so difficult to add a column in a shapefile can it?

To show you what I am working with 2 screenshots (I added the last 2 columns):


texts:
I want to utilize multiprocessing within my arcpy scripts but my first test has run into a problem which I don't understand. I'm running the script in the python window:

import arcpy
from multiprocessing import Pool

def f(x):
    return x*x
pool = Pool(processes=4)
print pool.map(f,[1,2,3,4])

As soon as I assign the processes, ArcMap open four new instances and the script does not print the values of x as expected (the above code is from an example I found). The new instances of ArcMap initialize but then close with the following error:

What am I doing wrong? Is there a setting/patch I've ignored?
I'm using ArcMap Desktop 10.0 SP5 build 4400 and I have also tried the code on 10.3.1.4959.


texts: ISO 3166-1 alpha-2 Country and region location in coordinates

texts:
I am doing some mapping that requires country and region average coordinates.

I've found this very useful table with the coordinates of countries, their ISO 3166-1 alpha-2 code and the average coordinates of each. However, this list does not include regions.

Is there a similar source that includes countries and regions?


texts:
I'm using OpenStreetMap and its vectorial road network and I'd like to implement a map matcher algorithm.

Currently I'm able, for each GPS position, to retrieve the nearest road segment and calculate the projection of this position to that segment, like on this image (Red pin is the pure GPS position, in blue the mapped segment and in Green the mapped position):

However, due to the lack of accuracy of the GPS, sometimes the mapped position jumps from segment to another and can provide some inconsistent mapped position from time to time.

My current algorithm is very basic : from the pure GPS position, I get the nearest segment and decide that the mapped matched position is on this one. I know that this can be really improved.

I can imagine that taking the vehicle direction into account will improve the map matching but do you know any other approach that would enable me to improve my map matcher ?

I seek any link, and/or open source software?


texts: geoprocessing service via python toolbox script, local versus server paths

texts:
I feel like I'm missing a very basic concept when it comes to publishing python toolbox scripts to a geoprocessing server. I've scoured the ArcGIS online help (not saying I've read everything, and it's possible I missed the important part of information in all that I've read), but I think my issue is understanding path specifications, especially when it comes to the server. I'll try to explain as best I can:

I have a python toolbox script that takes a .tif file representing elevation, and a .cfg file that supplies configuration input to a custom command line interface (CLI) executable.

The "getParameterInfo()" block of code is as follows:

paramElevation = arcpy.Parameter(displayName="Elevation File (.tif, .asc, .img)",
                                     name="elevationFile",
                                     datatype="DEFile",
                                     parameterType="Required",
                                     direction="Input")

paramConfig = arcpy.Parameter(displayName="WindNinja Configuration File",
                                     name="configFile",
                                     datatype="DEFile",
                                     parameterType="Optional",
                                     direction="Input")

paramOutFile = arcpy.Parameter(displayName="Output File",
                                     name="outFile",
                                     datatype="DEFile",
                                     parameterType="Derived",
                                     direction = "Output")

In the "execute()" block of code we have:

ninjaPath = "C:/WindNinja/WindNinja-2.3.0/bin/WindNinja_cli.exe" #Location of windninja CLI on server

imgFile = parameters[0].valueAsText #User specified elevation file
confFile = parameters[1].valueAsText #User specified configuration file

args = (ninjaPath, "--elevation_file", imgFile, "--config_file", confFile)

runfile = subprocess.Popen(args,stdout= subprocess.PIPE, bufsize = -1) #Run windninja cli

runfile.wait()

output = runfile.stdout.read()
if output is None:
    messages.AddMessage("Results: None returned\n")
else:
    messages.AddMessage("Results:\n" + output)

The CLI takes the elevation .tif and the configuration file, does its magic, and creates an output ASCII file as a result. However, the output ASCII file is always written to the same location as the input elevation file. A query of the location of the specified elevation file on the server returns:

which is the unique jobs id folder for the task. The script runs successfully on a local machine and takes ~20 seconds to complete. It takes about ~2 seconds to complete on the server, and a query of the unique jobs id folder afterwards shows no resulting ASCII. So here comes my list of questions:

Does a copy of the user specified elevation file actually exist in the unique jobs id folder?
Are there any arcpy tools that would allow me to copy the elevation and configuration files to a known location on the server (say the scratch workspace for example), and then run the CLI on those copies?
How can I return the resulting ASCII (once I can get the script to create it on the server, and locate where it's created) from the geoprocessing service to my local machine?


texts: RStoolbox::readMeta open Landsat MTL in R: Error in CRS

texts:
I am trying to read a Landsat8 MTL.txt in R using readMeta() but I have this error:
meta2021 <- readMeta("C:/Users/LC08_L2SP_028028_20210305_20210312_02_T1_MTL.txt")

Error in CRS(paste0(c("+proj=", "+zone=", "+units=m +datum="), pars, collapse = " ")) :
  No spaces permitted in PROJ4 argument-value pairs: +proj= +zone= +units=m +datum=


texts:
I am using QGIS with QTiles plugins.

It was working perfectly, until I use Scale Range within my style.
When I do so, the Scaled Range layer is not printed at all on the generated png.

Do you know why?


texts: FME - what is the difference between "generate workspace" and "create workspace"?

texts: as a newbie to FME I can´t really understand the basic difference between the two ways of making a workspace. Generate or Create. Can someone explain the difference?


texts: Load XYZ point data with UTM coordinates with included zone attribute in x-values?

texts:
Given a XYZ file with following structure for elevation values (3rd column), x-coordinate (1st column) and y-coordinate (2nd column) for UTM zone 32 N (EPSG:25832):

32496000.00 5764000.00  121.26
32496000.00 5764001.00  121.29
32496000.00 5764002.00  121.10
32496000.00 5764003.00  121.03
...

How can I get rid of the leading "32" that is meant to be the zone number?


texts: Many-to-One Join while Maintaining Attributes in New Fields

texts:
I am struggling to find the correct tool to do what I want and I feel I am overlooking something simple... I am working with census blocks and internet providers in those census blocks.  I have a spreadsheet showing the census block ID number and the provider in that census block.  However, in most cases there are multiple providers for each census block ID.  So, I get a table with duplicate Census Block IDs in their own row but unique providers.  Ideally, I would like to remove the duplicate rows, but maintain the unique provider list only in a new column instead of a row:

Goes to this:

I would need this to be at least semi-automated since I will be dealing with 500k+ lines of data per example.  If I do a many-to-one join in ArcGIS it only takes the first row.  I can create multiple features with identical geometries using the 'Make Query Table' function, but this map will ultimately be used by a layperson and they want to click on a census block and have a list of providers and not cycle through all the layers.

It makes no difference to me if this step is done in Excel, ArcGIS (with ET Geowizards Plugin), QGIS, or another program that may do it best??


texts: Disabling Maplex in particular layer of data frame?

texts:
I'm using ESRI ArcGIS Desktop 10.3.1.
I am using Maplex (labeling extention) for designing map layout. But at some layer of Data frame, i need to be use standard label engine.

Is there a method for doing this?


texts: Connect to local Microsoft SQL Server Management Studio with QGIS

texts:
I am running SQL Server 2014 Management Studio and 2.18.16 version of QGIS. When I attempt Layer -> Add Layer -> SQL Server layer and click new:

Connection name: Local
Provider/DSN blank
Host: Localhost

Clicking "List Databases" shows a - "Server does not exist or access denied" error that disappears really fast. Other processes I am using can connect to the database fine (although this had an option for Windows Authentication). I have also tried enabling TCP/IP and named pipes in the management studio options


texts: Projecting gtiff data using GDAL and Python?

texts:
I have a tile data and I would like to transform the data to a gtiff data with georeference information via gdal and python.

The tile is the quadtree tile with quad key 1321222320321122. The left upper point of this tile is Point(114.14794921875 22.33991442556202)(the right lower point of this tile is Point(114.1534423828125,22.334833457530486) in case of use). The original tile file is a 256*256 png file.

I refered the code from Georeferencing raster using GDAL and Python?

Here is my code:

src_ds = gdal.Open(src_path)
driver = gdal.GetDriverByName('GTiff')

dst_ds = driver.CreateCopy(dst_path,src_ds,0)
# Set projection
gt = [114.14794921875,256,0,22.33991442556202,0,-256]

dst_ds.SetGeoTransform(gt)

srs = osr.SpatialReference()
srs.ImportFromEPSG(4326)
dest_wkt = srs.ExportToWkt()

dst_ds.SetProjection(dest_wkt)

dst_ds = None
src_ds = None

Then I directly put the generated gtiff data to QGIS, but the figure is not in a proper location (neither it locates in the same place as the origin figure.) The layer extent is (114.1479492187500000,-65513.6600855744400178 : 65650.1479492187500000,22.3399144255620214). So there must something wrong with the transform process, and I am wondering what is the right transform parameter in this case.


texts: Why is the QGIS 2.2 database tab missing?

texts:
I have recently installed QGIS-2.2.0 but the Database tab in the top-menu bar is missing. It looks the main reason is missing libgdal1h library. But when I am installing it, it's removing Postgresql-9.3, PostGIS-2.1 and PgAdminIII (which initially asked for libgdal1 library during installation) before installation. I want PostGIS to connect to from QGIS Database tab (Database Manager). I guess, there is a conflict between libgdal1h and libgdal1.

I am on Ubuntu-12.04.


texts: I don't know how to export the geometry of tables in a .sql format from PostgreSQL database. How can I do this?


texts: Implementing app login in custom web app?

texts:
I created map, web mapping application on ArcGIS Online and wanted to access map using this app (but app hosted on my server using app login).
We can create web application using many default template on ArcGIS Online. we can also download source code of these JavaScript applications and can host them on own servers.

But I am not able to find any example which can guide me to modify app code to use app login.

I already know following steps:

Register the app and get client id (app id)/client secret (app secret)
Using POST request get access token from https://www.arcgis.com/sharing/rest/oauth2/token/
What next? Not sure
How to modify code in my downloaded app to access map?
Downloaded app folder structure

@heather-zerbe-gonzago helped but I am still not successful running my map.
I am using web application created by App builder and hosted it on own server. I have changed below files and using https://github.com/Esri/resource-proxy

Proxy.config

Config.json

Getting error {"error":{"code":400,"message":"Unable to generate token","details":["Unable to generate token for this server"]}} while hitting exchangePortalTokenForServerToken method in proxy.ashx file

I am able to resolve the above issue and come across another one.
I am trying to access ArcGIS Online Map using web builder generated app hosted on own servers.

I am getting below error
code:498
details:[]
message :"Invalid Token"
while app hits url
https://***/arcgisdev/proxy.ashx?https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=json


texts:
I am trying to add a shapefile to QGIS that contains reconstructed UK postcode polygons (January 2015), which can be found in this link https://www.opendoorlogistics.com/downloads/ in the section 'UK postcode boundary polygons'. The file I use is named 'Districts.shp' and it worked fine when I had the Windows QGIS version downloaded via the Standalone installer via this link https://qgis.org/en/site/forusers/download.html.
However, I was having issues with GRASS (I needed to use the r.reclass function) and I therefore found out that I needed to download QGIS via the OSGeo4W Network Installer to solve the error I was getting. Now that GRASS is working, though, I am having this error that I didn't have before when adding the shapefile 'Districts.shp'.
This error says 'No transform is available between OGC:CRS84 - WGS 84 (CRS84) and EPSG:3035 - ETRS89-extended / LAEA Europe', and the problem I am having with this is that I don't see the postcode division that I would usually see when adding this layer. It is also worth mentioning that this issue is also not happening to a colleague of mine who is using a Mac version. He is not having the issue with GRASS or this one with adding this same exact shapefile into QGIS. Let me know if I can add more details so you can help me with this!


texts:
I have 50,000 polygon shapefile, each polygon is a small community.
I have a flow accumulation raster.

I need to extract just the maximum cell (max flow accumulation) for each polygon.

Now if I run a zonal maximum it fills the polygon with the maximum flow accumulation value.

I need just the cell with the highest value returned not the entire zone.

I could do a zonal maximum and then subtract the original raster and I think all values that equal 0 would be what I want.

To be clear. I want just the cell with the highest value in each zone returned as a raster cell or even as a point (not the entire zone populated with the value).

ArcGIS solution preferred.
Model Builder fine.
ArcPY ok.


texts: Opening layer attribute table in map document using ArcPy?

texts:
Trying to create a map document programmatically. Added a  featureclass as a layer. When I open the map document in ArcMap, I want the table for that layer to be open.

Found TableView (doc) and AddTableView (doc), but these seem to be only for standalone tables. I also looked at the properties for Layer (doc) and for DataFrame (doc) and didn't see methods that looked right.

What I'm shooting for is to double-click on the mxd and have something like image below appear.

Any ideas?


texts:
I have a map (using Leaflet) that uses GeoJSON files as source. These are formatted to fit in Leaflet.

How can I make the GeoJSON files easily editable so that an authorized person with no Leaflet/JavaScript- knowledge can add new points or edit properties of existing points?


texts: Given a GeoJSON file how do I calculate the area of the embedded features?

texts:
We have a GeoJSON file that contains an array of features each with their associated geometry.  How can I calculate the area of each feature?  Are there any Java or Swift libraries to help me?  Any advice on how to get started here?

Please excuse the naive nature of this question.  I'm new to this GeoJSON stuff.


texts:
Full story below, but essentially I'm trying to use Geoserver and it needs the class org.geotools.util.Version, but it can't find it even though I can see it's in the appropriate jar file. Something is fundamentally wrong and I can't understand how anything has worked so far for anyone when things appear so broken or how to fix this.

Background (probably inessential):

I'm trying to use the SLDSelect control in OpenLayers (note that the example http://openlayers.org/dev/examples/SLDSelect.html is also using GeoServer according to the source, which makes this story weirder). I had installed the GeoServer app for Mac via some dmg (can't remember exactly but it doesn't matter) and I was getting an error. I diagnosed wrong and installed Tomcat and the latest geoserver.war (2.5.1) straight from the website - so now it's platform independent. I got GeoServer working but still got the same error for SLDSelect. I looked closer and eventually delved into the source of Openlayers. I found that in the function OpenLayers.Control.SLDSelect.parseDescribeLayer the variable url was null from which I saw that describeLayer wasn't being formed properly. This lead me to look at the activate function.

Here's where it gets really weird:

When OpenLayers calls activate, it GETs the following URL, as seen in Firebug:

http://localhost:8080/geoserver/cite/wms?SERVICE=WMS&VERSION=1.1.1&LAYERS=cite%3Aveg_rsa&REQUEST=DescribeLayer

The response to this from GeoServer is:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> <ServiceExceptionReport version="1.1.1" >   <ServiceException>
      org.apache.commons.lang.SerializationException: java.lang.ClassNotFoundException: org.geotools.util.Version
java.lang.ClassNotFoundException: org.geotools.util.Version
org.geotools.util.Version
</ServiceException></ServiceExceptionReport>

which seems pretty serious. I copied and extracted $TOMCAT/webapps/geoserver/WEB-INF/lib/gt-metadata-11.1.jar and found Version.class under org/geotools/util as expected. So why can't it find it?

I also got the same error on a slightly older version of the geoserver.war (2.4.5).

GeoServer is generally working. OpenLayers is able to request and display polygons from PostGIS over WMS. I even managed a parametrised SQL view. I've restarted my computer and still get the same issue. What could be wrong?

In case it helps, when I start Tomcat I get:

Using CATALINA_BASE:   /Library/Tomcat
Using CATALINA_HOME:   /Library/Tomcat
Using CATALINA_TMPDIR: /Library/Tomcat/temp
Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
Using CLASSPATH:       /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
Tomcat started.

Update: now I'm finding that WFS isn't working in general for similar reasons. When I try making a WFS request, I get java.lang.ClassNotFoundException: org.geoserver.wfs.WFSInfo$Version. I also see this if I click on one WFS 1.1.0 link on the home page, i.e. a GetCapabilities request.

While I'm at it, in case they're linked (maybe a general JRE problem?) if I click on the WFS link on the left sidebar, I get:

org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = srsNameStyle]]

I also can't enable any services for workspaces (I'm not sure how I managed before). When I tick a checkbox (e.g. for WMS), it tells me instantly that my session has timed out when it definetely hasn't. Before, it would let me tick, but once I clicked 'Save' it would show a java.lang.reflect.InvocationException or something at the top and not save.

Basically all my installations seem completely broken.


texts: Sorting layers in specific group layer with ArcPy?

texts:
I have to programmatically sort several layers in an .mxd project that are each placed in the same group layer. I have found a script that partially works by sorting all layers in the TOC (Arc GIS 10.1 - How to sort Layers ascending at TOC in "List by drawing order").

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0] # Assuming one data frame
group_lyr = [lyr for lyr in arcpy.mapping.ListLayers(mxd) if lyr.isGroupLayer][0] # The temp group layer should be the only one
lyr_names = sorted(lyr.name for lyr in arcpy.mapping.ListLayers(mxd) if lyr.isFeatureLayer)

for name in lyr_names:
    arcpy.mapping.MoveLayer(df, group_lyr, arcpy.mapping.ListLayers(mxd, name)[0], "BEFORE")

mxd.save()

However I am having trouble to apply this to a specific group layer (in this case 'GroupLayer1') as indicated in the illustration below.

Is there a solution that allows for sorting only the layers in a specific group layer?


texts: How to check VALUES from different datasets spatially near with ArcGIS10

texts:
I need some suggestions, let's see:

I have two heavy polyline datasets, from different sources, so they will never be coincident (it doesn't matter this issue). Both have the same field from which I need to work. These string fields has 3 possible values. So, I need to check if every polyline, which is more or less parallel to the other,  is coincident in VALUE.

An example,

We've got 5 labelled (with the Value to check) polylines (3 from one dataset, 2 from the other), in this cases, there is no mistakes, there is concordance. Then I have a 1 polyline (the one with the red cross), with no paired polyline, but this doesn't really care. Just the ones paired mostly parallel.

Somebody knows any ArcGIS10 tool or some Python code to check it?

Thanks!


texts: How do I add a layer from another Mapbox Studio style I created?

texts:
Per the example at https://docs.mapbox.com/ios/maps/examples/runtime-toggle-layer/ I'm able to easily add a layer from one of Mapbox's pre-defined map styles (code included in first func to show exactly what worked for me). However, when I try to add a layer from one of my own styles, it seems to be added but doesn't appear. I'm wondering what I'm missing or if this is even possible. In the same test app, I've used the URL for my second style to create the MapView temporarily so I could check the layer to ensure I'm using the proper sourceIdentifier and sourceLayerIdentifier, e.g.
<MGLLineStyleLayer: 0x282e54080; identifier = layer-friendly-name; sourceIdentifier = mapbox://myco.abc123; sourceLayerIdentifier = layer_src_name; predicate = (null); visible = YES>

func addMapboxExampleLayer(){ // works fine

    let url = "mapbox://mapbox.mapbox-terrain-v2"

    // Add a new vector source and layer.
    guard let srcURL = URL(string: url) else { return }

    guard let mapStyle = mapView.style else { return }

    let source = MGLVectorTileSource(identifier: "contours", configurationURL: NSURL(string: "mapbox://mapbox.mapbox-terrain-v2")! as URL)
    mapStyle.addSource(source)

    let layer = MGLLineStyleLayer(identifier: "contours", source: source)
    layer.sourceLayerIdentifier = "contour"

    layer.lineJoin = NSExpression(forConstantValue: "round")
    layer.lineCap = NSExpression(forConstantValue: "round")
    layer.lineColor = NSExpression(forConstantValue: UIColor.red)
    layer.lineWidth = NSExpression(forConstantValue: 4.0)

    let layerBelowIdentifier = "county-label"

    if let layerBelowInsert = mapStyle.layer(withIdentifier: layerBelowIdentifier) {

        mapStyle.insertLayer(layer, above: layerBelowInsert)
    }
}

This does not work:
func addParcelLayer(){

    let url = "mapbox://styles/stonetip/<my-unique-style-id>"

    // Add a new vector source and layer.
    guard let srcURL = URL(string: url) else { return }

    guard let mapStyle = mapView.style else { return }

    let source = MGLVectorTileSource(identifier: "mapbox://myco.abc123", configurationURL: srcURL)
    mapStyle.addSource(source)

    let layer = MGLLineStyleLayer(identifier: "layer-friendly-name", source: source)
    layer.sourceLayerIdentifier = "layer_src_name"

    layer.lineJoin = NSExpression(forConstantValue: "round")
    layer.lineCap = NSExpression(forConstantValue: "round")
    layer.lineColor = NSExpression(forConstantValue: UIColor.red)
    layer.lineWidth = NSExpression(forConstantValue: 4.0)

    let layerBelowIdentifier = "county-label"

    if let layerBelowInsert = mapStyle.layer(withIdentifier: layerBelowIdentifier) {

        mapStyle.insertLayer(layer, above: layerBelowInsert)
    }
}


texts:
Hi have a database from one app that was used to register travels made by the staff. The recorded rows looks like:

travel id (#)
leg id (#)
leg departure (date time and city)
leg arrival (date time and city)
staff member info
other aggregable fields like the method of transportation, flight no, etc.

What is the data modeling standards used to connect the dots correctly so trips could be grouped by members, from-to (bearing in mind that one trip could have connexions) and preserve an order so I can query the last trip (on the time-series bars) and determine that the member is currently on that city.


texts: Formula to convert X/Y to Long/Lat coordinates of given point

texts:
I need to figure out how to convert my X/Y-coordinates to longitude and latitude.
I do not need the exact conversion, just an approximate so I can plot it in a mapping API. I managed to estimate the following X/Y to Long/Lat:
(x, y) = 24050, 123783.3333 -> (long, lat) = (122.98, 24.46)

(x, y) = 24216.6667, 123933.3333 -> (long, lat) = (122.985339,
24.46041)

Can I somehow use these to come up with a formula to convert the other X/Y points?
I found another link that does what I want, but I cannot extract the formula: http://www.whoi.edu/marine/ndsf/cgi-bin/NDSFutility.cgi?form=0&from=XY&to=LatLon
In the above link, I specify the origin of X/Y in Lat/Long coordinates, and it was able to convert X/Y to Lat/Lang.


texts:
I want to validate all the features that have been changed since last save. Currently I'm trying to do this in an ESRI.ArcGIS.Desktop.AddIns.Extension. My sde database is not versioned.

public class EditorExtension : ESRI.ArcGIS.Desktop.AddIns.Extension
{

    void editEventsEvent2_BeforeStopEditing(bool save)
    {
        var iEditor = ArcGisSingletons.GetIEditor();

        if (iEditor.HasEdits())
        {
            var enumDatasetName = iEditor.EditSelection;
            enumDatasetName.Reset();
            var datasetName = enumDatasetName.Next();
            while (datasetName != null)
            {
                var snid = datasetName.HasSnid() ? datasetName.Snid() : -1;
                Trace.TraceInformation("dataset Name: " + datasetName.Class.AliasName + ", Type: " +
                                       datasetName.FeatureType +
                                       ", Category: " + snid.ToString());
                datasetName = enumDatasetName.Next();
            }
        }
    }
}

Here I'm trying with the EditSelection but I really just want a reference to all editing objects in order to run through them and check if they are valid.

How can I get a reference all the objects that have been changed since last save?

Is there another way to validate the edited objects in arcobjects?


texts: QGIS use layout name in styling expression

texts:
I have a .qgs file with a number of fairly complex styling rules showing the local Nordic ski trails. It has a single layout for printing on an 11x17 page.

Until now the same PDF has been used for both paper and digital map products. I would like to change this and produce separate paper-only and digital-only PDFs as some design features are better suited to paper than digital. For example an inset map is useful on paper, to provide sufficient detail in a particularly complex trail section, and it's easy for a user's eyes to switch between different parts of the print. However in digital form it's tedious to zoom out, pan, and zoom in when comparing the main map and the inset map. Also because zooming is possible in digital I can get away with using a much smaller font size.

The only difference in the digital-only .qgs file would be the font size in a few labelling rules. If possible I want to avoid creating (and then maintaining) a completely separate .qgs file just for these minor changes.

Is there any way I can incorporate the layout name into an expression? For example use font size A when generating the paper-only layout, font size B when generating the digital-only layout, and default to one or the other when simply viewing the map in QGIS. I looked through the options in the expression dialog but I can't see anything that looks like it would give me a layout name.


texts: Downloading SoilGrids data from WCS in R

texts:
I am trying to download SoilGrids GeoTIFF data in R using WCS. I have followed the tutorial set up by ISRIC (https://git.wur.nl/isric/soilgrids/soilgrids.notebooks/-/blob/master/markdown/wcs_from_R.md).
I have had no issues with getting data to download in the past but for whatever reason, today I have been getting an error message when running the gdal_translate() function. I have included the code below (which does not differ very much from what is shown in the tutorial):
# Variable of Interest:
voi      <- "cec"
depth    <- "5-15cm"
quantile <- "Q0.5"

voi_layer <- paste(voi, depth, quantile, sep = "_")

# Variable necessary for WCS call
wcs_path <- paste0("https://maps.isric.org/mapserv?map=/map/", voi, ".map")
wcs_service <- "SERVICE=WCS"
wcs_version <- "VERSION=2.0.1" # use 1.1.1 for gdal version < 2.3

# Set bounding box for download of TIFF (in Homolosine projection):
bb <- c(-13326040.540570, 7858775.724074, -11752986.098472, 7177452.780999)
igh <- "+proj=igh +lat_0=0 +lon_0=0 +datum=WGS84 +units=m +no_defs"

wcs <- paste(wcs_path, wcs_service, wcs_version, sep = "&")

l1   <- newXMLNode("WCS_GDAL")
l1.s <- newXMLNode("ServiceURL", wcs, parent = l1)
l1.l <- newXMLNode("CoverageName", voi_layer, parent = l1)

# Save to local disk
xml.out = "./SoilGrids/sg.xml"
saveXML(l1, file = xml.out)

# Download raster as GeoTIFF (Warning: it can be large!)
file.out <- paste0("./SoilGrids/", voi_layer, ".tif")

gdal_translate(xml.out,
               file.out,
               tr = c(250, 250),
               projwin = bb,
               projwin_srs = igh,
               co = c("TILED=YES","COMPRESS=DEFLATE","PREDICTOR=2","BIGTIFF=YES"),
               verbose = TRUE
)

The message shown after the gdal_translate() function is this:
Checking gdal_installation...
GDAL version 3.0.4
GDAL command being used: "C:\Program Files\QGIS 3.10\bin\gdal_translate.exe" -tr 250 250 -projwin -13326040.54057 7858775.724074 -11752986.098472 7177452.780999 -of "GTiff" -projwin_srs "+proj=igh +lat_0=0 +lon_0=0 +datum=WGS84 +units=m +no_defs" -co "TILED=YES" -co "COMPRESS=DEFLATE" -co "PREDICTOR=2" -co "BIGTIFF=YES" "./SoilGrids/sg.xml" "./SoilGrids/cec_5-15cm_Q0.05.tif"
ERROR 1: PROJ: proj_create_from_database: Cannot find proj.dbInput file size is 159246, 580340...10...20...30...40...50...60...70...80...90...100 - done.
NULL

The ERROR1 line is new and seems to be causing the issue.
Any ideas?

Update:
The ERROR code shown in the example above does not seem to be causing any issues with the creation of the raster. When I load the raster in from the file created using gdal_translate() and try reproject it, setting res = 30 in the rasterProject() function seems to change all values to NA. Code below:
rast <- raster(paste0("./SoilGrids/", voi_layer, ".tif"))
rast <- projectRaster(rast,
                      res = 30,
                      crs = "+proj=longlat +datum=WGS84
                             +no_defs +ellps=WGS84 +towgs84=0,0,0")

To fix this, I removed res = 30 and replaced it with the disaggregate function before reprojecting (as below).
rast <- raster(paste0("./SoilGrids/", voi_layer, ".tif"))
crs(rast) <- igh
rast <- disaggregate(rast, fact = (250/30)) # original resolution = 250, desired resolution = 30
rast <- projectRaster(rast,
                      crs = "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")


texts: Changes made using wfs-t and GeoExt don't get saved to PostGIS

texts:
I'm using GeoExt to display and edit a vector layer from GeoServer (running with Apache Tomcat) but if I modify the shape of an existing polygon (or create a new one but I'm trying not to leap ahead of myself) the change doesn't get written back to PostGIS through GeoServer. I'm using code obtained from a tutorial at http://workshops.opengeo.org/geoext/wfs/wfst.html. I see a few people have had problems with the same code but can't find any solutions that solve my problem.

The code for the save button action:

    handler: function() {
  app.featureGrid.store.protocol.commit(
   vectorLayer.features, {
    callback: function() {
        var layers = app.mapPanel.map.layers;
        for (var i=layers.length-1; i>=0; --i) {
          layers[i].redraw(true);
        }
        app.featureGrid.store.reload();
    }
  });
}

My map layers get redrawn and the polygon changes persist but if I reload the page, the original shape is back. There is no error in Chrome developer tools but if i look in the GeoServer log file, I get:

2012-05-10 14:51:31,311 INFO [geoserver.wfs] -
Request: getServiceInfo
2012-05-10 14:51:31,321 ERROR [geoserver.ows] -
org.geoserver.wfs.WFSTransactionException: Feature type 'dev_apps' is not available:
    at org.geoserver.wfs.Transaction.execute(Transaction.java:222)
    at org.geoserver.wfs.Transaction.transaction(Transaction.java:108)
    at org.geoserver.wfs.DefaultWebFeatureService.transaction
   (DefaultWebFeatureService.java:162)

I'd really appreciate some help as I don't know where to look anymore!


texts: How to convert multiple vector layers to georeferenced rasters using QGIS?

texts:
I have Openstreetmap background loaded in QGIS - currently from Spatialite, but no problem to get shapefiles.

I need to convert the loaded map to one big raster or could also by more smaller ones, but surely need them to be georeferenced.

I know there are ways to convert native OSM files to raster but I am also using custom styling as Stamen Tonerlite or Google style and have no idea how to apply them outside QGIS.

My current idea about "dirty" solution is about switching off north arrow and other decorations in QGIS, then using "Save as image" to produce multiple georeferenced images to cover my area and finally merge them into one using Gdal tools from QGIS.

But maybe there is better solution?


texts:
Using QGIS 3.16.6, adding WFS layers (names start with 'Base Map 2017:***') from open WFS server "https://moldova-map.md/geoserver/maps/wfs". Usually work at 1:1000 to 1:5000 scale.
When WFS layers features are loading, a warning messages appears:
 WARNING    Cannot create temporary SpatiaLite cache.: GDALCreate() failed: Creating a Spatialite database, but Spatialite extensions are not loaded.

And features are not loaded completely. Refresh does not help.
Is it a QGIS bug or WFS server problem?


texts:
I'm using the OpenLayers.Format.KML class to export the features in MyLayer to KML. However my features have attributes attached to the geometry object i would also like to have exported to the KML file. Does anyone know how to do this?

For example below is an excerpt from my exported KML. I want to be able to fill in the Placemark name and description with values from my feature.geometry.attributes object.

<kml>
<Folder>
 <name>Orders Export</name>
 <description>This KML is a representation of the features that have been exported from your cart.</description>
<Placemark>
 <name>OpenLayers.Feature.Vector_3321</name>
 <description>No description available</description>
<Polygon>
<outerBoundaryIs>
<LinearRing>
 <coordinates>-87.905322927997,31.501496850947 -87.103099728388,31.3860815117 -87.130858407835,31.283001227822 -87.932252685086,31.398209088023 -87.905322927997,31.501496850947</coordinates>
 </LinearRing>
 </outerBoundaryIs>
 </Polygon>
 </Placemark>
...

My code:

var format = new OpenLayers.Format.KML({
    'internalProjection': map.baseLayer.projection,
    'externalProjection': map.Projections.Geographic
});
format.foldersName = "Orders Export";
format.foldersDesc = "This KML is a representation of the features that have been exported from your cart.";
var kml = format.write(MyLayer.features);


texts:
I have been programming in C# a small code for:1) create a polyline Featureclass in a GDB, 2)put that in the map view (ArcMap 10.2) and finally 3) edit that feature using a button or tool...
Well I have tried to program it using AddInns controls, but I faced the trouble at the time to edit the feature; I switch to use "Extending ArcObjects" now I can create the feature in my local GDB easily, but at the momento to put the Feature into the map I can not do it; the code is as follows:

GLB.nombre = txtNombre.Text;//definig the name from a text box in a regular form....
IWorkspaceFactory pWorkSpaceFactory = new FileGDBWorkspaceFactoryClass();
IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)pWorkSpaceFactory.OpenFromFile(@"C:\INFO_2015\ANH_GDB.gdb", 0);
IFeatureDataset featureDataset = featureWorkspace.OpenFeatureDataset("Temp");

IFeatureClass featureClass;

UID CLSID = new UIDClass();
UID CLSEXT = null;
CLSID.Value = "esriGeoDatabase.Feature";
IObjectClassDescription objectClassDescription = new FeatureClassDescriptionClass();

IGeometryDef pGeoDefL = new GeometryDefClass();
var pGeoDefEditL = (IGeometryDefEdit)pGeoDefL;
pGeoDefEditL.GeometryType_2 = esriGeometryType.esriGeometryPolyline;

//here I define the fields of the DB.......
IFields fields = new FieldsClass();
fields = objectClassDescription.RequiredFields;
IFieldsEdit fieldsEdit = (IFieldsEdit)fields; // Explicit Cast
fieldsEdit.FieldCount_2 = 3;
// ID Field
IField oIdFieldL = new FieldClass();
var oIdFieldEditL = (IFieldEdit)oIdFieldL; // Explicit Cast
oIdFieldEditL.Name_2 = "ObjectID";
oIdFieldEditL.Type_2 = esriFieldType.esriFieldTypeOID;
fieldsEdit.set_Field(0, oIdFieldL);
//Entity type
IField shpFieldL = new FieldClass();
var shpFieldEditL = (IFieldEdit)shpFieldL; // Explicit Cast
shpFieldEditL.Name_2 = "Shape";
shpFieldEditL.Type_2 = esriFieldType.esriFieldTypeGeometry;
shpFieldEditL.GeometryDef_2 = pGeoDefL;
fieldsEdit.set_Field(1, shpFieldL);
//line lenght
IField longFieldL = new FieldClass();
var longFieldEditL = (IFieldEdit)longFieldL;
longFieldEditL.Name_2 = "Longitud";
longFieldEditL.Type_2 = esriFieldType.esriFieldTypeDouble;
fieldsEdit.set_Field(2, longFieldL);
// add field to field collection
fields = fieldsEdit; // Explicit Cast

IFieldChecker fieldChecker = new FieldCheckerClass();
IEnumFieldError enumFieldError = null;
IFields validatedFields = null;
fieldChecker.ValidateWorkspace = (IWorkspace)featureWorkspace;
fieldChecker.Validate(fields, out enumFieldError, out validatedFields);

featureClass = featureDataset.CreateFeatureClass(GLB.nombre, validatedFields, CLSID, CLSEXT, esriFeatureType.esriFTSimple, "Shape", "");

IApplication application;//HERE IS THE ERROR!!!!!!!!
IMxDocument mxDocument = ((IMxDocument)(application.Document)); // Explicit Cast
IActiveView activeView = mxDocument.ActiveView;
IMap map = activeView.FocusMap;

IFeatureLayer featureLayer = new FeatureLayerClass();
featureLayer.FeatureClass = featureWorkspace.OpenFeatureClass(GLB.nombre);
featureLayer.Name = GLB.nombre;
map.AddLayer(featureLayer);

mxDocument.UpdateContents();
mxDocument.ActiveView.Refresh();

I have been working on it more than three weeks without solution, could anybody give me a hand?


texts: Insanely large house numbers in TIGER data

texts:
I'm parsing the US TIGER data and I'm coming across huge house numbers.

example:
10100005 Thousand oaks drive, st johns, florida

Google maps, and open street maps - nominatim says this is valid! Im not from the US so im finding this very confusing, Any thoughts?

links:
https://www.google.com/maps/place/10100005+Thousand+Oaks+Dr/@30.2107612,-81.381784,17z/data=!3m1!4b1!4m2!3m1!1s0x88e437b298499921:0xbf10cbfa2e69c84a

http://nominatim.openstreetmap.org/search?q=10100005%20Thousand%20oaks%20drive,%20st%20johns,%20florida&format=xml&addressdetails=1

EDIT:
if the housenumber is > 100000, should i just drop it?


texts: Code to merge files in subdirectories not producing expected result using ArcPy

texts:
The short python code below is intended to merge a series of files (GIS files) which are contained in a series of subfolders.

import arcpy
import sys
import os

PointsMerged = r"C:\GIS\Test_Workspace\MergeOutput\MergedPoints"    ## Provide name and path of the merged feature class

pointslist = []

if __name__ == "__main__":
    try:
        SrcPath = r"C:\GIS\Test_Workspace"  ## Provide the path for data with subfolder here
        for root, dirs, files in os.walk(SrcPath, topdown=True):
            for filename in files:

                # check if 'Test' name exists in shapefile name
                if filename.find("Test") == 0:
                        print os.path.join(root, filename)
                        points = str(os.path.join(root, filename))
                        pointslist.append(points)

        arcpy.Merge_management(pointslist, PointsMerged)

    except Exception, ErrorDesc:
        #If an error set output boolean parameter "Error" to True.
        arcpy.AddError(str(ErrorDesc))
        row = None
        rows = None

Below is the result of running the script. As far as I can tell the script runs up to the print function, resulting in a list of all files found in the specificied workspace (directory).

C:\GIS\Test_Workspace\Test_Points.dbf
C:\GIS\Test_Workspace\Test_Points.prj
C:\GIS\Test_Workspace\Test_Points.sbn
C:\GIS\Test_Workspace\Test_Points.sbx
C:\GIS\Test_Workspace\Test_Points.shp
C:\GIS\Test_Workspace\Test_Points.shp.xml
C:\GIS\Test_Workspace\Test_Points.shx
C:\GIS\Test_Workspace\Test Sub\Test_PointsCopy.dbf
C:\GIS\Test_Workspace\Test Sub\Test_PointsCopy.prj
C:\GIS\Test_Workspace\Test Sub\Test_PointsCopy.sbn
C:\GIS\Test_Workspace\Test Sub\Test_PointsCopy.sbx
C:\GIS\Test_Workspace\Test Sub\Test_PointsCopy.shp
C:\GIS\Test_Workspace\Test Sub\Test_PointsCopy.shp.xml
C:\GIS\Test_Workspace\Test Sub\Test_PointsCopy.shx
C:\GIS\Test_Workspace\Test Sub\Test_Points_2.dbf
C:\GIS\Test_Workspace\Test Sub\Test_Points_2.sbn
C:\GIS\Test_Workspace\Test Sub\Test_Points_2.sbx
C:\GIS\Test_Workspace\Test Sub\Test_Points_2.shp
C:\GIS\Test_Workspace\Test Sub\Test_Points_2.shp.xml
C:\GIS\Test_Workspace\Test Sub\Test_Points_2.shx

Can anyone see why the merge may be failing?


texts: Blown out TIFF image after merge in QGIS?

texts:
I'm attempting to merge four GeoTIFF images in QGIS for the first time and am getting unexpected results.

Navigating to Raster --> Miscellaneous --> Merge..., I set up the merge as follows:

Once the merge is complete, I see the following:

The first surprise is seeing the difference in the color map for the merged image versus the original components. Any idea how that is controlled?

And finally when I go to load the resulting merged image, I see the following:

There are visible hints of structure in the resulting image but clearly this isn't the anticipated result.

I'm running QGIS 3.6.1 on the Mac and am totally new to this system.


texts: Storing spreadsheets and .mxd inside .gdb folder?

texts:
To set the stage. When you create a file Geodatabase in Arc, it then creates a .gdb folder in your connected folder. My supervisor has asked that once that folder is created, to move all documents (spreadsheets and .mxd) into that folder. He then likes it zipped together for storage.

But when I go to open the .mxd, which is now stored in the Geodatabase folder, I run into a lot of errors.

Is this practice suggested? Common? I’ve always just kept the file Geodatabase folder separate from my spreadsheets and .mxds. I just house everything in one new folder.


texts: Open marker popup show when chosen from list in Leaflet

texts:
When I choose a spot from list it zooms in to it but it doesn't open/popup with label/text. Any one knows? suggestions??
This is my code;
            // - SEARCH ENGINE - //

var clusterSpots = L.markerClusterGroup();
    // - Variable for search source(kitespots) - //
var searchSpots = L.geoJson(kitespots, {
    onEachFeature: function(feature, layer) {
        var popup = '';

        if (feature.properties.name) {
            popup += "
 "+feature.properties.name + "
"
            + "Wind Direction: " + feature.properties.windDirection;
        }
        layer.bindPopup(popup);
    }
});
    // - Create search engine and place it on the map - //
var selector = L.control({
    position: 'topright',
    opacity: 0.8,
    size: 10
});
selector.onAdd = function(map) {
    var div = L.DomUtil.create('div', 'list-group-item');
    div.innerHTML = '<select id = "selectSpot"><option value = "init">KITESPOTS</option></select>';
    return div;
};
selector.addTo(map);

    // - Function to browse and choose spots - //
searchSpots.eachLayer(function(layer) {
    var spotChoice = document.createElement("option");
    spotChoice.innerHTML = layer.feature.properties.name;
    spotChoice.value = layer._leaflet_id;
    L.DomUtil.get("selectSpot").appendChild(spotChoice);
});
    // - The selectSpot variable for the DomEvent listener. - //
var selectSpot = L.DomUtil.get("selectSpot");
    // - Select kitespot on click - //
L.DomEvent.addListener(selectSpot, 'click', function(e) {
    L.DomEvent.stopPropagation(e);
});
    // - ChangeHandler zooms in on choosen spot with popup.""
L.DomEvent.addListener(selectSpot, 'change', changeHandler);
function changeHandler(e) {
    var selected = searchSpots.getLayer(e.target.value);
        clusterSpots.zoomToShowLayer(selected, function() {
            selected;

        })
    }
clusterSpots.addLayer(searchSpots);
 map.addLayer(clusterSpots);


texts: Downloading WATCH Data: http response code 500

texts:
I am not a professional and doing some qgis tutorials on SUEWS, WUDAPT and WATCH. I don't know if I am allowed to post links so: The tutorial is from the UMEP website.

Now I am stuck at downloading meteorological data, because I get the Error:

  Data download not completed: Error connecting to server. Got HTTP response code 500

I am able to open WATCH, thats not the problem, because I installed pandas and I was able to use the Spatial downloader for population density. It's not like I can't download anything...but now I do need the meteorological data input to go on with SUEWS.

Any ideas?


texts: Automatically split line at intersection of nearby shapes/zones

texts:
I have a large dataset in QGIS with roads (blue line in picture below) and 3 type of zones (mostly rectangular areas, red and green shape in picture below). My task is to spilt to road into segments when there is an intersection between the zones nearby (see picture, yellow line). The problem is, that the zones do not touch the road.

I tried to go at this by creating buffers around the zones that are large enough so that they meet/touch the road and then cut at overlapping segments. The problem is, that the buffers of the zones also overlap. Therefore more segments than desired are created. These can be joined of course but because of the buffers, the resulting segments never intersect at the desired location (which is of utmost importance).

Does anyone have an idea how to solve this task?


texts: Updating many attributes at once in ArcGIS Field Calculator?

texts:
I need to update a dozen of attributes to x for all features that have a value of y in an other attribute.

Is there a way to update more than one attribute at once in field calculator?


texts: How to use -where SQL in an ogr2ogr loop in GDAL/OGR (bash)?

texts:
I'm using the following code:

while read line; do
for att in $line; do
ogr2ogr -where "newcode='$att'" -f "ESRI Shapefile" $OUTPUT/$att.shp $INDATA
done
done < $SCRIPT/newcodes.txt

The text file is being read correctly as shapefiles named after all names in the textfile list are being created. However, the shapefiles are empty (no attribute table or polygons). The ogr2ogr line of code works outside of the loop on a single feature within the shapefile. The newcodes.txt contains 3-5 letter codes e.g. aaa, gbe.

I think the problem is getting bash to treat $att as text to search for in the attribute table of the shapefile within the -where switch.

Any help much appreciated.

Update:

The shapefile has 15 columns in the table, and 6506 rows/features.

The 'newcode' field which I'am trying to read with the -where switch was joined to the table. I have tried using the loop with a pre-existing field and it still produced empty shapefiles.

Update 2:

After a bit more interrogation, I've noticed that the shapefiles are being produced with a space after their name. E.g. 'aaa .shp' rather than 'aaa.shp'. This probably means that the $att variable is being read with a space also, and therefore not matching anything in the attribute table. I have checked the text file, and there are no spaces in there. Still unsure how to fix.

e.g.
cdg
cdh
cdi
cej
cea
eig
fjj
fja
fjf


texts: How to use CQL_FILTER as URL encoded parameter to compare a field containing numbers

texts:
I want to apply the CQL_FILTER parameter as an URL parameter in order to filter a field containing numbers (zip codes) starting with 79 (using 79% Wildcard) for instance.

So I'm using this CQL_FILTER:

&CQL_FILTER%3DZIP%20like%20%2779%25%27 (url-encoded)
&CQL_FILTER=ZIP like '79%' (url-decoded)

It seems that my CQL_Filter is not working since I get no results. I don't get any error but I also don't get the corresponding features starting with 79 zipcode.

Is the like operator in CQL_Filters applicable to numbers?


texts: Mercator map coordinates transformation formula

texts:
I have a third-party application with a city map of size 131072x131072.

There are data on this map which contains x and y coordinates. I want to transform these coordinates to latitude and longitude. I know this map is some sort of Mercator projection but I don't know what exactly.

There is the distance coefficient:

k=0.75990358305

I've tried formulas from wiki (https://en.wikipedia.org/wiki/Mercator_projection) but with no success.

Can someone help to find out transformation formula?

Here are few coordinates which I know:

(lat,lng) - (x,y)
(50.370186,30.458433) - (53655,86502)
(50.404793,30.613958) - (68149,81437)
(50.458076,30.604239) - (67240,73634)
(50.488285,30.526358) - (59988,69221)
(50.9333,29.903046) - (1920,3775)
(50.114937,31.281656) - (130375,123690)


texts: How to run "sdetable register" command in SQL Server?

texts:
I was planning to run "sdetable register" command to register a particular field as OID for an non-spatial table already created in a SDE database. I am with SQL Server 2008 R2.

I tried to run the command
USE [{database}]
GO
sdetable -o register -t {table} -c {column} -C {database} -u {user} -p {password}
from on a query window in SQL Server Management Studio.

But it logged "Incorrect syntax near 'o'." error.

Is there anything wrong with what I was doing?


texts: I want to export from wikimapia into kml all sugar refinery category points

texts: I want to select a country in wikimapia and then export all sugar refinery points into a kml file. Also how do I find the category id for sugar refinery?


texts: How to split a line in segments of a given length in cartodb?

texts:
How can I split a (poly)line in segments of a given length in cartodb?

I want to be able to visualize segments of street, each 4m long, following the road curve.
One way would have been to trace the road side with a line and then cut it in chunks of 4m.

I cannot use a simple "grid", as the 4m have to be tangent to the path, and I did not find a way to create points or lines with a given distance of each other.

It seems possible in QGIS and OpenJump (How to split a line every x meters?) but I cannot find a way to do it in cartodb.

Any suggestion?


texts: Got “ImportError: No module named osgeo” in gdal_calc but not in main script

texts:
so this question is similar to : here
I am having the same issue, whereby the main script (in a virtual env using Anaconda) recognises osgeo and gdal, however the gdal_calc script does not.
The proposed solution is to edit the system variables to where osgeo is located; however, this solution does not work for me.
This is my script:
  """
Created on Thu May  6 09:51:24 2021

@author: Matthew Farnham
"""
import os
import gdal
import sys
# sys.path.append(r'C:\Users\Matthew Farnham\AppData\Local\ESRI\conda\pkgs\gdal-3.0.4-py36h7bdd3bd_9\Lib\site-packages\osgeo')

data_dir = r'E:\Previsico\PERM\Matthew\Previsico\7_Model_Workings\Scotland_LiDAR_All_WithCode\Scotland_LiDAR\tif_merge2'
os.chdir(data_dir)
print(gdal)

gdal_calc_path = r'C:\OSGeo4W64\apps\Python37\Scripts\gdal_calc.py'

input_raster_a="Scotland_Lidar_nc.tif"
input_raster_b = "Scotland_Lidar_nh.tif"
calc_expr = 'A+B'
nodata = '0'
output = data_dir
gdal_calc_str = '{0} -A {1} -B {2} --outfile={3} --calc={4} --NoDataValue={5}'
gdal_calc_process = gdal_calc_str.format(gdal_calc_path, input_raster_a, input_raster_b, output, calc_expr, nodata)

os.system('conda activate gdal')
os.system(gdal_calc_process)

This is the error:

Traceback (most recent call last):   File
"C:\OSGeo4W64\apps\Python37\Scripts\gdal_calc.py", line 60, in

import gdal ImportError: No module named gdal Traceback (most recent call last):   File
"C:\OSGeo4W64\apps\Python37\Scripts\gdal_calc.py", line 60, in

from osgeo import gdal ImportError: No module named osgeo

I have located the gdal_calc script and attempted to make sure it recognises osgeo folder (where it could theoretically import gdal) like so:
data_dir = r'C:\Users\Matthew Farnham\AppData\Local\Programs\Python\Python2.7\Lib\site-packages\osgeo'

os.chdir(data_dir)
retval = os.getcwd()
print("Current working directory %s"% retval)

To clarify, within the "osgeo" folder, there are all the scripts that the initial proposed solution said there should be. I have also edited the environment variables with this to no avail and placed it in my code (previously) to no avail.

Has anyone else faced this issue? How have you solved it?
Kind regards,
Matthew


texts: OpenLayers - Get features inside a polygon

texts:
In my OpenLayers map I allow users to draw an ad-hoc polygon vector. Then I need to get all the features from a WFS vector layer that fall within the ad-hoc polygon.

Here is the code I have that allows the user to draw the ad-hoc polygon in the map. This code works fine:

function buildIt() {
//CREATE THE NEW VECTOR
var polygonLayer = new OpenLayers.Layer.Vector("Poly Layer");
//ADD IT TO THE MAP
map.addLayer(polygonLayer);

//CREATE A DRAWFEATURE CONTROL
var polyedit = new OpenLayers.Control.DrawFeature(
polygonLayer,//POINT IT AT THE USER DEFINED POLYGON LAYER
OpenLayers.Handler.Polygon
);

// 'point' is one of the named callbacks specified by OpenLayers.Handler.Polygon
// and is called every time a point is added to the feature being drawn
polyedit.handler.callbacks.point = function (pt) {
    console.log(pt)
}
map.addControl(polyedit);//ADD THE DRAWFEATURE CONTROL TO THE MAP
polyedit.activate();//ACTIVATE THE DRAWFEATURE CONTROL

}

After this I am clueless. How can I get all the features that fall within the user defined polygon? Specifically, I need to get the attributes from each WFS feature (sometimes points, sometimes polygons) that fall within the user drawn ad-hoc polygon.

Any suggestions would be appreciated! Thanks.


texts: WMS GetFeatureInfo "TypeError: wms_layer.getFeatureInfoUrl is not a function"

texts:
I am trying to trigger WMS GetFeatureInfo requests on click.
Like this example: https://openlayers.org/en/latest/examples/getfeatureinfo-tile.html but on a popup.

As of now, I have the popup working and only have to display the attributes inside popup-content element, but I am unable to make the click function work;

Here is the code:

   map.on('singleclick', function(evt) {
      document.getElementById('popup-content').innerHTML = '';
      var viewResolution = map.getView().getResolution();
      var url = wms_layer.getFeatureInfoUrl(
        evt.coordinate, viewResolution, 'EPSG:3857',
        {'INFO_FORMAT': 'text/html'});
      if (url) {
        fetch(url)
          .then(function (response) { return response.text(); })
          .then(function (html) {
            document.getElementById('popup-content').innerHTML = html;
          });
      }
    });

ERROR: Uncaught TypeError: wms_layer.getFeatureInfoUrl is not a function.

EDIT:
Okay, so I added the .getSource() to my code, which gave me the correct request, BUT it gave me the "Cross-Origin Read Blocking (CORB) blocked cross-origin response", which after some reading, I tried to fix by changing Apache port.

Well it ruined everything including all the GetMap requests, so I changed it back to same port, but it still won't load anything...
Any idea why?

Even thought ports are now the same as before and it should go back to (CORB) error...


texts: Getting all attributes of all points within polygon in ArcMap?

texts:
I have a map with location of schools within districts. I was wondering if I can extract all fields of each data point within a polygon and how to go about doing it in ArcMap 10.5?

I produced this map by overlaying a district boundary map (shapefile) and a csv file of school attributes including XY coordinates of the schools. The file includes more than 60 fields for each school, including the XY coordinates.

What I want is a list of schools per district, including the 60 fields. For instance - schools_within_district_A.csv and schools_within_districtB.csv, and so on. If there are 20 schools within one district (one polygon), I would like to obtain the fields for the district. So basically this is equivalent to subsetting the overlayed data by one district.

I tried looking into spatial join, but this seems to find the sum of attributes per polygon. What I want is not the sum but all of the individual fields for each school for a selected district.

For each data point, I have more than 60 fields, including categorical and dummy variables:

My boundary shapefile looks like this, where name is district name:

And my desired excel output would look like this, for a selected district, assuming that the district has 7 schools within:


texts: Unable to add attachment to ArcGIS Online feature service using Python and REST API

texts:
I am attempting to use Python to add attachments to an ArcGIS Online hosted feature service, but I'm getting an 'Unable to add attachment to the feature.' message when I run the following code:

import requests

objectId = '158'
attachUrl = "http://services.arcgis.com/abcdefg/FeatureServer/0/%s/addAttachment" %objectId
files = {'file': open('myAttachment.pdf', 'rb')}
params = { "token": token, "f": "json", "files": files}

r = requests.post(attachUrl, params)
r.text

The result:

u'{"error":{"code":400,"message":"","details":["Unable to add attachment to the feature."]}}'

I have verfied that I'm using a valud url,  objectID, and token.

I believe the issue is with the syntax I'm using to make the multipart post request, but I'm new to requests.py and to programmatic file uploads.


texts: Embeds with iFrames and Scripts in CartoDB InfoWindows

texts:
How is it possible to embed content — like YouTube-Videos, Twitter-Tweets, Facebook-Posts, Instagram-Photos or any other kind of embeds — into a InfoWindow in CartoDB?

In my Dataset there is a row with the embed-code (iframe, script etc.) and I included the field into the infowindow via the CartoDB-Wizard … I know CartoDB blocks every script etc. … but there should be something like a «sanitizeTemplate» through CartoDB.js (as this was posted from someone in another question) — but I'm not able to get this working properly … can someone help me please? … with a detailed/full example?


texts:
I´m working on a suitability analysis for which I´m doing a sensitivity analysis.

When I modify the weights for this analysis I have values with decimals, so I can´t use "weighted overlay" tool.

Can I use "weighted sum" tool (considering that the weights I use sum 1)?


texts: Losing properties while multiplying or dividing ImageCollection Google Earth Engine

texts:
I've just started working with Google Earth Engine and, while running some tests, I stumbled into this problem. If you initialize an imageCollection and print it, the console gives you something like this:

ImageCollection (200 elements)
type: ImageCollection
bands: []
features: List (200 elements)
  0: Image LANDSAT/LT05/C01/T1_SR/LT05_191028_20080526 (6 bands)
   type: Image
   id: LANDSAT/LT05/C01/T1_SR/LT05_191028_20080526
   version: 1521654404763968
   bands: List (6 elements)
   properties: Object (22 properties)
  1: Image LANDSAT/LT05/C01/T1_SR/LT05_191028_20080611 (6 bands)
  2: Image LANDSAT/LT05/C01/T1_SR/LT05_191028_20080627 (6 bands)
  3: Image LANDSAT/LT05/C01/T1_SR/LT05_191028_20080713 (6 bands)
  4: Image LANDSAT/LT05/C01/T1_SR/LT05_191028_20080729 (6 bands)
  .
  .

and so on and so forth. However, if I try to map a .multiply() or a .divide() function over the collection and print it, I lose all informations on the images. Let's say I want to rescale the collection pixel values, my code will be:

var scaledCollection = collection.map(
    function(img) {
      return img.multiply(0.0001);
    });

print(scaledCollection);

The output in the console becomes:

ImageCollection (200 elements)
type: ImageCollection
bands: []
features: List (200 elements)
  0: Image (6 bands)
   type: Image
   bands: List (6 elements)
   properties: Object (19 properties)
  1: Image (6 bands)
  2: Image (6 bands)
  3: Image (6 bands)
  4: Image (6 bands)
  .
  .

Among other things, the properties lost are system:asset_size, system:footprint and system:time_start. Since the object structure remains the same (ImageCollection), why do some properties disappear if the only thing that I'm doing is iterate a map algebra operation over a collection?

Thanks in advance.


texts:
Working with ArcGIS (v10.2.2) Network Analyst and reformating the road network with a hierarchy evaluator and receive the following error message:

  The field evaluator result statement has multiple lines. Use the
  prelogic to specify multiple.

In the Field Evaluators dialog I have entered:

Pre-Logic Script Code:

Select Case [EVG_FC]
     Case 1, 2: level = 1
     Case 3, 4: level = 2
     Case 5, 6: level = 3
     Case Else: level = 2
End Select

Value =  level

Any idea why or what the error message is telling me?


texts:
I have a small script that I'm using to generate GeoJSON data from a data format not currently supported by GIS software.

I would like to validate the output, but when I use ogr2ogr to read it, it doesn't give me any helpful information about what aspects, lines, or characters contained invalid data.

Is there a decent GeoJSON validator somewhere, or a good method of validating GeoJSON data with OGR?

EDIT: I am not looking for JSON validators or the GeoJSON spec. I've seen and used both to get to this point, but OGR still returns an error.

Thanks!


texts: Converting road number and mile post into coordinates?

texts: I have a bunch of mile post and road number data and would like to turn it into lat/long coordinates very easily.


texts: Accessing organisational webmap using downloaded Basic Viewer of ArcGIS Online?

texts:
I have downloaded the Basic Viewer of ArcGIS Online (AGOL) to my web- and ArcGIS Server within my organisation. Now I want that copied basicviewer to access a webmap on agol that I made accessible to a few internal groups. The webmap is not published to the general public. I notice that to logon (in person, with a browser) to the org. data of my company I need to logon to a specific URL, not the general AGOL url.

What do I need to do to fill in the index.html file of this basic viewer in order to access this webmap ?

I cannot find a place in the javascript to add usernames and passwords, or code to ask it from me. And I do not understand what a proxy is in the AGOL context. I have not found a relevant blog on organisational versus public use of AGOL (these blogs are often about old or other viewer versions, with other coding styles and technologies). I seek an example for an Organisation-internal situation.

I tested my copied basic viewer with a generally published web ID on AGOL, and that works. But I want to use my own (organisation-internal) AGOL webmaps of course.

This is a snippet from index.html where I think I need to fill in the connection details.

    dojo.ready(function(){
    i18n = dojo.i18n.getLocalization("esriTemplate","template");
    var  defaults = {
    //The ID for the map from ArcGIS.com
    webmap: "e7bd1f2f1eab47f2856c108dcf25f56b",
    //Modify this to point to your sharing service URL if you are using the portal
    sharingurl: "http://stedin.maps.arcgis.com",//for example: "http://www.arcgis.com",
    //The id for the web mapping application item that contains configuration info - in most
    ////When editing you need to specify a proxyurl (see below) if the service is on a different domain
    //Specify a proxy url if you will be editing, using the elevation profile or have secure services or web maps that are not shared with everyone.
    proxyurl: "",
    //cases this will be null.
    appid: "",


texts: Changing coordinate system of QGIS layer to projection of Google Earth?

texts:
How do I change the coordinate value of a vector layer (13293061,-572595) to 119.413,-5.13677 (vector data & Google Earth do not match)?

If I output my data using Google Earth as background, the vector data does not match with the underlying google layer.

Printing the result to PDF also has this same problem.


texts: Polygons missing from GetMap when stroke symbolizer is absent from SLD

texts:
We have an interesting scenario with one of our layers being served via GeoServer 2.2.3. The data is stored in a PostGIS DB. Certain GetMap requests were returning empty tiles, but only at certain zoom levels. In the end, we discovered a work-around that is more confusing than enlightening. The original SLD contained some simple rules, each of which had a filter and a symbolizer. The symbolizer simply defined a fill color. By modifying the symbolizer to include a stroke value as well as the fill color the issue was resolved. At no point during debugging this did the GeoServer or Tomcat logs show any kind of error. My question is, WHY!!!

Here is a tile request using the new SLD that returns what one would expect:
http://mapservices.nrel.gov/wms?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=re_atlas%3Aus_solar_all_120512&STYLES=reatlas_us_tilt_total_old&FORMAT=image%2Fpng&TRANSPARENT=true&HEIGHT=256&WIDTH=256&SRS=EPSG%3A3857&BBOX=-15028131.257091932,5009377.085697316,-10018754.171394622,10018754.171394628

And here is the same tile request with the original stroke-less SLD specified... notice that the corner of Washington state is missing from the response to this one:
http://mapservices.nrel.gov/wms?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=re_atlas%3Aus_solar_all_120512&STYLES=reatlas_us_tilt_total&FORMAT=image%2Fpng&TRANSPARENT=true&HEIGHT=256&WIDTH=256&SRS=EPSG%3A3857&BBOX=-15028131.257091932,5009377.085697316,-10018754.171394622,10018754.171394628

Here are some additional tidbits:

All GetMap requests in the layer's native 4326 was always succeeding
perfectly, regardless of zoom
The data is a simple grid covering the US, incl. Alaska and Hawaii
Zoom levels 0,1,2 were at fault, all closer zooms were fine. Of course the GetMap request doesn't know anything about zoom levels, but this essentially expresses the fact that the tile was being generated for a bbox of a greater extent.
The missing tiles were basically the upper half of the continental US. Alaska and Hawaii always showed up. When zoomed all the way out to a global extent, the entire continental US was blank. Again Alaska and Hawaii just fine.
Even a super simple SLD (no filters, just a single symbolizer to paint all polygons) would exhibit the same strange behavior until a stroke component is added in

Any thoughts?


texts: Map all time steps of a NetCDF file in R using a loop

texts:
I have a NetCDF containing temperature values over a certain region for 2011, with 1-hour intervals, so that means that I have 8760 maps. What I want to do, is plot all 8760 maps using one color palette, and also on every map plot the exact day and time on the map, because I want to show the evolution of temperature over a region, in a year. How can I do this using a for loop in R?

The ncdump -h of my .nc files gives the following result:

netcdf temperature {
dimensions:
    rlon = 169 ;
    rlat = 155 ;
    height = 1 ;
    time = UNLIMITED ; // (8760 currently)
variables:
    double rlon(rlon) ;
            rlon:standard_name = "grid_longitude" ;
            rlon:long_name = "longitude in rotated pole grid" ;
            rlon:units = "degrees" ;
            rlon:axis = "X" ;
    double rlat(rlat) ;
            rlat:standard_name = "grid_latitude" ;
            rlat:long_name = "latitude in rotated pole grid" ;
            rlat:units = "degrees" ;
            rlat:axis = "Y" ;
    char rotated_pole ;
            rotated_pole:grid_mapping_name =     "rotated_latitude_longitude" ;
            rotated_pole:grid_north_pole_latitude = 39.25 ;
            rotated_pole:grid_north_pole_longitude = -162. ;
    double height(height) ;
            height:standard_name = "height" ;
            height:long_name = "height" ;
            height:units = "m" ;
            height:positive = "up" ;
            height:axis = "Z" ;
    double time(time) ;
            time:standard_name = "time" ;
            time:units = "hours since 2011-01-01 00:00:00" ;
            time:calendar = "proleptic_gregorian" ;
    float var11(time, height, rlat, rlon) ;
            var11:table = 2 ;
            var11:grid_mapping = "rotated_pole" ;


texts:
I have got a toolbox full of models to run from one script.

Is there any code that calculates the location of script from which I can get the path to my toolbox?

Script and models are imported if that matters. Toolbox is going to be used on a few computers and running a script is more nice way than searching for models.


texts: Categorized symbology with transparency including raster basemap?

texts:
I'd like to include the background map in legend symbols, rendered under transparent fill.

For matters of better representation and easier orientation, it would be helpful if the symbols in the legend (right part in image below) had the underlying layer (the background map, cf. left part of the image) rendered below the current legend symbol.

If need be, I can just make a small cut-out of the background map with snipping tool or what have you, save that as a .png and somehow incorporate that in the legend symbol. It doesn't matter, if it's the same piece of background for every legend item symbol.

PS: I found out how to make the legend symbols have transparency, so that's not a problem any more.


texts: I'm trying to work on a project which is based on navigation of a robot which is equipped with a web camera and the robot will have a ARM based board like Raspberry Pi or BeagleBone or BeagleBoard (whichever is good). What sort of line detection algorithm can be used so that it can navigate pathways without collisions or bump into obstruction. Or is a map needed for navigation irrespective of whatever robot is being used. Please answer this as i'm new to robotics as well as GIS. I'm doing this project for my undergrad finals. Also i would like to learn a bit about UAVs used for indoor navigation as done by MIT using localization Youtube video here


texts: Get coordinates from Folium's feature LatLngPopup in Python

texts:
I am looking for a way to get coordinates from a marker/popup in Folium.
I want to use the coordinates for further calculations.
I know, that Folium is more for visualizing data and maps than getting information back.
I found an interesting post where the coordinates were sent back via href (https://gis.stackexchange.com/a/353035/168662), but this does not work for me. I am displaying a folium map in a PyQt5 Window.
Here is a simple code to display the coordinates when clicking on a map with Jupyter Notebook:
import folium

m = folium.Map()
popup1 = folium.LatLngPopup()

m.add_child(popup1)
m

To get the coordinates, I want something like:
print("Latitude of Popup: ", popup1.getLat() )


texts: How to fix this Heatmap script from failing SQL expression (integer/string?) using arcpy (ArcMap 10.5)?

texts:
I have a heatmap script that will eventually print 10 PDF maps. At the moment it is failing at the SQL expression in the Make Feature Layer right before Kernel Density Raster creation because the column datatype is string. I'm having trouble changing it to an integer in the loop.

  Traceback (most recent call last):   File "\coacd.org\dfs\SWS\Code
  Enforcement\ACD Admin Operations\GIS\Operations\Council District
  Analysis Reporting\Auto_HeatMap_WIP\test.py", line 58, in
      int(stringA) ValueError: invalid literal for int() with base 10: '%d'

Here is the part of the script that is failing:

arcpy.CheckOutExtension('Spatial')
#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument(workspace+"\\working_environment.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] # address location data frame and turn on select layers
df.zoomToSelectedFeatures()

arcpy.env.extent = df.extent #set extent to current one
arcpy.env.overwriteOutput = True #overwrite existing files

my_point_features = autoLayerGDB +"\\coded_xy_points_FIPS4203"
scratch_output = workspace+"scratch"

#Select each district via script

   for i in range(1, 11):
    stringA = '%d'
    int(stringA)
    my_clause = 'COUNCILDISTRICT =' + stringA % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)

I also tried this:

for i in range(1, 11):
    my_clause = 'COUNCILDISTRICT = "%d"' % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)

But recieved this error message:

  raceback (most recent call last):   File "\coacd.org\dfs\SWS\Code
  Enforcement\ACD Admin Operations\GIS\Operations\Council District
  Analysis Reporting\Auto_HeatMap_WIP\test.py", line 59, in
      arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)   File "C:\Program Files
  (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 6997, in
  MakeFeatureLayer
      raise e arcgisscripting.ExecuteError: ERROR 000358: Invalid expression COUNCILDISTRICT = "1" Failed to execute (MakeFeatureLayer).

I found gis.stackexchange.com/questions/137517/… and docs.microsoft.com/en-us/sql/odbc/microsoft/…. Based on this information I changed the schema file to interpret the COUNCILDISTRICT Collumn as "short" instead of "text" and it worked


texts: How to symbolize a layer on multiple fields?

texts:
I'm working in ArcGIS 10.

I have a layer that contains 8 attributes and each one of these fields can be categorized into  3 sub categories. I need to display them on a single map.

Update

I tried to add the same layer multiple times (8) and then symbolized each category. when I display the results are good but symbols now superimpose on one another, and hence the categories cannot be differentiated.

The following is an image that contains a sample of what I am working on. "Area" corresponds to the point referring the region and 1A,1B and 1C are the fields of each feature. Each one of them (1A,1B,1C...,1H) is further categorized into 3 categories as shown in the table.

I have added same file multiple times to get all the variables displayed on a single map, which are being displayed as well but they tend to super impose over one another. I want all the symbols to be shown separately.

Can anyone provide any ideas on how to do this?