texts: Sorting strings separated by commas within field using Python Parser of ArcGIS Field Calculator?

texts:
In ArcGIS 10.4.1, I am using the Python Parser of the Field Calculator. My Python knowledge is limited.

I would like to recalculate a field of strings that are separated by commas so that they are ordered numerically. Say I have "3, 2, 6, 4, 5, 1" and I would like it to be "1, 2, 3, 4, 5, 6".

Would it be possible to have a reverse sort?

I would like to apply the sorted values to new field, but I could also live with the sorted values in the original field.


texts: How to create a simple drop down box in OpenLayers?

texts:
I am trying to place a simple drop down box above the OpenStreetMap map. Can some one guide me how to achieve this... I know we need to make use of OpenLayers...

I tried to create a button with below code:

var button1= new OpenLayers.Control.Button({
         title: "First Button",
         text: "Button1",
         trigger:addComp,
      });
panel.addControls([button1]);

It worked fine, but not how can I add a drop down box with values of any simple array?


texts: What does this mean is that my agisoft PhotoScan does not understand Unsupported JPEG data precision 12 error?

texts:
I want to see if anyone in here know what the problem is. When I load this imagery to my ERDAS it was able to read it and open it...

However, my agisoft PhotoScan would not load it since there is something it does not recognized .

Could anyone tell me what the problem is ?

Would anyone out here tell me what does this means ? When I add 4 photos to PhotoScan and I see that they are "No Image"

2018-09-28 13:48:03 libtiff error: Unsupported JPEG data precision 12;

2018-09-28 13:48:03 libtiff error: Unsupported JPEG data precision 12;

2018-09-28 13:48:03 libtiff error: Unsupported JPEG data precision 12;

2018-09-28 13:48:03 libtiff error: Unsupported JPEG data precision 12;

2018-09-28 13:48:07 libtiff error: Unsupported JPEG data precision 12;

2018-09-28 13:48:07 Error: Can't load image: C:/Bov_files/1938/BOV_11/19380724_BOV_11_104.tif

I want to know so i can understand and see if I could fix it ? My understand is that libtiff came from somewhere else ?

I will send them the imagery for them to fix this issue.


texts:
Road Graph Qgis plugin is missing in the official repository, at least, I am not be able to find it.

Is it replaced for Network tool in Vector menu? Is there another easy way to have the shortest path or Service Area? I know there is PgRouting, but I can not use it because I need the tool for a beginner training and I think PgRouting is too difficult in this level of training.

Edit:

I am afraid the plugin is not available in my computer, nor in others computers I have tasted.

I have looked for it in the project official repository and the plugin is not shown.

Could anybody answer why this is happening?


texts:
I try this code:

cd osm2pgrouting
file http://.....com/veriler/andorra.osm conf mapconfig.xml dbname postgres username postgres

dbname, username and web address are correct.
But it gives an error.


texts:
I found a new problem after installing ArcMap 10.3.1 in my laptop. When i clicked Go To XY, the toolbar (below) is not shown. When i clicked Go to XY, nothing happened.

Anyone knows how to solve my problem?


texts: Web system for adding points and related information to a map

texts:
I have been asked to find/make a web-based system whereby members of the public can add a point to a map and then enter some details about it.

I could make this myself but as it's such a simple system I'm sure there must be an existing solution already out there.


texts: PackageLayer_management failing within script, needs to run outside of an ArcMap session

texts:
I'm automating a workflow that requires outputting a layer package, it throws the general ERROR 999999 when executing and breaks.  It does, however, generate a folder in the correct directory, with the correct name which contains the raw data, but seems to fail when outputting the layer package itself.  A snippet of my current code is as follows:

# Generates a feature layer based on previously set args
arcpy.MakeFeatureLayer_management(outShp, outName, "", "", "")

# Dumby mxd for the output layer to reside
mxd = arcpy.mapping.MapDocument("C:\\TEMP\\parser.mxd")
dframe = arcpy.mapping.ListDataFrames(mxd)[0]
layer = arcpy.mapping.Layer(outName)
arcpy.mapping.AddLayer(dframe, layer, "AUTO_ARRANGE")
lyrLst = arcpy.mapping.ListLayers(mxd, outName, dframe)[0]
layer.description = outName

arcpy.PackageLayer_management(lyrLst, outLpk, "PRESERVE", "CONVERT_ARCSDE", "", "ALL", "ALL", "ALL", "", "Footprint", "Bounding")
mxd.save()

Not sure what the issue is, other than possible the tool might require somehow 'Analyzing' the data, as it does in the hard coded tool?

I use ArcGIS Desktop 10.1.

Update: Tried using SaveToLayerFile to hard write the layer, and it throws the same error.


texts: Installing PostGIS after PostgreSQL Ubuntu 18.04

texts:
sudo apt-get install postgresql-9.5-postgis-2.5

returns a series of errors:

The following packages have unmet dependencies:
postgresql-9.5-postgis-2.5 :
  Depends: libgdal1i (>= 1.9.0) but it is not installable
  Depends: libjson-c2 (>= 0.11) but it is not installable
  Depends: liblwgeom-2.5-0 (>= 2.5.0~beta1) but it is not going to be installed
  Depends: libproj9 (>= 4.9.0) but it is not installable
  Depends: libsfcgal1 (>= 1.2.0) but it is not installable

E: Unable to correct problems, you have held broken packages.

I had never encountered a not installable exception to date so I ma not sure of consequences of different possible actions... Attempting lower versions leads to the same result.  How can PostGIS get safely installed then?

Update

An attempt was also made, making a fresh installation of a Ubuntu 18.04 VM [following these instructions][1]

The source of the error was in adding the repository to sources.list

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt xenial-pgdg main" >> /etc/apt/sources.list'

which should be for 18.04

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt bionic-pgdg main" >> /etc/apt/sources.list'

[to butter things up even more, and attempt was made with  bioni-pgdg main  leading to its own set of errors]!


texts: Improving resource consumption of Profile Tool Plugin of QGIS

texts:
I'm trying to generate a profile along a track (bike trail) using the Profile Tool Plugin from QGIS, but it consumes more than 14GB's of RAM so it can't finish it's work.

DEM: 200m GeoTIFF
Profile-Line (the trail): 600 nodes, 300km length

Both are already generalized.

As you can see in the screenshot below, this task consumes more then 14GB's of RAM. I tried that on different PC's and operating systems.

I need an vector graphic (SVG) as output.
Is there an alternative to the Profile Tool or a workaround?


texts: Is there a method to prevent a getfeatureinfo event listener to listen on certain conditions?

texts:
I am working in OpenLayers 2, setting up a WMSFeatureinfo Object that has both 'beforegetfeatureinfo' and 'getfeatureinfo' event listeners. In the response I want to strip out all the WKT for the geometry and in order to do so I have to include in the "propertyName" vendorParams all the properties I want to filter (all apart from the geometry). This methods sometimes results in very long query strings that the server cannot handle getting a 502 response type.

Considered that I cannot change the server settings, I would like to count the query string length and in case this is longer that a certain number of characters exit the map init function and blocking the code execution, preventing the identify control to send the request.

I tried to put a try catch statement on the 'beforegetfeatureinfo' event listener but the request is sent anyway. Is there a method to exit the code and ignore the event listener before the request is sent?

identifyControl = new OpenLayers.Control.WMSGetFeatureInfo({
        url: dataurl,
        properties: getVisibleAttributes(),
        layers: getIdentifiableLayers(),
        queryVisible: false,
        format: new OpenLayers.Format.JSON,
        infoFormat: 'application/json',
        eventListeners: {
            'beforegetfeatureinfo': function (e) {
                identifyControl.layers = getIdentifiableLayers();
                identifyControl.url = dataurl + data.dataurlExt;
                this.vendorParams = {
                    STYLES: "",
                    PROPERTYNAME: this.formatPropertyNamesParameter()
                }
                try {
                    //here I check for the query string lenght
                    this.filterQueryString(this.vendorParams.PROPERTYNAME)
                }
                catch (err) {
                    // I would like to exit the code here but it does not happen
                    }
                }
            },
            'getfeatureinfo': function (e) {
                featuresCounter = 0;
                identifyLocation = map.getLonLatFromPixel(e.xy);
                //Filter here
                var finalResults = new Array();
                for (var i = 0; i < e.features.features.length; i++) {
                    var id = e.features.features[i].id;
                    var layer = id.substr(0, id.indexOf('.'));
                    //TODO: only request the attributes that are needed with GeoServer vendor parameter propertyName
                    var visibleAttributes = getVisibleLayerAttributes(layer);
                    var results = filterAttributes(visibleAttributes, e.features.features[i]);
                    if (results.length > 0) {
                        finalResults.push(results);
                    }
                }
                createPopupHTML(finalResults);
            },

    filterQueryString: function (queryString) {
        if (queryString.length > 705) {
            throw "The feature info request cannot be handled. Remove one or more layers and try again";
        }
    }
});


texts: Point Sampling tool Overlapping buffered points

texts:
I am trying to extract some sampling data... I have Yield data (blue), planting data (green), and Spreading data(red).

I left the yield data as a point since it is the most dense data I have. What I did was take the other data and use the fixed buffer tool to create points the size of the pass (30ft for planting, 90ft for spreading)

When I did the point sampling tool I only got the Yield data with two empty columns for product and spreading rate.

What is causing the lack of data? Could it be the overlapping data points for the planter and spreading data?


texts: What are these icons in the QGIS Swipe plugin tool?

texts:
Upon selecting a layer to swipe, these two icons appear, and they are clickable, but clicking them doesn't seem to change the swipe action or results.  Documentation doesn't mention these icons either.

http://pt.slideshare.net/LuizMotta3/mapswipetool-plugin


texts: send csv with polygon or line in gps data

texts:
I want to send a csv with a polygon or line to show it in cartoDB map but when I try to send data to the server I don´t know the exact way to send the info.
for polygon some think like this.
id,name,description,polygon
1,thename,a description, ((x,y),(x1,y1),(x2,y2))


texts: QGIS reprojecting .ecw file in EPSG:23032

texts: I opened the .ecw file with qgis but I found that the ortophoto is 340 mt northern and 150 mt eastern the topographic map. How can I move the ecw?


texts: How to install shp2pgsql-gui on Mac OSX Snow Leopard?

texts:
I am getting started with PostGIS. I am trying to understand how to install the plugin shp2pgsql-gui under Mac. Right now my 'Plugins' tab in pgAdminIII is blank...

Thanks!


texts: How do save the result of pyresample processing as GeoTIFF file？

texts:
To warp image to GeoTIFF using GCPs method, I used the pyresample package. As the result, I did not find any example to save this result as a GeoTIFF file.

from pyhdf.SD import SD, SDC
from pyresample import image, geometry,save_quicklook
file="C:/Users/TLQ/Desktop/11/MYD09.A2011093.0410.006.2015217030905.hdf"
f1 = SD(file, SDC.READ)
lat = f1.select('Latitude')
latitude = lat[:,:]
lon = f1.select('Longitude')
longitude = lon[:,:]
b1 = f1.select('BAND31')
AOP = b1[:,:]
swath_def = geometry.SwathDefinition(lons=longitude, lats=latitude)
swath_con = image.ImageContainerNearest(AOP, swath_def, radius_of_influence=10000)


texts:
I have a script exported from ModelBuilder for a tool that import CAD file to geodatabase.
When I run the code in a Python window in ArcMap it works just fine, and when I do using the model as well.
But when I import the script to a toolbox, the output comes out empty. However I can see the output dataset existing in the scratch gdb
and I do need it as a toolbox script so I can publish it as a geoprocessing service.

# Import arcpy module
import arcpy

# Script arguments
Input_CAD_Datasets = arcpy.GetParameterAsText(0)
if Input_CAD_Datasets == '#' or not Input_CAD_Datasets:
    Input_CAD_Datasets = "C:\\Users\\Metal\\Desktop\\stuff\\Sohar_port.dwg" # provide a default value if unspecified

Dataset = arcpy.GetParameterAsText(1)
if Dataset == '#' or not Dataset:
    Dataset = "qqwwe" # provide a default value if unspecified

output = arcpy.GetParameterAsText(2)
if output == '#' or not output:
    output = "%scratchGDB%\\qqwwe" # provide a default value if unspecified

# Local variables:
v_scratchGDB_ = "%scratchGDB%"

# Process: CAD to Geodatabase
arcpy.CADToGeodatabase_conversion(Input_CAD_Datasets, v_scratchGDB_, Dataset, "1000","")


texts: How to create a 500m Regular Grid for KML input area?

texts:
I am hoping to create a point grid over the city of Edmonton.  My workflow is:

Import a KML of Edmonton neighborhoods from here
Save the layer as a SHP
Delete the layer and load the SHP
Define the layer and project CRS as NAD 83 (HARN)
Use the Vector > Research Tool > Regular Points tool to generate a grid of points over the geometry with a spacing of 500m.
Save the output and load into the project.
The output is a single point to the NW of the neighbourhood polygons.

I have been around this several time and am at a loss.


texts: Which map projection maps y=m1*lat+b1, x=m2*long+b2?

texts:
I'm looking for a map of the US in this simple format. Then I can calibrate the simple mapping and do a report for our business by making a dynamic SVG file that places markers on that map.

Right now we are using Google Earth and a dynamically generated KML file, but the Google Earth imagery is too complex and the projection is wrong.


texts:
I currently use pgr_tsp and returns the list (apparently) correct. But I find no reference on how to get the lines that make up the optimal route. Is it possible that can help me?

I only need to finish creating the "optimal" route mode lines.

Use as a reference:
http://docs.pgrouting.org/2.0/es/src/tsp/doc/index.html#pgr-tsp


texts: Find Optimal Subset of Feature Layer Based on Spatial Criteria & Attributes

texts:
I'm using a Census tract shapefile with their corresponding attributes of interest within ArcMap 10.7.1.
My project goal is to identify the subset of tracts that share a line segment while:

maximizing the sum of unemployed people (attribute #1) AND
retaining an unemployment rate of less than 6.5 percent (attribute #2-this quotient will require the calculation of two other fields).

In the past, I've used tools to identify polygons that share a border, and I've used the 'Select by Attributes' tool in another project to query.
However, I'm stuck because this particular project has an interdependent set of criteria based on both spatial relationship and corresponding attributes.
How to efficiently model multiple iterations to find optimal solution?


texts: How to edit a gpx file in a spreadsheet and export the edited table to a new gpx?

texts:
I need to edit the date/time and the elevation of many trackpoints in a gpx file.
I tried to import the gpx file into an excel spreadsheet using the topografix xsd and the xml import command, but then I'm not able to export the table to a new xml file.

So what can I do?


texts: Buffering in QGIS3 is returning giant circles

texts:
I'm trying to buffer some lines in QGIS. However, the result I'm returning are giant circles. I've tried several different CRS and made sure the project and layer had the same CRS but the result is still the same. The CRS is also not decimal but meters. Not sure what I'm missing.

Any suggestions?


texts: Converting GeoJSON (or shapefile) data to FeatureLayer

texts:
I am creating an interactive map using ArcGIS and React.
Presently, I am creating a GeoJSONLayer. However, I'm now trying to use a UniqueValueRenderer for some of the layers. From the docs, it appears the UniqueValueRenderer does not work with GeoJSON layers.
Is it possible to convert GeoJSON (or shapefile) data into a FeatureLayer and, if so, how do you do it?


texts:
I'm using QGIS 2.16.x and the mouse wheel preference to disable zooming does not seem to be available. I've tried locking the scale but when the magnifier function is enabled, the zoom function still responds to the mouse wheel.

Is there any way to disable mouse wheel zooming in QGIS?


texts: Opening QGIS using VBA and executing Python script?

texts: Using VBA, I want to open QGIS (the actual GUI) and execute a simple script through the Python console or the editor.


texts: Query Selected Records Only: Javascript API

texts:
For a web application I am working on, I currently have a feature layer with ID 0 (Street Lights) and feature layer with ID 1 (Maintenance Records Table). Multiple records in layer ID 1 are related to ONLY 1 record in layer ID 0 (Street Light have 0 or many maintenance records). I am attempting to perform a query on layer ID 0 (such as, select all of the traffic lights that have a wattage over 400). I then want to perform a query on layer ID 1 and select only the records that are associated with the ones from the first query.

Therefore, I want all of the maintenance records for lights that have a wattage over 400. I understand how to do this with a Relationship Query. However, the final result is that I then want to perform another query on ONLY those selected records based on the date of maintenance.

My problem is that a Query Task only seems to work on a feature layer URL. Is there anyway that anyone knows how to perform a query on another query's results instead of a feature layer URL? Thanks.

UPDATE:
I guess another way to ask this is, If I run the selectFeature function on a feature layer, can I run another selectFeature function on only those previously selected features?


texts: Assigning variables from feature class/shapefile?

texts:
I'm new at Python but I want to either assign or reference specific values from a feature class of earthquake data in a Python script to be used in a custom function. I've tried using Feature Class To NumPy Array as the following:

eq = arcpy.da.FeatureClassToNumPyArray('wells_eq', fields)

When I print the result, this is what is returned:

>>> print eq
[(41.144, -114.872, 1.6, 1.6, 1.9, 10.0, 21.0, 212.0, 71.0)]

I want to assign a variable, such as strike1 and dip1. I tried

strike1 = eq[5] but got
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
IndexError: index 5 is out of bounds for axis 0 with size 1

As a check for indexing, I tried

>>> print eq[0]
(41.144, -114.872, 1.6, 1.6, 1.9, 10.0, 21.0, 212.0, 71.0)

So my question is, how can either I make individual variables based on the values in the feature class, or reference those values to be used in a custom function? Or should I try a different approach altogether?


texts:
I recently started using 10.2.2 in my new laptop and I'm having trouble in the 'pop-up windows' like the option windows inside the application (pls see the attached figure). The options windows are not displayed fully so many of the items are clipped on the bottom. Please look at the attached figure, there is a whole lot of option clipped at the bottom. There is no scroll-bar and I cannot resize those windows. Reducing the windows font (to 100%) didn't help. I reinstalled it, changed resolution of the windows but it didn't help. This problem is not seen in other application like photoshop but only in esri applications (ArcMap, ArcScene etc.)

Is there anybody facing this problem or has any solution?
I have Dell XPS 15 with windows 8.1 and I use 1920x1080 resolution.


texts: QGIS: Clip Raster by Mask Layer-permanently remove black edges

texts: I want to introduce geotiff images generated in QGIS by clipping ortho imagery to a shapefile into matlab. However, the clipped raster images come with black borders. I managed to remove them in QGIS (by setting a no data value for zero/ black), but they return when I open the same images in matlab. Even when I check the "create an output alpha band" box, the same thing happens in matlab. Any solution?


texts: Given a path, find the position on this path by traveled distance

texts:
I have a table that consists of a point and a sequence number which forms a path, similar to this:

create table path (
  sequence int,
  stop_position geometry(Point, 4326)
);

The problem I am facing is finding the resulting point along this path given a specific distance traveled (which is always smaller than the total path distance). I know how to do this using a different programming language like Java, but I was wondering if there is some clever and computationally faster way by utilizing the functionality of the GIS extension.

Here a visual representation of the problem:


texts: I created a webpage QGIS map using the Leaflet plugins, how to customize , put mouse over, then features will zoom automatically while you mouse on click on the map features, and also automatically zoom the features while you click its layer found in map legend.


texts: Generate hillshading with GDAL, and respect nodata

texts:
I'm still trying to nut out this problem of merging overlapping geotiffs.

From the original dataset (here, a 20m resolution digital elevation model of the state of Victoria), I have reprojected it and converted it to tiff. Rendered in TileMill, there is a clean, irregular boundary:

for f in dtm20m dtm10m_nw; do
export GDAL_CACHEMAX=1000
echo -n "Re-projecting: "
gdalwarp  -s_srs EPSG:3111 -t_srs EPSG:3785 -r bilinear ./vmelev_${f}/${f} ${f}-3785.tif

The TileMill style is:

.dem {
  raster-colorizer-default-mode: linear;
  raster-colorizer-default-color: yellow;//hsl(60,50%,80%);//transparent;
  raster-colorizer-stops:
  stop(0,hsl(60,50%,80%))
  stop(392,hsl(110,80%,20%))
  stop(785,hsl(120,70%,20%))
  stop(1100,hsl(100,0%,50%))
  stop(1370,white);
  raster-scaling:near;
}

Next I generate hillshading:

gdaldem hillshade -z 5 $f-3785.tif $f-3785-hs.tif
echo and overviews:
gdaladdo -r average $f-3785-hs.tif 2 4 8 16

Unfortunately now data seems to be generated even where there was none before.

The gdaldem documentation claims to respect nodata:

  For all algorithms, except color-relief, a nodata value in the target
  dataset will be emitted if at least one pixel set to the nodata value
  is found in the 3x3 window centered around each source pixel. The
  consequence is that there will be a 1-pixel border around each image
  set with nodata value. From GDAL 1.8.0, if -compute_edges is
  specified, gdaldem will compute values at image edges or if a nodata
  value is found in the 3x3 window, by interpolating missing values.

I'm using GDAL 1.9.

I'm stuck at this point - I'm not sure how to even directly verify whether there is a 'nodata' value in the reprojected tif, or by what process TileMill knows how to leave transparent pixels. Any pointers would be greatly appreciated.

(For context, if needed, the reason all this matters is my current approach to the merging problem is to layer multiple hillshaded tifs on top of each other, which won't work if the "nodata" bits collide.)


texts: Add 3rd party repositories button not in version 1.8.0 Lisboa

texts:
The available manuals and other help sources all refer to the 'Add 3rd Party Repositories button' in Plugins>Fetch Python Plugins and then the Repositories Tab. My problem is that the installation of QBIS 1.8.0 Lisboa does not have the Add 3rd Party Repositories button where stated.

How do I then add 3rd party repositories please


texts: Python select by attributes, location, copy features

texts:
Python script is failing. It's supposed to make a selection from a lyer based on attributes value and then select intersecting features of that selection and then make a copy of the selection as a new featureclass. I'm getting the error messages at the end but nothing in between and I can't figure out why. I got it working and then added some documentation and then it began failing again. I've tried running it from PythonWin and as a script tool in ArcMap and ultimately prefer to run it in the latter.

# this script selects digitized streets as well as the streets
# they intersect with from outdated centerline files and exports
# to a new featureclass to be merged with up to date centerline file

import arcpy
arcpy.env.overwriteoutput = True

try:
    # Enter parameters and run tool
    inPath = arcpy.GetParameterAsText(0)
    outPath = arcpy.GetParameterAsText(1)
    inPathFL = arcpy.MakeFeatureLayer_management(inPath, "inPathFL")
    arcpy.SelectLayerByAttribute_management(inPathFL, "NEW_SELECTION", ' "Link_ID" <= 10000')
    arcpy.AddMessage("selecting features with link ID less than 10,000")
    arcpy.SelectLayerBylocation_management(inPathFL, "INTERSECT", inPathFL, "10 Feet", "ADD_TO_SELECTION")
    arcpy.AddMessage("selecting layers by location that intersect with currently selected features")
    arcpy.CopyFeatures_management(inPathFL, outPathFL)
    arcpy.AddMessage("copying features")

    # report a success message
    arcpy.AddMessage("Created source streets feature class!")

except:
    # get error messages
    arcpy.AddError("Could not complete the export for the intended selection")

    arcpy.AddMessage(arcpy.GetMessages())
    print "Create source streets failed"

And here is the error message:

Executing: CreateSourceStreets CO_005_2012_Merge C:\RS_Data\Common\MapClips\CO_SF_2015Q2.gdb\CO_SF_2012_Source
Start Time: Tue Dec 08 15:38:11 2015
    Running script CreateSourceStreets...
    selecting features with link ID less than 10,000
    Could not complete the export for the intended selection
    Executing: SelectLayerByAttribute inPathFL NEW_SELECTION " "Link_ID" <= 10000"
    Start Time: Tue Dec 08 15:38:11 2015
    Succeeded at Tue Dec 08 15:38:11 2015 (Elapsed Time: 0.05 seconds)
    Completed script CreateSourceStreets...
    Failed to execute (CreateSourceStreets).
    Failed at Tue Dec 08 15:38:11 2015 (Elapsed Time: 0.76 seconds)


texts: Creating points along line at alternate sides using ArcGIS Desktop?

texts: I want a tool in ArcGIS Desktop to create points at the alternate sides of a given line. The distance between two alternating side points (zig zag) should be 250m and the distance from any point to line should be 50m (this can be variable and to be given as input by the user).


texts: Batching Python script in ArcGIS field calculator?

texts:
I know nothing on scripts- learning as I go, I have a point shp file that has a column named SUFFIX in the column the words are spelled out AVENUE, ROAD, STREET, SQUARE and so on. Therefore I'm using the simple format individually for each word.. gets the job done but would like to do a big batch or all of them at the same time I have not found a format that would string them together. If someone can give me a field calculator string or arcpy with a few lines I can build out from there.

!SUFFIX!.replace("ROAD","Rd")
!SUFFIX!.replace("AVENUE","Ave")
!SUFFIX!.replace("BOULEVARD","Blvd")
!SUFFIX!.replace("CRESCENT","Cres")


texts: pyqgis - Code stops working when called using threading.Thread()

texts:
I am trying to troubleshoot a threading problem. QGIS version is 3.4.

I want to move a processing-intensive task (importing xyz data, applying hillshading, and saving as TIFF) to a separate thread. I am using threading.Thread() because it is (...theoretically...) simple to implement. However, this stops it from executing fully. I get different results when I call the function directly and when I call it via 'threading.Thread()'.

Earlier I wrote a bit of test code in an effort to reproduce the problem, but it runs successfully.

I quote it here because it is concise and self-contained and it demonstrates the method - although it does not in itself demonstrate the problem.

So this works:

import os
import time

class Utils:
  @staticmethod
  def runInThread(func, ar, parallel=False):
    import threading
    t = threading.Thread(target=func, args=ar)
    t.start()
    if not parallel: t.join() # wait for it to finish before continuing
  #
# end class

def makeFiles(outputFolder,a):
  for i in range(0,10):
    a = outputFolder + '/' + str(i) + '.txt'
    with open(a,'w+') as file: # create text file
      time.sleep(0.25)
#

def killFiles(outputFolder,a):
  for i in range(0,10):
    os.remove(outputFolder + '/' + str(i) + '.txt')
    time.sleep(0.25)
#

a = 0
outputFolder = 'D:/Users/[xyz]/Desktop/xyz'

# BOTH OF THESE WORK:
if 1 == 1: # with threading
  Utils.runInThread( makeFiles, (outputFolder, a), False )
  Utils.runInThread( killFiles, (outputFolder, a), False )
else: # without threading
  makeFiles(outputFolder,a)
  killFiles(outputFolder,a)
#

My original implementation calls the same 'runInThread' function. It is not so easy to reproduce here because it is part of a larger project, but this is the relevant part:

def xyzToTIFF(self, t, outputFolder, keepXYZ):

  import os

  self.StripDuplicatesForRaster(t, False)
  self.SortXYZForRaster(t)
  l = Qfunc.ImportRaster(t) # import file, return layer 'l'
  layerName = l.name() # store for later use
  if not l is None:
    Qfunc.setNoEnhancement(l)
    Qfunc.setRenderHillshade(l) # hillshade
    Qfunc.SaveRaster(l, outputFolder) # save TIFF <-- We get to this point in both cases
    QgsProject.instance().removeMapLayer( l.id() ) # remove the xyz file
    if keepXYZ == False:
      os.remove(t) # delete the xyz tile file <-- Does not happen when using threading!
    lTIFF = QgsRasterLayer(outputFolder + '/' + layerName + '.tif', layerName)
    if not lTIFF is None:
      QgsProject.instance().addMapLayer(lTIFF)

The above runs, and execution completes, and it generates TIFF images. However, when I call it using Utils.runInThread() the .xyz raster files (which should get deleted, and are represented by the 't' argument in 'xyzToTIFF' above) remain in the folder, and no layers get added to the QGIS project.

If I run it without threading, it works as intended. The .xyz files get deleted, and the TIFFs are loaded into the project.

It is called like this:

for t in tiles:
  if 1 == 1: # threading
    Utils.RunInThread( self.xyzToTIFF, (t, outputFolder, False), False )
  else: # no threading
    self.xyzToTIFF(t, outputFolder, False)

I suspect the problem is that I am trying to reference the project instance from a different thread. I tried modifying the above code slightly to pass QgsProject.instance() into xyzToTIFF() but the result was unchanged.

Intuitively I can see that I probably cannot access the project instance from outside the original (UI) thread. Is this the case? If so, can I pass a reference to it somehow, or do I have to keep any manipulation of layers etc. within the original thread?


texts: Add FID to attribute table using ogrinfo

texts:
I want to add the fid to the attribute table using ogrinfo in OSGeo4W Shell.

Here is my code:

ogrinfo layer.shp -sql "ALTER TABLE layer ADD COLUMN ID integer"
ogrinfo layer.shp -dialect SQLite -sql "UPDATE layer SET ID = FID"

The GDAL:OGR SQL help https://www.gdal.org/ogr_sql.html points out that sometimes it is necessary to add the fid as a column, as it is the case for me.

Does anyone has a clue how to solve this? Maybe by iterating a rownumber?


texts: Locate features along routes when features are parallel

texts:
I am trying to use Esri's Linear Referencing Tool to conform a drawn line to a road route.  I have a fairly large search radius of 20m.

As long as the line I draw touches the route at some point, the tool works as I would expect.  The odd behavior is when the drawn line is parallel to the route.  Then no matter how close I draw my line to the route nothing gets referenced.

How does one get the linear referencing tool to find a line parallel to a route?

The purple is my route. the green is a road allowance that is 20M wide.


texts:
I'm using a script to list datasets from multiple gdbs in ArcPy (to rename most datasets and gdbs). Which looks like this:

dir_gdbs = 'D:\\mypath'
os.chdir(dir_gdbs)

lista_gdbs = glob.glob('*.gdb')
for i in lista_gdbs:
    gdb = (os.path.join(dir_gdbs,i))
    arcpy.env.workspace = gdb
    lista_capas = arcpy.ListDatasets()
    for u in lista_capas:
        #do stuff

It works correctly but there are many gdbs to process and it is very slow. Most of its time is lost changing the workspace (arcpy.env.workspace = gdb). Is there any way to list the datasets within each gdb without doing this?


texts: Most Efficient Way to Use 'reduceRegions' in Google Earth Engine on a Very Large FeatureCollection

texts:
I am working with 1 meter NAIP imagery on Google Earth Engine. I am trying to use reduceRegions to extract point values from NAIP using an ee.FeatureCollection that contains several thousand points for use in a classification problem. But if I try and use 'reduceRegions' at NAIP's native 1 meter resolution, the operation fails.

Fails: Error: Execution failed (internal error).

var REGION_BOUNDARY = ee.FeatureCollection('ft:1fRY18cjsHzDgGiJiS2nnpUU3v9JPDc2HNaR7Xk8')
  .filter(ee.Filter.eq('Name', 'Kansas'));

var training_pts = ee.FeatureCollection.randomPoints(
  REGION_BOUNDARY,
  90000);

var estNDVI = function(image) {
  var ndvi = image.normalizedDifference(['N', 'R']).rename('NDVI');
  return image.addBands(ndvi);
};

var naip = ee.ImageCollection("USDA/NAIP/DOQQ")
  .filterBounds(REGION_BOUNDARY) // this is a US state, e.g., Kansas
  .filterDate(String(YEAR-2), String(YEAR));

var naip_ndvi = naip.map(estNDVI).mean();

training_pts = naip_ndvi.reduceRegions(
  training_pts,
  ee.Reducer.mean(),
  1 // scale parameter
);

Edit: User Kersten says that the size of the FeatureCollection is the issue.


texts: Are ellipsoids a mathematical necessity?

texts:
The literature usually just tells us that the Geoid is too complex to describe mathematically and that we therefore fit different Ellipsoids to approximate it.

Are these Ellipsoids mathematically necessary, or could we define projections from the Geoid model to plane coordinates too?


texts: Does Survey123 support editing existing surveys from other users via the Mobile App?

texts:
I need to choose between ArcGIS Collector and Survey 123 for field data collection.

The workflow consists of 2 teams which both need to collect data on a single point:

Team A:
 1. Acquires initial point.
 2. Takes some photos, notes, and initial data.
 3. Submits/Saves

Team B:
 1. Edits initial point
 2. Takes more photos, more notes.
 3. Submits/Saves and closes out the position.

I've reviewed the following links, but didn't see an answer to my question. I am thinking this workflow isn't supported, but I wanted to make sure I wasn't missing something.

https://doc.arcgis.com/en/survey123/reference/formappcomparision.htm

https://doc.arcgis.com/en/survey123/browser/get-answers/faqgetanswers.htm

https://doc.arcgis.com/en/survey123/desktop/create-surveys/faqcreatesurveys.htm


texts: Creating shapefile from selection - remove from map

texts:
I am iterating over a shapefile and creating a new shape from each row. I will be creating several thousand individual shapes and do not want to inundate my TOC with that many layers (I bet ArcMap would crash if I did). Using the code below, each shape is added after being created. How could I remove the shape from the TOC after being created? I tried deleting the tempPoly variable but that did not do the trick.

polys = arcpy.SearchCursor(shapefile) #recall the cursor
for poly in polys:
    print('starting at '+str(poly.FID))
    whereClause = '"FID" = ' + str(poly.FID     ) # Create a clause to select only the current record
    tempPoly=arcpy.FeatureClassToFeatureClass_conversion(shapefile,tempFilesPath,"tempPoly"+str(poly.FID),whereClause)

I am not working in a dataframe and am in the data view not the layout view.


texts: How to measure the response time of a layer WMS/WFS in QGIS

texts: Is there a way in QGIS (or pyqgis) to measure and test the response time of a WMS/WFS layer?


texts: How to find polygon neighbors by rook and queen contiguity in a feature class?

texts:
I have a feature class containing several polygons. I would like to find all polygons that have a common border to a polygon of my choice. This can be done with the ISpatialFilter and esriSpatialTouches. This is known as the queen contiguity. However, the rook contiguity does not contain the polygons, which have only a point in common. It seems that this is something I can not figure out with the DE-9IM.

My idea is to test all polygons which touches my selected polygon with the Intersect method from the ITopologicalOperator interface and see if the result is from the type Point. If this is the case I have to remove this polygon.

Is there a better way to achieve this?


texts:
I am having an issue when trying to use the spatial join tool in ArcGIS.
I have 2 datasets:

Tennessee Counties
Tennessee Protected Areas

I want to join these two datasets so that I have the total area of protected areas within each county in Tennessee.
I have Protected Areas as the target feature, and Tennessee Counties as the join feature. When I attempt a one to one intersect join some counties have way more area of protected area than the area of the county.
What merge rules should I utilize to sum the total area of protected areas within each county?


texts: How to colour vector tiles based on filter in QGIS 3.16

texts:
I have a vector tiles layer that displays fine in QGIS 3.16:

A fill without a filter works as well:

However, the fill based on a filter on the feature properties does not work (result can be seen in image 1). Note that "Lines" and "Points" are added automatically by QGIS.

How can I set the symbology based on an attribute of the vector tiles?


texts:
I'm having some compatibility problems with PyQt5, as expected some of the scripts I wrote are not working.

My biggest issues are with these two PyQt4 functions:

layer.pendingFields()

layer = QgsMapLayerRegistry.instance().mapLayersByName('Layer_Name')[0]

Is there a comparable function in PyQt5?

Does it work like the old functions?

In general it would be great to have something like a dictionary, where you could look  for the old function and see the relate translation or substitutes in PyQt5.


texts: Using Service Qualification Widget for Telecom - Error on "Find"

texts:
I am trying to set up the WebAppBuilder Service Qualification widget for my Group. I followed all the instructions illustrated here.
http://solutions.arcgis.com/telecommunications/help/service-qualification/get-started/configure-application/

For my layers required I have used an ArcSDE Enterprised geodatabase 10.31 layers shared as Feature Services. I used this NAServer
http://telecom.esri.com:6080/arcgis/rest/services/BusinessServiceability/ServiceQualificationRoute/NAServer

Everything is working up to the point where I select my location and click find, then it stalls and throws these errors.


texts: Defining projections for multiple shapefiles in ArcMap?

texts:
I have over 100 shape files that don't have .prj file and thus when I bring them into ArcMap 10 they show the coordinate system as unknown.  I know all of the shape files coordinate system is GCS WGS 1984.  I also know I can use the Define Projection GP tool to individually assign the coordinate system to each file but that will take forever.

I was hoping there was a GP tool to batch define these but I don't see one.  Next I was thinking maybe I could use python to do this so I looked in the help menu and found a script but it gives me an error.

Here is the python code I tried (this is for a single shp file so I would still have the pain of typing the name for each file:

import arcpy
infc = r"C:\Documents and Settings\User\My Documents\ArcGIS\shpfiles\Site_2.shp"
prjfile = r"<install directory>\Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"
arcpy.DefineProjection_management(infc, prjfile)


texts: Differentiating bare soil and urban areas in Landsat 4-5 land cover classification?

texts:
I am trying to classify a Landsat 4-5 image using the semi automatic classification plugin (QGIS). I always get misclassifications between bare soil and urban areas as they have similar spectral information.

Is there a way to improve the quality of the classification so that urban areas and bare soil are better differentiated?


texts: Convert 2D coordinates from NAD83 to WGS84 using Postgis

texts:
I have a set of NAD83 coordinates that I need to convert to WGS84 coordinates. I am using postgis on an RDS. Specs for the box I am using from postgis_full_version():

POSTGIS="2.1.3 r12547" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" TOPOLOGY RASTER

I have tried a number of queries using built in functions. My latest iteration:

select st_asText(st_transform(st_setsrid(st_makepoint(-77.0282705292858, 38.9170880930097), 4269), 4326));

Result:

                 st_astext
-------------------------------------------
 POINT(-77.0282705292858 38.9170880930097)
(1 row)

The exact same coordinates. I have tried this with other addresses in DC (this one is for Ben's Chili Bowl) and other addresses in other states, but have always received back the exact same coordinates that were initially entered.

I would have assumed that the coordinates should be the same, but when using the online tool provided by WV (http://tagis.dep.wv.gov/convert/index.html) that uses ArcGIS on the backend, the coordinate conversion returns different results.

My assumption is that I'm missing something obvious with the query which is causing results to repeat themselves or am misunderstanding how this conversion is supposed to work.


texts:
My understanding is that "Coordinate Capture" is "built into" QGIS 3.0, rather than being a Plugin. However, I can't find where to start it.
How do I navigate to that option and what do I need to do to have coordinate capture show as an icon?


texts: Collecting Lat-Long in a Google Docs Form by adding script?

texts:
So I need am trying to figure out a way to collect Lat long data and have it saved automatically when I fill a Google form on my phone. Is it possible as retracing address to plot is not possible for my use case.

https://www.quora.com/How-do-I-get-the-geolocation-of-a-place-in-Google-Forms

I am trying the solution mentioned by Sameer in this Quora post but completely unable to make this code work. It doesn't have to be a Google form solution but an Open source solution which doesn't restrict my data to its platform might also work.


texts: Is there a way to eliminate duplicate 'point clusters' in SQL Server 2008 r2 spatial?

texts:
I am using the ST.Distance function to identify clusters of geometry data points.  Each point has a unique reference number associated with it.  I would like to eliminate duplicate clusters from the output, as it is very likely that within my dataset 2 different 'clusters' could contain the exact same 6 (or more) data points.  Is there a way to do this?

My SQL to identify the clusters is basically as follows:

declare @radius as float = 50
SELECT t1.ref,
SUM (CASE WHEN t1.geolocation.STDistance(t2.Geolocation) <= @radius
          THEN 1 Else 0 End)
FROM DataTable as t1, DataTable as t2
WHERE [t1].[ref] != [t2].[ref]
GROUP BY [t1].[ref]
HAVING SUM (CASE WHEN t1.geolocation.STDistance(t2.Geolocation) <= @radius
          THEN 1 Else 0 End) >5

ORDER BY [t1].[ref]


texts: Any Open Source Web Mapping App importing ASCII grid?

texts:
I'm using QGIS were its easy to import my noise mapping data through a raster layer file in ESRI ASCII (ASCII grid) format.

I want to do the same online, without exporting from QGIS, because I want to work dynamically with the output of my prediction software.

What I want is to be able to have the red shape data imported directly and interpreted by the web mapping. Anybody knows any Open Source Web mapping tool able to import this kind (or similar) raster file?


texts: Quick doubt about adding a Feature to a Vector Layer

texts:
If I clone a feature from a Vector Layer A and I add it to another Layer B, I assume this happens only in client side and it doesn't really affect my B Layer on server at all, am I right?

# Note: Syntax is CoffeeScript

clone = featureFromA.clone()

# This returns the Source of a layer by its name
layerBSource = @app.getMapLayerSource('LayerB')

layerBSource.addFeature(clone)

I guess this is a really stupid question, but I didn't find any information on the API Docs about this.


texts: Shapefiles tables corrupts when using in QGIS

texts:
I'm operating QGIS 2.18.0 64-bit on a 64-bit machine (Windows 10) but this issue occurred in the previous QGIS version.

When I add a shapefile that was provided to me by someone else, the attribute table is corrupted. When I save-as the shapefile as a CSV, the corruption is maintained.

When I import the shapefile into Google Earth Pro, after importing it into QGIS, the corruption is maintained.

When I add a CSV layer with multiple fields / attributes, the attribute table appears as it should. However, when I add a shapefile or even save-as a CSV to shape, the attribute table gets completely messed up. The data is corrupted because I can't even add the shapefile into Google Earth with attributes popping up as normal.
CSV looks something like this:

But when I save as a shapefile, it looks something like this:

Also, when I start up QGIS, this message pops up.

I click 'OK' and then it starts up and I can start using it. Not sure if this message is related..

Would anyone know how to fix table corruption in QGIS?


texts: transform MULTILINESTRINGs to curves in cartodb

texts:
I have a table with a column that contains MULTILINESTRINGs, where every string contains the longitude and latitude of a starting- and an end point, e.g.:

MULTILINESTRING((97.0253024 4.3685491,8.5618685 47.4524688))

Now I want to add geometry to those lines and make them curved so that I get an "arc" between the starting- and end point when I map them. What I have tried is the following:

UPDATE table_name
SET the_geom =
ST_Transform(ST_GeomFromText(column_with_multilinestrings, 4326), 953027)

Shouldn't this change the reference system from 4326 to 953027? It somehow doesn't work for me, I only get the following error:

Geometry SRID (953027) does not match column SRID (4326).

I already checked this post and the links in it. I also had a look at the cartodb tutorial for making curved lines, but everything I have seen so far concentrates on making curved lines/arcs from a centre point to other points (i.e. A -> B, A -> C, A -> D, etc.). The problem I have, is that I don't know how to draw those arcs from A -> B, C -> D, E -> F, etc.

What am I doing wrong? How can I transform these multilines to curved lines (i.e. arcs)?

John's comment on what ST_Segmentize actually does (and that everything gets converted back to 4326), led to the following SQL statement working to convert the MULTILINESTRINGs (in the_geom) to curved lines:

UPDATE table_name
    SET the_geom =
        (SELECT ST_Transform(
        ST_Segmentize(
        ST_Transform(table_name.the_geom, 953027),100000),4326))


texts: How to copy single polygon and paste multiple times to same layer in Arcmap 10?

texts: I'm attempting to copy a single polygon and paste it 113 times to make "parcels" for a condominium building.


texts: Calculate Fields from 3 different fields using ArcGIS for Desktop?

texts:
I'm using a shapefile of different vegetation and land cover types and I want to generalize to a simpler classification (ie. I only need to differenciate between young and old forest and open land, human structures and water bodies). My current shpe contains a lot of information on stand type, density, height, disturbance, etc. So I'm trying to calculate a new field value from many existing fields in ArcGIS.

I want the new values to appear in the column "PER_AN_ORI".

I need to reclassify using a priority, ie. if field "perturbation" has a value X or Y, then give it the new value A or B. If that field is empty (or doesn't have the specified values), I want ArcGIS to look in the next priority field "TER_CO" and depending on what's there, give the new value C or D. Then look into field "type"... And so on.

Can I do this with Field Calculator. Do you recommend VBA or Python? I know neither, so a reference to a quick learning guide would be useful.


texts: How to calculate zonal statistics from multi-band raster for each polygon using python?

texts:
I want to calculate the zonal statastics from multi band raster for a polygon layer. When I am using this snippet of code:

vectorlayer=qgis.utils.iface.mapCanvas().layer(0)
rasterfile = qgis.utils.iface.mapCanvas().layer(1).source()
zonalstats = qgis.analysis.QgsZonalStatistics(vectorlayer,rasterfile,"Zonal_")
zonalstats.calculateStatistics(None)

it is updating the field names but the values are NULL in the attribute table. So if I want to get the values to be updated, how can I do that?


texts:
How can you add a custom marker/point on the vertices of a line feature?

There are only options to add them to the start/end of the line and equally spaced along the line.

However, a marker on the exact postition of each vertices seems not to be possible.


texts: Add geometry attributes (x y) in the lat long column using Python console in QGIS

texts:
I would like to add geometry attributes (x y) to my point layer using py console.I know it is possible to calculate using the field calculator syntax, but then it creates a new layer which I want to avoid.

Basically below task using script.


texts: How to get all features in current extent

texts:
I like to add text information to each feature in the shown map extent in my MapControl/PageLayoutControl. Adding the text is not a problem, but I couldn't find a way on how to get the features.

Is there a way to get all features in a layer that are in the current map extent?


texts: Units used for distance calculations by distance matrix tool of QGIS

texts: I can't seem to get the measure tool to match up with my distance matrix tool regardless of what measurements I use. There are conflicting answers on other posts about this question. Both of my layers are on WGS84


texts:
I've tried just about every single TileMill compositing operation on the vector and raster layers in question, and I have to admit that I can't figure it out: How the heck can I mask a raster with a vector in TileMill/CartoCSS?

Basically, I have a raster, generated by QGIS (and masked in QGIS with a vector shapefile of the U.S.). I ran it through GDAL to colorize it and re-project it into web mercator for TileMill. Somewhere in the process, everything outside the QGIS mask became a solid white pixel, and I just can't seem to trim that white off. I've brought the same shapefile into TileMill, and that's what I'm trying to use to trim the raster.

As usual, I feel like there's something basic I didn't do—maybe in the QGIS GeoTIFF export process?—that would explain TileMill's stubborn refusal to do away with the gross white square around my map, but Google is failing me. Any ideas?


texts: How to spatially reference data based on the address of the features

texts:
My initial aim was to make a map in ArcMap where the traffic volume of Austria's highway is displayed. I couldn't find any data for that. Instead I found data for Vienna. It is a shp-file that consists of points.
When I added the data to a blank map in ArcMap I get a warning, saying that the data I want to import is missing spatial reference (see in the attachment)

https://www.data.gv.at/katalog/dataset/stadt-wien_strassenverkehrszhlung2010wien/resource/4d661e8d-815b-41c7-b6dd-92e0ec1ff2e8

Above you find the link for the data i wanted to import.

How can I make a spatial reference based on the address of the single points?


texts: Computing least-cost matrix between all pairs of destination using ArcGIS Pro

texts:
I have a vector line shapefile showing the road network in a particular country with data on the unit cost for each line. I also have a point shapefile showing the centroids of each district in the country. There are 139 such centroids. I am trying to compute the cost of the least cost path for all pairs of district centroids. paths instead of 139C2=9591 pairs. Some centroids are far from a road.
How can I do this using ArcGIS Pro?


texts:
I've built a routing application in C# that brings back a route object, with a series of steps, each of which has a name tag such as "Brooke Street (M50)" and nothing more.

This application has been built with an OSRM backend, using data from Geofabrik. When I run a query in map.project-OSRM.org, I'm able to see the full address (street, county, country, postcode). When I run the same query on my local copy of OSRM, I'm only able to retrieve the street name.

Is anybody able to tell me where I can either download the additional data, or how to get access to it? I'm in need of reverse geocoding > full address functionality, which isn't fully possible with what I have access to at the moment.


texts: How to clip multiple raster datasets with county polygons?

texts: The example below shows three raster (i.e. in black) and a single county polygon feature class.  How can I clip/extract by mask the rasters by their corresponding county polygons (i.e. Edwards, Clark, Barber) in an automated fashion?  For this example, the output should include three separate rasters clipped to the county boundaries.  A python or ArcGIS solution suitable for batch processing would be ideal.  Thanks for the help.


texts: how to separate land-use type from rows to columns from one shapefile

texts:
i am new to using ArcGIS.

i have one shapefile of land-use data (100 rows) that has different land-use areas for each neighborhood (which are 10 neighborhoods), what i want is to have one row for each neighborhood with different column of the land-use area.


texts:
When you visit a classroom in the United States and see a map of the contiguous states on the wall, it's usually in NAD83 Albers Equal Area with the central meridian right at 96 West.

Is there an equivalent for the UK? Or to phrase it another way, what's the most common projection when viewing a map of the UK?


texts: Error 999999 on FeatureClass To FeatureClass conversion in ArcPy?

texts:
I am currently working on a python script where I am trying to copy selected features into a feature dataset.

Basically I have an mxd containing some layers, and for each layer I select features by their attributes, this query is based on the featuredataset name.
The script I have written get a list of the feature datasets of my geodatabase. With the name of the featuredataset, I can build a query filter (arcpy.SelectLayerByAttribute_management) for each layers of the mxd.
If my selection return something, I export the selected feature in the proper dataset (arcpy.FeatureClassToFeatureClass_conversion).
The script is processing the first dataset properly, but once it jumps to the next one it fails... I cannot figuring out why I am receiving the following message error(arcgisscripting.ExecuteError: ERROR 999999: Error executing function.
Failed to execute (FeatureClassToFeatureClass).)

#-----Work-on-the-Geodatabase-----
##path of the geodatabase
gdb_hull="D:\\As_Con_Plans\\As_Con_Hull_part1.gdb"
##set the workspace
arcpy.env.workspace=gdb_hull
##get the list of the featuredataset
fdlist =arcpy.ListDatasets()
#-----Work-on-the-mxd-----
##get the mxd path and initialise it
path_mxd="D:\\As_Con_Plans\\As_constructed.mxd"
doc_mxd = arcpy.mapping.MapDocument(path_mxd)
##list of layers
fclist=arcpy.mapping.ListLayers(doc_mxd)

#-----Loop-on-each-featuredataset----
for fds in fdlist:
    print "________","\n ", fds
    ##work on the featuredataset name, for suiting the query
    get_fds= fds.replace("As_con_","")
    fds_name=get_fds.replace("_","-")
    ##path of the featuredataset
    fds_path=gdb_hull+"\\"+fds
    ##prepare the query
    SQLexpression= "\"As_Constructed_Plan\"='"+fds_name+"'"
                    ##path where we will store the selection
    fds_path_test=str(fds_path)

    #-----Loop-on-each-layers-of-the-mxd-----
    for fc in fclist:
        fc_to_copy=fc.dataSource
        #fc_to_copy2=arcpy.mapping.Layer(fc_to_copy)
        ##Select the featureclasses
        arcpy.SelectLayerByAttribute_management (fc,"NEW_SELECTION",SQLexpression)
        ##Count the selected features
        count = int(arcpy.GetCount_management(fc).getOutput(0))
        print fc,count
        ##if the query succeed, we will copy the  selection into the proper featuredataset
        if count>0:
            ##print some info
            fc_path2=fds_path+"\\"+str(fc)
            fc_path=str(fc_path2)
            fc_name=str(fc)
            fc_copy_from=str(fc_to_copy)

            ##check if the featureclass does not exist
            if not arcpy.Exists(fc_path):
                print "\n copying...",count," entities , on ",fc_path
                print (fc_copy_from,fds_path_test,fc_name,SQLexpression)

                arcpy.FeatureClassToFeatureClass_conversion(fc_to_copy,fds_path_test,fc_name,SQLexpression)
                print "export ok"


texts: How to pass viewparams with vector tile request using open layers 5

texts:
I want to create an application using vector tile. I am using openlayers v.5 and geoserver 2.14.1 for this purpose. I have already rendered vector tiles, but not able to pass viewparam along with vector tile request. Here is my sample code:

    var layer = 'cite:OPE_MAP_SpatelSpeed';
    var projection_epsg_no = '900913';

      var tmcsource = new ol.source.VectorTile({
          cacheSize: 0,
          tilePixelRatio: 1, // oversampling when > 1
          tileGrid: ol.tilegrid.createXYZ({ maxZoom: 19, tileSize: 512 }),
          format: new ol.format.MVT(),
          url: 'http://localhost:8080/geoserver/gwc/service/tms/1.0.0/' + layer +  '@EPSG%3A' + projection_epsg_no + '@pbf/{z}/{x}/{-y}.pbf'

      });

    var map = new ol.Map({
        target: 'map',
        view: new ol.View({
            center: ol.proj.transform([-74.0, 40], 'EPSG:4326', 'EPSG:900913'),
            zoom: 7
        }),
        layers: [
            new ol.layer.Tile({
                source: new ol.source.OSM()
            }),

            new ol.layer.VectorTile({
            style: simpleStyle,
            renderMode: 'image',
            source: tmcsource
        })]
    });

My layer cite:OPE_MAP_SpatelSpeed is generated using SQL view of geoserver in which i have to pass few viewparams to fetch the data accordingly.
e.g viewparam ='zoomlevel:4;func:1'

sample request call using wmts service:'http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=cite:OPE_MAP_SpatelSpeed&STYLE=&TILEMATRIX=EPSG:4326:9&TILEMATRIXSET=EPSG:4326&FORMAT=application/vnd.mapbox-vector-tile&TILECOL=300&TILEROW=139&VIEWPARAMS=ispercent:1;R:0000FF;zoomlevel:7'.
This call is working fine.

I don't know how to pass view param with this vector tile request URL.
'http://localhost:8080/geoserver/gwc/service/tms/1.0.0/' + layer +  '@EPSG%3A' + projection_epsg_no + '@pbf/{z}/{x}/{-y}.pbf'


texts: We recently upgraded to Image Server 10.0.1 and in the process our WMS Image Services quit displaying. The connection to them works in ArcCatalog, but it never displays.  If I preview the service it gives coordinates but no image. I will admit that we had this problem when we originally created them and I figured out the problem...but that was over a year ago and I can't remember that far back. The XML can be viewed here: https://maps.sjcounty.net/ArcGIS/services/2009_SJCounty_1ft_IS/ImageServer/WMSServer?request=GetCapabilities&service=WMS Any ideas?


texts: How to turn shapefiles into raster and aggregate them into one raster

texts:
For example i tried this but it doesn't work

rast_a<-raster(extent(shp_1))
res(rast_a)=100
rsh<-rasterize(shp_1,rast_a)
rast_b<-raster(extent(shp_2))
res(rast_b)=100
rshs<-rasterize(shp_2,rast_b)
rast_c<-raster(extent(shp_3))
res(rast_c)=100
rsx<-rasterize(shp_3,rast_c)
co<-rsh+rshs+rsx
plot(co)

it returns

Error in compareRaster(e1, e2, extent = FALSE, rowcol = FALSE, crs = TRUE,  :
different origin


texts: Analysis of positioning polygon on polygon using ArcGIS

texts:
This might be a really complex analysis and I'm not entirely sure how possible it is but it is worth a shot.

Is it possible to do analysis of positioning between either a "polygon and polygon" or "point and polygon"? Basically I have a polygon that delineates a boundary and I have another polygon that shows a building footprint and I want to know whether or not I can fit another building within this boundary. Of course the position of the existing structure plays a critical role in determining the possibility of adding a second structure.

I have my doubts about doing this analysis as there could be any number of complex variables in determining whether or not a second structure would fit (ie. shape and size of the first building, shape and size of the second building, shape and size of the boundary etc...)

Complete shot in the dark but wondering if anyone has ever done anything like this?


texts: Getting AttributeError: 'module' object has no attribute 'CalculateGeometryAttributes_management'?

texts:
I am trying to calculate the area for my grid cells. For that, I give the
following command

arcpy.CalculateGeometryAttributes_management(union, "AREA")

Here, union is my grid and I need to make a new field to store the area. I am getting the following error:

'module' object has no attribute 'CalculateGeometryAttributes_management'


texts: How to train or calibrate stream flow accumulation using observation data?

texts:
I need to calculate flowrate at designated coordinates (Point of interest - POI) in a watershed. I have real-world data from stream gauge stations along this watershed for each 50-150 km2 rainfall area but these measurement locations are off the path or too far away from POI. I want to calibrate/train the flow accumulation values according to these data so that I can calculate flow at my POI.
Is there any tool for this. I am using Hydrosheds rasters for flow accumulation/direction calculations, and QGIS but have access to ArcGIS too.


texts: Georeferencing multiple rasters to World files in ArcGIS for Desktop?

texts:
I've got exactly 56 tiffs to georeference. Each raster has its unique TFW world file. I'd like  to automate this process. Each raster has it's unique name which is consistent with world file name (eg. HT.tif and HT.tfw). I searched for Python function on update georeferencing and closest I've got was 'Warp' function in Data Management but it's not exactly it. I know I can do it manually bu adding each raster to ArcMap and update georeferencing this way but I'd have to do that 56 times.

Apart from ArcGIS perhaps there is a GDAL option?

Does anyone have any suggestions?


texts: Unable to compile QGIS 3.x (master) on Ubuntu 16.04: PyQt5.pyqtconfig module does not exist

texts:
From: http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html
there seems to be no more pyqtconfig module in PyQt5:

  pyqtconfig Module

  PyQt4’s pyqtconfig module is not supported. The section The PyQt5 Extension API describes the support that PyQt5 provides to third-party packages (e.g. QScintilla) that want to build on top of PyQt5.

So it's not possible to compile QGIS 3.2 from sources on Ubuntu (16.04) because it's used by the file FindPyQt5.py in the cmake folder:

https://github.com/qgis/QGIS/blob/master/cmake/FindPyQt5.py

cd /opt/QGIS/build3_2/
cat ../cmake/FindPyQt5.py | grep -in pyqtconfig
    34:    import PyQt5.pyqtconfig
    35:    pyqtcfg = PyQt5.pyqtconfig.Configuration()

The compilation process ends on:

Traceback (most recent call last):
  File "/opt/QGIS/cmake/FindPyQt5.py", line 34, in <module>
    import PyQt5.pyqtconfig
ImportError: No module named 'PyQt5.pyqtconfig'

My PyQt5 version is 5.11.2.

Is there any solution or workaround?


texts: Stretching (rescaling) Raster (NDVI) Values between -1 and 1?

texts:
I am trying to equalize NDVI values for the same area temporally. For example 2014 LS8 NDVI values between -.12 and .007 while 2011 LS5 values between -.33 and.77. I would like to equalize each raster values between -1 and 1 so it is more comparable.

Is there a way of doing this in ArcGIS 10?

If I use reclassify it creates 9 classes values between 1-9.

Can I use these classes temporally to compare NDVI for consecutive years?

My ultimate goal is measuring vegetation growth between 1991-2016 for different watersheds. I am planning to use cumulative NDVIs for each watershed.


texts: Getting WMS LegendGraphic using GeoServer and GeoWebCache?

texts:
I am using GeoServer alongwith the default, build in GeoWebCache. I am using Extjs and GeoExt, as well. Everything is running well, except for the legend graphics request. My code for layers is as follows:

var MyLayer = new OpenLayers.Layer.WMS( "MyLayer",
        "http://my-ip-address/geoserver/gwc/service/wms",
        {layers: 'MyLayer',transparent: "true",format: "image/png",
        tileSize: new OpenLayers.Size(256,256),
                tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom },
                { isBaseLayer: false, visibility:false} );

And for legend panel:

var legend = new GeoExt.LegendPanel({
    title: "Map Legend",
    iconCls: 'legend',
                autoScroll: true,
                defaults: {
                    cls: 'legend-item',
        baseParams: {FORMAT: 'image/png'}
                },
                items: []
            });

Whenever I am trying to open this map, I am getting the layer name in my legend panel, but there is no image for layer legend and firebug is giving this error:

  "NetworkError: 400 Bad Request -
  http://my-ip-address/geoserver/gwc/service/wms?TRANSPARENT=true&TILESIZE=256,256&TILESORIGIN=72.45,24.45&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application.ogc.se_xml&LAYER=MyLayer&FORMAT=image/gif&SCALE=2500000.0000000005&FORMAT=image/png"

I understand I will have to replace part of the URL request for GetLegendGraphic. But I am not able to do the same.Could anybody tell me how to accomplish this?

I am using GeoServer 2.1.1; GeoWebCache 1.2.6, OpenLayers 2.11, Ext
3.2.1 and GeoExt 1.1.


texts:
So this is a scanned map of a portion of Morocco.
This is the original map

And , this is the map after georeferencing it

This map is now giving me the correct coordinates for the positions on it , but why did It tilt? I fail to understand the reason it tilted


texts: How to fix the definition(SQL) of a view that has errors (in ArcGIS)

texts:
Occasionally, schema changes that are made in my tables cause errors in my views. Example: a field is changed in a table that was referenced by a view.

When there are errors in a view, ArcGIS Desktop throws errors:

When the view is dragged to ArcMap, error: 'Could not add the specified data object to the map. DBMS table not found [ORA-24372: invalid object for describe]'
When double clicked in Catalog, error: 'Failed to edit the selected object(s).'
When right clicked >> Properties in Catalog: Nothing happens

I would like to either modify/fix the view's definition(SQL) or, at the very least, get the SQL, and then delete the broken VIEW and recreate it with working SQL. However, because there are errors, ArcGIS is not letting me get to the view's properties or the view's definition tab, to get at the SQL.

How can I fix the definition(SQL) of a view that has errors in ArcGIS Desktop?

Environment:

ArcGIS Desktop 10.3.1
SDE 10.3.1
Oracle 12c (12.1.0.2.0)

I do not have access to SQL Plus. I only have ArcGIS Desktop and MS Access, and do not have DBA privileges.


texts: Adding Fields to ArcGIS Server Map Service Without Original MXD?

texts:
I have access to a Map Service, originally created from an MXD published to ArcGIS Server.

The MXD and service definition file are no longer available.

Is it possible to modify this service, and add new fields to a layer within it without these files?


texts: Converting SQLite BLOB geo to Polygon in Python using SQLite3

texts:
I am trying to convert a geo column into Polygons in Python with SQLite3. I imported the file into Python and geo rows look like following first row:
geo[0] = b'\x00\x01$i\x00\x00@\xd9\x94\x8b\xd6<\x1bAb\xda7\xb6]\xb1QA\xf0\xf7\x8b\x19UC\x1bA\x9c\xde\xc5\r\xc3\xb1QA|\x03\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00Hlw\xef-C\x1bA\x9c\xde\xc5\r\xc3\xb1QA\xf0\xf7\x8b\x19UC\x1bAv\xc0u)^\xb1QA\xbcw\xd4\x88\xf1<\x1bAb\xda7\xb6]\xb1QA\xa5\xdc}n\xd7<\x1bA\x84.\xe1r\xbe\xb1QA@\xd9\x94\x8b\xd6<\x1bA\xce\x8eT\xef\xc1\xb1QAHlw\xef-C\x1bA\x9c\xde\xc5\r\xc3\xb1QA\xfe'

When I use ST_AsText(GEO) in spatialite_gui, it makes the following conversion:
POLYGON((446667.483854 4638476.215202, 446677.274948 4638072.647812, 446268.383623 4638070.847159, 446261.857902 4638457.794994, 446261.63631 4638471.739536, 446667.483854 4638476.215202))

However, I could not achieve the same thing in Python using SQLite3 because it says there is no such function. Then, I started to look at alternative solutions and found this method: wkb.loads(parcel.the_geom, hex=True) with shapely package here. Yet, this also did not work and produced the following error:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-120-96c04363008d> in <module>
      1 from shapely import wkb
      2
----> 3 shp = wkb.loads(data[0][-1], hex=True)
      4 print(shp)

~/anaconda3/lib/python3.7/site-packages/shapely/wkb.py in loads(data, hex)
     13     reader = WKBReader(lgeos)
     14     if hex:
---> 15         return reader.read_hex(data)
     16     else:
     17         return reader.read(data)

~/anaconda3/lib/python3.7/site-packages/shapely/geos.py in read_hex(self, data)
    438         """Returns geometry from WKB hex"""
    439         if sys.version_info[0] >= 3:
--> 440             data = data.encode('ascii')
    441         geom = self._lgeos.GEOSWKBReader_readHEX(
    442             self._reader, c_char_p(data), c_size_t(len(data)))

AttributeError: 'bytes' object has no attribute 'encode'

How can I resolve this issue?


texts:
I'm trying to create a parcel table from coordinates. My MapBasic scripts are below. Why don't I get any results showing on the map?

Create Table "parsel" (Parsel_Adi Char(10)) file "D:\data\parsel\parsel.tab" TYPE NATIVE Charset "WindowsLatin1"
Create Map For parsel CoordSys Earth Projection 8, 28,"m", 33, 0, 0.9996, 500000, 0
Map from parsel
Set Map Layer parsel Editable On
Create Region Into Variable obj_parsel 0
Alter Object obj_parsel Node Add ( 417000, 4401000)
Alter Object obj_parsel Node Add ( 418000, 4401000)
Alter Object obj_parsel Node Add ( 417000, 4403000)
Alter Object obj_parsel Node Add ( 418000, 4400300)
Insert Into parsel(Object, Parsel_Adi) Values (obj_parsel, "SEMIH")
Commit Table parsel Interactive


texts: Organizing JavaScript when using ArcGIS JS API?

texts:
The ArcGIS JS API (version 4.1) uses Dojo's implementation of the AMD module loader. I think it's simplest to use AMD modules in custom code too for compatibility. I'd love to be wrong but my understanding is that there's no escaping Dojo and AMD when using the ArcGIS JS API.

As an app grows it will typically require a large number of AMD modules in order to keep things organized. Dojo is going to make a separate http request for each module. There's going to be a lot of http requests on page load which the user will have to wait for.

I've tried concatenating multiple AMD modules into a single file using a js build tool (incidentally brunch.io) but it seems to be causing "multipleDefine" errors.

I'm interested in suggestions for organizing JS code in an app that uses ArcGIS JS API without making a large number of http requests. Wondering how others have solved this?

Somehow concatenating a large number of AMD modules into a small number of .js files?
Making their AMD modules very large so they don't need too many modules?
Tolerating a large number of http requests to fetch all their AMD modules?


texts: Package sp : coordinates function error no numeric matrix

texts:
I am trying to use coordinates function from sp package to transform my data in spatial data. I made sure I deleted all the NAs values and that all my data is numeric, however, i still get the same error.
I have checked in the package information about negative values, but it seems should not be the problem

require(adegenet)
require(pegas)
require(sp)
require(PopGenReport)
require(dplyr)
require(poppr)

Sites.sp <- Locations
SitesNA.sp<-subset(Sites.sp,!(is.na(Sites.sp["Latitude"]) |
is.na(Sites.sp["Longitude"])))

coordinates(SitesNA.sp) <- ~Latitude+Longitude
as.tibble(SitesNA.sp)

  coordinates(SitesNA.sp) <- ~Latitude+Longitude
  Error in .local(obj, ...) :
    cannot derive coordinates from non-numeric matrix

dput

  structure(list(A/A= c(NA, NA, 174, 173, 164, 152), YEAR = c("2016",
  "2016", "2014", "2014", "2013", NA), Collector = c("P. Carazo",
  "P. Carazo", "AubretTeam", "AubretTeam", "UllerTeam", "AubretTeam"
  ), Population = c("Istria, Pula", "Cres Island, Cres Township",
  "Ile d'Yeu Saint-sauveur", "Ile d'Yeu Port Joinville", "Vitre",
  "Taurignan Vieux"), Country = c("Croatia", "Croatia", "FR", "FR",
  "FR", "FR"), Abbreviation = c("Pula", "Cres Township", "YSS",
  "YPJ", "VR", "TV"), Latitude = c("44.849504000000003", "44.959245000000003",
  "46.706412999999998", "46.727950499999999", "48.124009999999998",
  "43.0276"), Longitude = c("13.849347", "14.404019999999999",
  "-2.3309148999999998", "-2.3523725999999998", "-1.2143999999999999",
  "1.1152"), Altitude = c(NA, NA, "NA", "NA", "91", "NA"), No.Samples = c("3",
  "3", "34", "No samples sent", "20", "30"), X__1 = c(NA, NA, NA,
  NA, "Geoff to confirm exact location", NA)), .Names = c("A/A",
  "YEAR", "Collector", "Population", "Country", "Abbreviation",
  "Latitude", "Longitude", "Altitude", "No.Samples", "X__1"), row.names = c(NA,
  -6L), class = c("tbl_df", "tbl", "data.frame"))


texts: Group by 2 fields in "Add autoincremental field" in QGIS Modeler

texts:
I'm creating a model in Modeler in QGIS3.4. I want to use a "Add autoincremental field" tool. I want to group my field by two other fields (it works when I set it "normally", not in Modeler). I think I have an error in syntax. I work in a polish version, so it is a window of "Add autoincremental field" opened through Modeler.

Now we're interested in a "Grupuj wartości według" -> it's "Group values by". I want to group by 2 fields: "sekcja" (it's integer filed) and "numer_inwe" (it's string field, but filled with numbers, so we can switch it to integer as well).
When I do it separatly it works, but the problem appears when I want to use both fields to group my table.

What syntax should I use if i want to group my table by 2 fields?


texts: Can we manipulate geojson data while display the polygon on map?


texts: Generating transects perpendicular to Shapely/Geopandas Line

texts:
I'm doing an analysis on transects going perpendicular to a 1000m topographical contour line and I'm struggling to find a good way to create evenly spaces transects perpendicular to that contour.

As a simplified version let's say I have a short shapely line:

from shapely.geometry import Point, LineString
LineString([Point(0, 0), Point(1, 4), Point(6, 7)])

Is there a good way for this simple case or for the case of this line being in a geopandas GeoDataframe to generate my transects?


texts: restore deleted temporary layer while QGIS is still running

texts: I have accidentally overwritten an important shapefile and some of my data seem to be lost now. However, I hope there is a way to restore some of it: I have run "count in polygons" tool recently on the by then still original shapefile in question. Unfortunately, I removed the result which was only stored in temporary layer. Is there a way to restore this temporary layer? I haven't closed QGIS (2.18), so I hope the respective layer is not deleted.


texts: ArcPy Cursor Where Clause to Delete Rows -- why is if statement needed?

texts:
I am writing a function to delete rows based on a certain value. The first code block below doesn't work; the second code block does work. I don't understand why I have to add the "if" clause to get it to work. Isn't the point of having a where clause (my sql variable) to select only the fields and rows that meet that condition?

Doesn't work, curious why?

def delRows(shp_in, fieldname, Val):
    """
    Delete rows based on values in specific fields
    :shp_in:            input shapefile for which rows are to be deleted
    :fieldname:         fieldname for finding value to delete
    :Val:               trigger value for row deletion
    """
    import arcpy
    sql = "'" + fieldname + "' = " + "'" + str(Val) + "'"
    print sql
    with arcpy.da.UpdateCursor(shp_in, [fieldname], sql) as cursor:
        for row in cursor:
            cursor.deleteRow()

#

Does work

def delRows(shp_in, fieldname, Val):
    """
    Delete rows based on values in specific fields
    :shp_in:            input shapefile for which rows are to be deleted
    :fieldname:         fieldname for finding value to delete
    :Val:               trigger value for row deletion
    """
    import arcpy
    sql = "'" + fieldname + "' = " + "'" + str(Val) + "'"
    print sql
    with arcpy.da.UpdateCursor(shp_in, [fieldname], sql) as cursor:
        for row in cursor:
            if row[0] == Val:
                cursor.deleteRow()

#

Edit
Here's the print-out of the sql statement as coded in both of the above:

'Site' = '0'

#


texts: How do I safely store paper/hardcopy maps?

texts:
What do I need to consider when deciding how to preserve paper maps safely from the ravages of time?

I am trying to understand some best practices when it comes to archiving and storing paper maps.

Some things one may have to consider...

Paper type, size, grain, acidity, mylar?
Plotters/Printers they come from (inks used)?
Do they have hand-drawn components from being marked up (felts, pens, pencils)?
Purpose of map (how often will it be used)?
Local weather (humidity,temperature)?
Are they laminated or should they be laminated?
Security!
How to deal with staff turnover (building a catalogue index for example)?
anything else...?

Based on some of the considerations above I would imagine proper storage of paper maps would help retain colours and paper size (less drying out!) for examples.

Background:

A majority of my work involves recording oral history on maps. These maps are often drawn on with pencils, markers, etc... Then that data is digitized, checked for redundancy and then mapped (in an nutshell that is).

So for example, these maps are often later retrieved to compare with proposed studies or other purposes and some maps are stored indefinitely.


texts:
I am trying to use a layer from LuciadFusion using the interface ILcdLayer.
https://dev.luciad.com/portal/productDocumentation/LuciadFusion/docs/reference/LuciadFusion/index.html?com/luciad/format/raster/TLcdJPIPModelDecoder.html
A layer can be declared with:
ILcdLayer aLayer = "http://localhost:8081/studio/index.html#/products/(layercode);
But it returns the error:

Type mismatch: cannot convert from String to IlcdLayer


texts: Getting value from Metadata in Python Script for attribute?

texts:
I am working on a python script to create some feature classes from dbf tables. As part of the script I would like to pull two values (FGDC "publication date" and ArcGIS Spatial Reference ArcGIS Coordiante System "Projection") from the metadata of a linear referencing feature class and write them to a field in the feature class. I've looked at some of the modules that parse .xml files, but the linear referencing feature class doesn't have a standalone .xml. Below is the part of the script where i'd like to pull and calculate the values.

#Pull COORDSYS and MAPVERSION from RCI Metadata

    #Calculate Values for Coordsys, Mapsource, MapVersion, publish date, CAR xfer date, coord xfer date
    today = datetime.date.today()
    pub_date = today.strftime("%m/%d/%y")
    arcpy.CalculateField_management(input,"COORDSYS",XXX,"PYTHON_9.3")
    arcpy.CalculateField_management(input,"MAPSOURCE",mapsource_ON,"PYTHON_9.3")
    arcpy.CalculateField_management(input,"MAPVERSION",XXX,"PYTHON_9.3")
    arcpy.CalculateField_management(input,"DTPUBLISHE",pub_date,"PYTHON_9.3")
    arcpy.CalculateField_management(input,"DTCARXTRCT",pulldate,"PYTHON_9.3")
    arcpy.CalculateField_management(input,"DTCOORDXTR",pub_date,"PYTHON_9.3")


texts: Problems with dynamic symbolizer in Chart Symbolizer extension on GeoServer

texts:
I have a layer on GeoServer with a time dimension which shows the number of overnight stays for a certain area in a given year. With the Chart Symbolizer extension, I would like to visualise the number of stays as a bar chart on top of the geometry. However, the dynamic symbolizer I am using does not seem to work because it returns the same value in the chart for each year. The SLD code I am using can be found below.

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/sld http://localhost:8080/geoserver/schemas/sld/StyledLayerDescriptor.xsd"
  xmlns="http://www.opengis.net/sld"     xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NamedLayer>
<Name></Name>
<UserStyle>
  <Name>Charts</Name>
  <FeatureTypeStyle>
    <Rule>
      <PolygonSymbolizer>
        <Fill>
          <CssParameter name="fill">#d3d3d3</CssParameter>
        </Fill>
        <Stroke>
          <CssParameter name="stroke">#000001</CssParameter>
          <CssParameter name="stroke-width">0.26</CssParameter>
          <CssParameter name="stroke-linejoin">bevel</CssParameter>
        </Stroke>
      </PolygonSymbolizer>
      <PointSymbolizer>
        <Geometry>
          <ogc:Function name="centroid">
            <ogc:PropertyName>the_geom</ogc:PropertyName>
          </ogc:Function>
        </Geometry>
        <Graphic>
          <ExternalGraphic>
            <OnlineResource
              xlink:href="http://chart?cht=bvg&amp;chs=100x100&amp;chd=t:${value/10}&amp;chf=bg,s,FFFFFF00&amp;chxt=x,y&amp;chxr=1,0,35000000" />
            <Format>application/chart</Format>
          </ExternalGraphic>
        </Graphic>
      </PointSymbolizer>
    </Rule>
  </FeatureTypeStyle>
</UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Where am I going wrong?


texts: Changing feature attribute just after adding via QgsFeatureSink

texts:
How can I access a feature and change its attribute value, I just added to a processing-output before via sink.addFeature(feature, QgsFeatureSink.FastInsert)?
Things like feature.id(specificfeatid)[fieldindex] = newattributevalue do not work.

To provide some background information:
I am working on a processing tool, where I need to change a features attribute, after it was added. Reason is that I want to add the total distance of a route (=iterinaries), I dont know when a part of a route (=leg) is created. So I am doing it like this in a PlugIn:
    # Creating the features here....
    route_leg_totaldistcounter += 1 # counting the number of legs of a route
    # END OF LOOP legs

# Update total distance here since it is the sum of all legs and not available in response jsons
attr_totaldistance = { fieldindex_position_of_routetotaldistance : route_total_distance } # only change totaldistance field, we get its position while building the dict
last_featureid_totaldistance = feature.id() # the last featureid of a route
first_featureid_totaldistance = last_featureid_totaldistance - route_leg_totaldistcounter + 1 # the first featureid of a route
for features_before in range(first_featureid_totaldistance,last_featureid_totaldistance): # loop through all legs of the current route
    routes_memorylayer_pr.changeAttributeValues({ features_before : attr_totaldistance }) # add the leg-sum of all legs of a route as totaldistance
# END OF LOOP iterinaries

Which is working just fine. But I can not use this method in my processing tool, since there is no layer and therefore no dataprovider available. So my processing tool attempt currently looks like:
    sink.addFeature(feature, QgsFeatureSink.FastInsert) # add feature to the output
    route_leg_totaldistcounter += 1 # counting the number of legs of a route
    # END OF LOOP legs

# Update total distance here since it is the sum of all legs and not available in response jsons
last_featureid_totaldistance = feature.id() # the last featureid of a route = current feature
first_featureid_totaldistance = last_featureid_totaldistance - route_leg_totaldistcounter + 1 # the first featureid of a route
for features_before in range(first_featureid_totaldistance,last_featureid_totaldistance): # loop through all legs of the current route
    #dings = feature.id(features_before)
    #dings.setAttribute(fieldindex_position_of_routetotaldistance,route_total_distance)
    #feature.id(features_before)[fieldindex_position_of_routetotaldistance] = route_total_distance
# END OF LOOP iterinaries

Any ideas how this can be done?


texts: Edit Sketch options for digitizing polygons

texts:
Trying my hand at building a methodology on QGIS as opposed to ESRI, and I'm having some issues with simple digitizing of irregular polygons.  The edit sketch graphic that appears when adding a new polygon feature is only transparent in the area where no coverage exists of previously added vertices.  The problem arises when trying to digitize a polygon that has internal angles.  It gets to a point in the digitizing that you can no longer see your base map to digitize from.  I have looked at QGIS digitizing options and how found nothing to adjust the transparency of the edit sketch polygon. so I might be able to see the underlying map as I digitize.  Screenshots below to illustrate my point.

Is there a way to combat this, other than to complete the polygon and then go in and modify individual nodes to position correctly?

[SOLVED] - By Jake below.  I missed the simple ability to modify the Alpha channel of the rubberband setting.


texts: Python GDAL writing image output all pixels as zeros

texts:
I have an array "array" with numbers range from -5 to 1 (with decimal) and I tried to write it as a geotiff. However, the output geotiff turns out to be all zeros. Can someone tell me why? Here the code.

from osgeo import gdal

ds = gdal.Open('test.tif', gdal.GA_ReadOnly)
driver = gdal.GetDriverByName("GTiff")
outdata = driver.Create('output.tif', array.RasterXSize, array.RasterYSize, 1, gdal.GDT_Float32)
outdata.SetGeoTransform(ds.GetGeoTransform())
outdata.SetProjection(ds.GetProjection())
outband = outdata.GetRasterBand(1)
outband.WriteArray(array)
outband.FlushCache()


texts: Why are KML/KMZ parts missing after upload to Google Maps?

texts:
I have a problem with a KMZ file uploaded to my Google Maps places:

As you can see I have a polygon KMZ file (converted from a shapefile in ArcMap) that has 12 parts but the Google Maps shows only four of them at once (i.e., on three separate views). How can I fix it so they're all visible? Any idea?

The KML is 3,9Mb that's why I made a KMZ that is 0,9Mb.


texts:
I am unable to display a kmz/kml file on Google Earth on Android. I got the file from here:
ftp://ecco2.jpl.nasa.gov/data5/GoogleEarth/Ocean%20Currents.kmz

I tried using KMZ to Earth Explorer.
I've put the files on Google Drive and imported them in Google Earth.
Either way, I just get a "blank" earth. I can see it correctly on Google Earth Pro on my PC.

What do I need to do?


texts:
I have two separate shapefiles (A&B) with road data that overlaps, but not in every place and they are very similar but do not line up perfectly. I want to compare them to each other, but they do not currently have a primary key, since they are from two different datasets.

First I tried Generating a Near table selecting only the closest B polygon to the A polygons, this worked however for some A polygons they had the same B Polygon so not all the B polygons were used.

What I need is a way so that every A polygon has a close B polygon that is only used for that one. Is there a way to do the near function so that each is only chosen once from shapefile B? It can be in python or I can pull them out and do it using SQL, I am currently using arc 10.4.


texts: Count the number of points of a multipoint-feature

texts: I try to use the fieldcalculator in QGIS 2.18 to count the number of points of a multipoint-feature. Is it possible?


texts: Get midpoint of SDE.ST_GEOMETRY polylines?

texts:
I have a polyline SDE.ST_GEOMETRY feature class in an Oracle 12c geodatabase (10.7.1).

I want to create a view on the feature class that has X and Y columns that contain the coordinates of the polyline midpoints.

I've noticed that while there is a centroid function for polygons, there isn't a midpoint function for polylines.

Is there a way to get midpoint coordinates of SDE.ST_GEOMETRY polylines with SQL?


texts: Using "Unnecessary Node Check", ESRI's Data Reviewer Extension

texts: Have been working with the ESRI's Data Reviewer Extension to identify unnecessary nodes.  The  "Unnecessary Nodes Check Properties" dialog implies that the result return (1) a node (if topology exists) or (2) a polyline (info topology exists).  I can't seem to get the dialog to return nodes only polylines and I have a topology built.  Any suggestions?


texts:
Trying to overlay a radar image(radar projection) on a mercator projected map, but have no idea about what a radar projection is.

So here are my quesions:

What is a radar projection?

What's its forward/backward formula?

Does proj4 or gdal/ogr support this projection?


texts: Magnifying bubble for water assets similar to a data frame inset

texts:
I work with the Water Dept for a municipality and enter water assets such as valves, pipes, manholes, etc., into ArcGIS Desktop. At times a physical map of the location of these assets is needed for the street crews (not a refined, pretty map but a basic, simple map). Valves, at pipe intersections, are constructed close to each other, and when a map is printed at the scale used to show the entire area that needs attention, the valve symbols appear as one blob of valves, or just as one valve, instead of many.

This would be similar to a data frame inset, but I need something that our street crews can create on their own, and they are not very ArcGIS literate.

Can I create a callout bubble similar in appearance to labeling call-out bubbles but shows targeted assets (instead of labelling) at a close-up view? This would show both a scaled-out area and the close-up of a specific intersection. And I would need a way to make this available when printing sections of a map display.

This is a general idea of what I’m looking for (created in Powerpoint)


texts:
I have a question about PythonWin.  Does it come with the DVD when you install it or does it have to be installed manually separately from the ESRI DVD ?

On my computer at work, it does not come with it, but when I am doing some training on Python I had to install it manually separate from the DVD .

Does PythonWin have to be within the ArcGIS folder under the Start Menu? My computer shows it has Python 2.7 folder but has no Pythonwin.


texts: NameError: name '**' not defined in ModelBuilder Calculate Value

texts:
This question follows up on Crianopa's answer https://gis.stackexchange.com/a/107687/126329 - I am attempting to do just this, but my model fails at the Calculate value stage. Using the expression from Crianopa "%value%"[0:6] I still get error message:

File "<expression>", line 1, in <module>
ERROR 000539: Error running expression: LT05_L1GS_099072_20050106_20161127_01_T2_sr_band7
Traceback (most recent call last):
NameError: name 'LT05_L1GS_099072_20050106_20161127_01_T2_sr_band7' is not defined

Would anyone know where I am going wrong? I'm in 10.4.1.

I'm not familiar with python so I seek a ModelBuilder solution.


texts: Numpy Array to ArcGIS GRID gives ValueError?

texts:
I have a numpy array saved to disk ( the numpy array is a depth image from a Kinect 360) and I want to convert that numpy array to an ESRI GRID. I have the simple code below to accomplish that task but I get the following error:

Traceback (most recent call last):
File "C:\gTemp\Text-1.py", line 4, in myRaster = arcpy.NumPyArrayToRaster(myarray,(0.0,0.0),1.0, 1.0, -99999.0 )

File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy__init__.py", line 2299, in NumPyArrayToRaster return _NumPyArrayToRaster(*args, **kwargs) ValueError: Argument in_array: A two or three dimensional NumPy array is required.

I am new to numpy and do not understand why I am getting this error. I am using ArcGIS 10.4

import arcpy
import numpy
myarray = r"E:\depthtester2.npy"
myRaster = arcpy.NumPyArrayToRaster(myarray,(0.0,0.0),1.0, 1.0, -99999.0 )
myRaster.save("E:\deptht")


texts: ERROR 4: Unable to open EPSG support file with gdal warp?

texts:
I'm trying to clip a raster with a polygon layer containing multiple features. To achieve my goal I'm trying to execute those commands lines on a batch file :

C:
cd C:\Program Files\QGIS 2.18\bin
gdalwarp   -cutline C:\poly1.shp -crop_to_cutline -of GTiff -cwhere "'id' =
'1'"   -r bilinear    C:\western_1.tif  C:\1_dma_western.tif
gdalwarp   -cutline C:\poly1.shp -crop_to_cutline -of GTiff -cwhere "'id' =
'2'"    -r bilinear   C:\western_1.tif  C:\2_dma_western.tif
gdalwarp   -cutline C:\poly1.shp -crop_to_cutline -of GTiff -cwhere "'id' =
'3'"   -r bilinear    C:\western_1.tif  C:\3_dma_western.tif
pause

unfortunately I get this Error :

ERROR 4: Unable to open EPSG support file gcs.csv.  Try setting the
GDAL_DATA environment variable to point to the directory containing EPSG csv
files.
ERROR 1: Did not get any cutline features.

Both, raster and  polygon layer are using the same EPSG.
I'm working with gdal which is  installed with qgis.


texts: Clipping Township and Range Grid to a shape in layout view

texts:
What I am trying to do is to create a map of a county with township and range labeled on the outside of the county boundary, specifically I do not want a rectangle frame with tick marks and labels around the border of the page but rather around the county boundary.  I created a custom overlay from a PLSS township and range feature class.  Then in layout view, I added the custom overlay as a grid in the data frame properties window then I clipped the data frame to the shape of the county.  I also checked the clip grids and graticule box. Unfortunately this does not do the trick, it adds that rectangle with tick marks and labels to a frame that borders the page edge and not around the county polygon.  I assume that this is happening because I created a custom overlay rather than a grid or graticule.

Does anyone know how to achieve my goal here shy of labeling with inserted text boxes?


texts: Selecting adjacent parcels with similar attributes in ModelBuilder

texts:
I am working on a project that is trying to identify shared ownership of adjacent parcels on abandoned industrial lands. I'm using ArcMap 10.2.2 and ModelBuilder right now. The first parts of my model work fine where I select parcels of a particular industrial type and I've dropped a 500m buffer on parcels to grab surrounding parcels. I now would like to select parcels that have the same property owner.

This is all working on a single layer right now. Is there a tool that allows me to check parcel attributes against themselves and return only adjacent parcels with shared ownership?