texts: Partitioning Line into Segments using ArcGIS Desktop?

texts:
I have a shapefile of U.S. states.  I extracted the boundary between two states, resulting in a line segment.  For example, the boundary between Georgia and North Carolina.

Is there a way to further divide this boundary into, say, units of 25 mile segments?

Similarly, is there a way to segment the line into equal length segments.  For example, taking this border segment, and dividing it into 3 segments of equal length.

I use ArcGIS 10.1 and ArcMap.

And if we have several lines to split (a few thousands)?


texts:
In practice the QGIS web client will be a companion to an existing cloud database with a portal and forms.  My intent is to run 'actions' (like in QGIS) where clicking on a feature launches the portal and the associated form.  Vice versa, clicking on a link in the database form will launch the web client and zoom to the feature.

Is this possible?  Any hints on how to make this happen in Web Client or the effort involved to make it possible?

Thanks!


texts: different data types in ArcMap field calculator?

texts:
I would like to run the following pre logic code in the Arcmap field calculator:

def calc(f, fn, f1, f1n)

f= str(f)
f1 = str(f1)

f = f.replace("  ", "")
fn = fn.replace("  ", "")
f1 = f1.replace("  ", "")
f1n = f1n.replace("  ", "")

if f+fn == f1+f1n:
    return "IDENTICAL"
elif f == f1:
    return "Same no diff. street"
elif fn == f1n
    return "diff no. same street"
else
    return "different"

where f and f1 are double and fn and f1n are string type fields. When I run it I get a syntax error for line 1. Could anyone help me spot it? This is the command

calc(!ADDRNMBR!, !ADDRNAME!, !ADDRNMBR_1!, !ADDRNAME_1!)


texts: I can't add a ArcGIS Feature Server Layer

texts:
4
I want to get the layer from

  http://3d-cpd.bangkok.go.th/ArcGIS/rest/services/BMA3D_2D_WMS_TTD/MapServer

and when I try to add a layer (via add new ArcGis Feature Server Layer)
I got the message

  Layer is not valid: The layer crs='EPSG:32647' filter=''
  url='http://3d-cpd.bangkok.go.th/ArcGIS/rest/services/BMA3D_2D_WMS_TTD/MapServer/15' table="" sql= is not a valid layer and can not be added to the map.
  Reason: AFSProvider getObjectIds failed: Error 400 - Unable to
  complete operation.

What is the cause of this? and could I get the data after all?


texts: I would like to create Mapnik style using Python API and export it to XML-file. Creating style part is clear enough API has sufficient documentation. But I wasn't able to find function that does the import of created style to XML. Does it exist?


texts: Photo has bright and darker on an aerial photo question

texts:
For those that work in photogrammetry world, my question is how can I correct this  old aerial photo that needed to be correct from a darker and bright black and white. I would have like to have both the same one black and white in either dark or bright.

I am not sure how to fix this black and white a easier way to do it ?

Is it possible for me to correct it from the right side into the left side to make the same one?

They are not mosaic. it is a digital file that i got from a contractor that scanned it from the film that was flown from 1938 on our national forest. It does not have coordinate system.
Here is the screen shot.


texts: Can I use the function ST_Buffer in meters with the projection EPSG:4326 on SpatiaLite?

texts:
I have a SpatiaLite database using the projection EPSG:31983 and I can see it inside QGIS as the following:

When I use the following query I can successfully create a buffer of 100 meters on a point of this database:
SELECT GEOMETRY FROM lotes WHERE ST_Area(ST_Intersection(ST_Buffer(ST_GeomFromText('POINT ( 339298.446287788 7391719.02695803 )', 4326), 100), lotes.geometry)) > 0 AND lotes.rowid IN (SELECT rowid FROM SpatialIndex WHERE f_table_name = 'lotes' AND search_frame = ST_Buffer(ST_GeomFromText('POINT ( 339298.446287788 7391719.02695803 )', 4326), 100));

So far everything is fine...
My problem is that I'd like to use the projection EPSG:4326 instead of the EPSG:31983. So, I've converted my SpatiaLite database to the EPSG:4326 projection with the following command:
ogr2ogr -s_srs EPSG:31983 -t_srs EPSG:4326 -f SQLite -dsco SPATIALITE=YES lotes4326.sqlite lotes.sqlite

However, even though this conversion was successful, I don't manage to make my old query work properly after this projection conversion. The query either returns all my database or it returns nothing... I've tried the following:
SELECT GEOMETRY FROM lotes WHERE ST_Area(ST_Intersection(ST_Buffer(ST_GeomFromText('POINT ( -23.5770487595231 -46.57464981079102 )', 4326), 100), lotes.geometry)) > 0 AND lotes.rowid IN (SELECT rowid FROM SpatialIndex WHERE f_table_name = 'lotes' AND search_frame = ST_Buffer(ST_GeomFromText('POINT ( -23.5770487595231 -46.57464981079102 )', 4326), 100));

I've read this other issue that is very similar to mine where it's recommended to use points.geom::geography,...)::geometry or "just cast to geography". But I didn't manage to make it work on the context of my query. And since that question is about PostGIS and not SpatiaLite I'm not sure if the same solution applies to SpatiaLite... What am I missing? How can I use ST_Buffer in meters while using the projection EPSG:4326?


texts: How to re-assign attributes based on spatial relationship

texts:
I want to re-assign the attributes of a table of regular polygons based on their spatial relantionship so that the polygons are clustered like this:

This essentially means to swap the attributes from one polygon to another based on some condition(s). This is the table behind the picture:

CREATE TABLE public.grid_attributes
(
  uid numeric NOT NULL,
  owner character varying(50),
  priority boolean,
  geom geometry(MultiPolygon,32630)
  )

The order/direction by which this clustering happens should (preferably) start from the polygons which are designated as priority of which there is one for each category I wish to use to cluster. That would be the ownerattribute.

My question (assuming I formulated this in an understandable way) is if SQL/PostGIS is right tool for this problem, and if it is how should I approach it/any hints?


texts: Measure Widget Issue - ArcGIS Javascript API 3.11

texts:
I am having an issue with the Measure Widget in my application after updating to 3.11.  The widget does not appear after the application loads.  I have checked my code and do not see an issue, also when reverting back to 3.10 it works correctly.

Has anyone else had this issue after updating to 3.11?

measurement = new Measurement({
    map: map
},
dom.byId("measure_results"));
measurement.startup();

UPDATE
The widget is actually working, but the "esriMeasurementButtonPane" is not being parsed.  See screenshot below:


texts: How to populate an undirected graph from PostGIS?

texts:
This question is more related to resources that I might not have identified yet, although I've been searching the web for a while.

In the project I'm working at the moment I need to run a shortest-path algorithm on a graph representing office rooms, corridors, stairs, lifts and routes between buildings.

For the presentation layer I thought of using Python scripting with MapServer, but now I'm giving more thought into how to build the graph from the (shapefiles conveted into a) postGIS db generated from OpenEV so that it's easy to add and remove edges or weights or information about the points afterwards.

For Python there's a module called networkX that deals with graphs, and although this issue has been brought up in stackexchange here, the graph I'm trying to build is not a digraph but an undirectional one.

Update:
5 days ago Ben Reilly's utilitynetwork has been added to the networkX project. Utilitynetwork builds a directed graph from shapefile features.
The questions remains open for a similar approach of reading features from the postGIS database.


texts: Buffer function crashing QGIS only on specific data set

texts:
I'm trying to run the buffer tool on a line and it keeps crashing Qgis.  The line is created by merging two sets of gps point data and running points to lines with  gps_date as the order. I have no problem with it working on other data sets but for some reason there are two data sets that cause the buffer to crash the program. Any idea on what would cause this?

The data doesn't look corrupted and Qgis is outputting a .dmp file but I don't understand what it's indicating.


texts:
Is possible to get the data in this example? I mean something like:

map = cartodb.createVis ...
map.data.each ...

?

Or, where in documentation can I find something about it? or, which keyword should I look for?


texts: Extracting Point shapefile with Lat/Long in GEE

texts: I have my ROI's (point shp) for classification in GEE. I am able to export those Feature-Collections, but unable to export with Lat/Long and other values in attribute table.


texts: Whitebox GAT breaks when opening map document

texts:
I really enjoy using Whitebox GAT for spatial analysis, in particular DEM/hydrological modeling- though I'm having a consistent issue trying to open saved maps.

Every time I try to open a wmap file, a blank prompt (titled "message") pops up with an "ok" button.  Either the prompt pops up many times causing Whitebox GAT to break (with me having to use task manager to end task), or it pops up once and I click ok.  In the latter case, after I click ok my layers (raster files) associated with the map don't show up.

I'm not particularly adept at understanding xml log files, but there are messages about "error in MapRenderer" and "java.lang.NullPointerException" in the log files.

Does anyone have suggestions on how to avoid these map renderer/other issues?

I'm running Whitebox GAT on Windows 7 pro.


texts: Dotspatial SpatialToolStrip buttons disabled

texts: I have a stand alone map application that uses the DotSpatial.Controls.SpatialToolStrip control, when I added it to the form, only the 'Print' button is enabled, while all others are disabled. I went in to "Edit Item..." and set Enabled to True for all buttons, but when I run the application, all buttons are still disabled. How to turn them on?


texts:
I tried to convert a polygon shapefile of classified land cover to raster using 'Rasterize (vector to raster) tool in GDAL. I chose the DN field, set output ratser size unit to pixels and chose the same layer extent as output extent. I get the following error:
GDAL command output:
*ERROR 1: Wrong value for -ts parameter.
Usage: gdal_rasterize [-b band]* [-i] [-at]
{[-burn value]* | [-a attribute_name] | [-3d]} [-add]
[-l layername]* [-where expression] [-sql select_statement]
[-dialect dialect] [-of format] [-a_srs srs_def] [-to "NAME=VALUE"]*
*[-co "NAME=VALUE"]* [-a_nodata value] [-init value]*
[-te xmin ymin xmax ymax] [-tr xres yres] [-tap] [-ts width height]
[-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}] [-optim {[AUTO]/VECTOR/RASTER}] [-q]
<src_datasource> <dst_filename>**

What should I change to rasterize this polygon?


texts: How to construct a line tangent to a curve from a point using PyQGIS

texts:
ArcGIS Enterprise SDK has something like this:
public void QueryTangent (
    esriSegmentExtension extension,
    double DistanceAlongCurve,
    bool asRatio,
    double Length,
    ILine tangent
);

Given a distance along the curve specified either as a ratio of the length or as a specific fixed distance, QueryTangent returns the Line tangent to the Point.

I wonder if anything like this exists in QGIS Python API? If not, is it possible to implement this function from scratch?


texts:
I get a following python error while working with QChainage-tool in QGIS 3.2. Because of that (assumably) the OK-button is also greyed out. My goal is to retrieve start and end points of line features.

Is there anyone capable of telling me whether this a result of plugin being still experimental in QGIS 3?


texts:
I've just started a Python Scripting tutorial on QGIS. The problem arrives right at the end, when I have to use this script:

output_file = open('c:/Users/Ujaval/Desktop/airports.txt', 'w')
for f in layer.getFeatures():
  geom = f.geometry()
  line = '%s, %s, %f, %f\n' % (f['name'], f['iata_code'],
          geom.asPoint().y(), geom.asPoint().x())
  unicode_line = line.encode('utf-8')
  output_file.write(unicode_line)
output_file.close()

Please note that the PATH used is another one, and that's my big problem as I tried several alternatives on how to write it, examples:

output_file = open('D:\ne_10m_airports', 'w')
IOError: [Errno 22] invalid mode ('w') or filename: 'D:\ne_10m_airports'

output_file = open('C://Users//Florin//Desktop//ne_10m_airports', 'w')
IOError: [Errno 13] Permission denied: 'C://Users//Florin//Desktop//ne_10m_airports'

output_file = open('C:/Users/Florin/Desktop/ne_10m_airports', 'w')

output_file = open('C:\Users\Florin\Desktop\ne_10m_airports', 'w')

I can't really seem to figure out why it's being denied permission. In any case, the error is either: permission denied, invalid mode or filename. (Tried it with double quotes as well).


texts:
I'm using ArcGIS 10.3.

I need to create a grid where all the points are vertexes of triangles that do not overlap themselves.
I want this to be done by only using the points location, no elevation or any 3D data. Just a plain polyline. Is this possible?


texts: I've downloaded QGIS 2.0 and have opened a project. All the layers are there, but it will not show the selections on the map. The attribute table shows the selected items. Am I missing something or is there some other cause?


texts: Resampling for cellsize when exporting raster to GeoTIFF - GM

texts:
I used Global Mapper v20.0 for exporting the raster image GeoTIFF (32bit, from cellsize x= 0.008333333333000000898 arcdegree, y= 0.008333333332999999163 arcdegree) to cellsize x= 0.008333333332999999163 arcdegree, y =0.008333333332999999163 arcdegree. I need it to be the exact size, but Global Mapper doesn't make any changes to the cellsize, keeping the original size.
Before, I tried with gdalwarp tool(QGIS v3.14.1) but for some reason, the mask layer is not found, getting the following error: Could not load source layer for MASK: C: /Users/Bio/Desktop/try2.asc not found. Also, I tried with Extract by mask (ArcMap v10.6.1) and it worked but it changed the raster extension even if the raster mask have the exact extension I need.
Can anyone give me a solution?


texts: How to set the Measure Tool Ellipsoid Default Behavior?

texts:
Using QGIS 2.6.0 Brighton, I want to overlay a shapefile (EPSG: 26910, Nad83 UTM10) over OpenLayers Google Satellite (EPSG: 3857, Pseudo Mercator), and reliably measure distances. Furthermore, I want to teach with little knowledge of coordinate systems how to do so.

The process is to add the shapefile, then add Google Satellite. The project CRS switches to EPSG:3857, and the shapefile is correctly overlaid (well, sometimes imagery shows up in the wrong place, but that's another question). The measure tool does not report correct distance - not surprising, since the CRS is 3857. I do not want to change the CRS because then imagery shifts unexpectedly. So, I change the measure tool ellipsoid in Project Properties to 'GRS 1980'. Hit 'OK' to return to map. The measure tool reports correct distance.

However, if I ever open Project Properties again, the measure tool ellipsoid has defaulted back to 'None/Planametric'. If I hit 'OK' to return to map, the measure tool now reports incorrect distance, presumably because the map plane is unprojected.

Since I seem to be stuck using EPSG:3857 to accommodate OpenLayers, how can I change the default measurement ellipsoid?


texts: Creating a Point at a specific distance between two Points

texts:
I am trying to create a new point shapefile and I am unsure how to create it.
I want to create a new series of points that would be based on a specific distance between two points in an existing point data set.

I have already created an attribute table with two target points that the new point should be in-between and a specified distance that the new point should be away from one of the points towards the direction of the other point.

For example,
New point A  should be between existing point 1 and point 2, 60m from point 1 towards point 2
New point B  should be between existing point 2 and point 3, 80m from point 2 towards point 3
New point C  should be between existing point 3 and point 4, 106m from point 3 towards point 4
etc.

I am sure there are tools that can do this in ARC, but I am unsure what to use or how to get started.


texts: Map matching of one sided road data to two sided road data

texts:
we use BOS method (Goodchild and Hunter,1997) for checking the positional accuracy of test map dataset by buffering around the reference dataset and then check for percentage coverage of test dataset in that buffer.

In case while comparing the road dataset there is a possibility that one dataset contains roads represented as a single side (bidirectional traffic flow on the same road) and same road in the second dataset is having two sides (unidirectional traffic flow).  Please suggest how can we compare such datasets.


texts: Problem loading PostGIS (Postgres) View layer in QGIS

texts:
Why is Postgres user XX via command „Add PostGIS Layers“ in QGIS enabled upload only View tables which owns?
Or how to achieve it to the user XX via PostGIS can load View table which owns the user YY?

Main table from the database with different users are assigned by rolls, however the View tables we could not find that there is a possibility of assigning rolls.

Any idea how solve this problem?


texts: Geoserver WPS clip and ship on Layer group?

texts:
Is it possible in geoserver to clip on a layer group rather then a single layer. I have the scenario where i would like to enable the user to extract vector data as zip but not from only a single layer but combination of layers. At the moment the Clip WPS function only accepts a single layer as input. What could the possible solutions for this?

like combining all zip files into a single zip file or using sub processes?


texts: Getting closest point on road to point in Google Maps using Python?

texts:
I need to find the closest point on a road to a external point. I need to do it without downloading the data (I don't know if this is possible in Google Maps) nor using PostgreSQL. I know some Python wrappers to Overpass for using OpenStreetMap, where is easy to use the function 'around', which is I need. But is possible to do the same for the free API of Google Maps?

I've asked a similar question in Getting closest point on road to point in OpenStreetMap using Python?, but with OpenStreetMap. What about Google Maps?


texts: "QgsVectorFileWriter.writeAsVectorFormat(): arguments did not match any overloaded call" in PyQGIS

texts:
The following code iterates through a folder of .xyz files and is supposed to copy them into another folder.

for file in glob.glob("*.xyz"):
    uri = "file:///" + inputDir +"/"+ file + "?type=csv&delimiter=%s&crs=%s&xField=%s&yField=%s" % (" ", crs, "field_1", "field_2")
    name = file.replace('.xyz', '')
    lyr = QgsVectorLayer(uri, name, "delimitedtext")
    outputPath = outDir + file
    QgsVectorFileWriter.writeAsVectorFormat(lyr, outputPath, 'utf-8', lyr.crs(), "CSV", layerOptions='GEOMETRY=AS_XYZ')

However, I get the following error message:

  TypeError: QgsVectorFileWriter.writeAsVectorFormat(): arguments did not match any overloaded call:   overload 1: argument 'layerOptions' has unexpected type 'str'   overload 2: argument 4 has unexpected type 'QgsCoordinateReferenceSystem'   overload 3: argument 3 has unexpected type 'str'

  Traceback (most recent call last):   File
  "C:/Users/denni/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Clip_XYZ\Clip_XYZ.py",
  line 283, in run
      self.moveFiles()   File "C:/Users/denni/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Clip_XYZ\Clip_XYZ.py",
  line 251, in moveFiles
      QgsVectorFileWriter.writeAsVectorFormat(lyr, outputPath, 'utf-8', lyr.crs(), "CSV", layerOptions='GEOMETRY=AS_XYZ') TypeError:
  QgsVectorFileWriter.writeAsVectorFormat(): arguments did not match any
  overloaded call:   overload 1: argument 'layerOptions' has unexpected
  type 'str'   overload 2: argument 4 has unexpected type
  'QgsCoordinateReferenceSystem'   overload 3: argument 3 has unexpected
  type 'str'

I don't understand the error. When I check the documentation, layerOptions is a str, argument 4 is the crs, and argument 3 is also a str.

Are the docs wrong? Or is there something else wrong with my code?


texts: data ASCII to .TIFF batch conversion (translate) error -QGis

texts:
I have multiple ASCII file that i want to convert into .iff file. They are saved in a separate file on my pc. I have also importet the all in QGis. To convert them to .tiff format i have used:

raster -> conversion -> translate -> tick "batch mode" in upper right -> select directories for input and output file -> select format ...

it freezes. Am i doing something wrong? The data file are not that large as to crach QGis.


texts: Export attributes of shapefiles into text file

texts:
I'm trying to export attributes of multiple shapefiles a text file. I am multiple getting errors when I run my code not sure what the issue is.  Any direction as to where to start to fix this would be helpful.

  File "C:\users\Export.py", line 7, in
      fclist = arcpy.ListFields(table)   File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy__init__.py", line 1119, in
  ListFields
      return gp.listFields(dataset, wild_card, field_type)   File "C:\Program Files
  (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\geoprocessing_base.py", line
  344, in listFields
      self._gp.ListFields(*gp_fixargs(args, True))) RuntimeError: ERROR 999999: Error executing function.

Heres my code:
    import arcpy
    from arcpy import env

arcpy.env.workspace = "C:\\user\\rainfiles"
table = "C:\\user\\rain_files"
outWorkspace = "C:\\user"
fclist = arcpy.ListFields(table)
field_names = [field.name for field in fclist]
for field in fclist:
    with open(r'C:\\user\\Exports.txt', 'w') as f:
        for field in fclist:
            f.write(field + '\n')
with open(r'C:\\user\\Exports.txt', 'r') as f:
    w = csv.writer(f)
    w.writerow(field_names)
    for row in arcpy.SearchCursor(table):
        field_vals = [row.getValue(field.name) for field in fclist]
        w.writerow(field_vals)
    del row


texts: How to use geometry functions in rule based styling?

texts:
Edited:

I'm trying to style some OSM data such that short fences, walls, etc just don't render. I only want to display barriers over some certain length. I've tried this rule,

tags LIKE '%barrier%' AND ($length > 100)

and quite a few variations on it, finally getting

tags LIKE '%barrier%' AND $length > 0.001

to do about what I want. Clearly, I don't know what units this is measuring in. It was awkward getting it to work though because while the "test" button next to the formula always gave me no results, the actual map stopped drawing the shorter fences like I wanted.

Indeed, the test button doesn't seem to want to work with any length attribute, as even

tags LIKE '%barrier%' AND $length != 0

returns "no results". So I guess my question now is: Am I doing something wrong, or is this a bug?


texts: Shapefile encoding problem in QGIS 1.9.0 (built with GDAL 1.9.2)

texts:
I have Googled a lot but failed to find the answer.

My configuration is:

Ubuntu 11.10
Quantum GIS - 1.9.0-Master 'Master' (caae7b7)
GDAL 1.9.2, released 2012/10/08

Shapefiles refuse to open in correct encoding. I have some of them in CP1251 encoding.  It seems that the problem is already solved.
http://trac.osgeo.org/gdal/ticket/4650

I have the latest GDAL library and nothing helps.

Can anyone tell me how to debug GDAL? How can I understand if GDAL handles shapefile correctly (in terms of encoding)?


texts: Which file types does ArcGIS Online support when adding feature attachments?

texts:
I know ArcGIS Desktop allows you to add any file type, whereas ArcGIS Online allows you to add specific file types as attachments.

Is the list of supported ArcGIS Online file types documented?


texts:
I am using Esri's Operations Dashboard and trying to insert a hyperlink into the Feature Details widget. The problem appears to be the '&' symbol. When the hyperlink is clicked, the '&' sign disappears in the url and I receive an error message.

To account for the HTML I entered this:

Which became this:

And resulted in this:

And displayed this error message:


texts: How can i load GeoJSON data into SQL Server 2016?


texts: Is there any Open Source GIS Software for Android in which we can perform Various Geoprocessing Operations (like Buffering,union and intersection) and that should be  customizable eg: what we do in QGIS which is Desktop Based.


texts:
I am developing an ArcGIS extension with .NET and Desktop 10.1
The extension is creating an sde connection file on the fly and connect to the database
When the user use any of the toolbox like (Select tool from the toolbox) and use one of the layers, the dialog box "Database connection" will be popup and ask the user of user name / password.

Is there a way to listen in the extension to those dialog boxes and fill them automatically.
Or is there a way to listen to toolbox usage of the layers and pass the user name / password?

thanks


texts: How to move the previous marker in ArcGIS JavaScript 3.30?

texts:
I have latitude and longitude from a third party API and I would like to show the marker on map depending upon that latitude and longitude. When new data comes from the API I need to remove previous marker and new marker depend upon the data.

I am using below code to show the marker one time, next time no errors in console but nothing to show. Any idea to automatically move the previous marker to new location or delete the previous marker and new one as the layer of the map?

Here is the JavaScript code:

function addmarker(latt, longtt) {
    polygraphlayer.clear();

        var pt1 = new Point(Number(longtt), Number(latt));
        var markersymbol1 = new PictureMarkerSymbol('images/marker.png', 10, 15);

        polygraphlayer.add( Graphic(pt1, markersymbol1));

        }


texts: Writing Python Script to get equal name as given and compare to multiple shp file in folder and copy selected shp file to new folder?

texts:
Need to go through multi shp file in a folder and copy a single feature which has the same name as entry to the new folder with staying same name and format. I create a piece of python code that can go through each shp file and also can to the output folder but, I can’t get any output. Any suggestion or concern please.

import arcpy
from arcpy import env
import os
arcpy.env.overwriteOutput = True
Match_FC='Feature_Compare_01'
env.workspace =r'C:\Users\OutputTool\LineData\Separated Parcels'
output=r'C:\Users\Desktop\New Folder'
fcList = arcpy.ListFeatureClasses()

# Copy shapefiles to N folder-After looking with -9 characters
for fc in fcList:
  if fc[-9:]==Match_FC:
    arcpy.FeatureClassToFeatureClass_conversion(fc, output,'{}_new'.format(fc))


texts: Input Widget Class that can take values above 99

texts:
I developed a plugin in which the user can add a length of a line and than the line gets created.

in QtDesigner I used a Spin Box. However, I just realized that a Spin Box takes only values to 99. 300 ist not possible.

Than I thought I could use a Line Edit instead but when running the tool I get the error message "'QLineEdit' object has no attribute 'value'". Is there a Widget I can use so that the user can enter lenghts above 99?


texts: Arcpy Export to PDF, loop Element Text to change with each PDF

texts:
I am building a script that exports pdfs based on user input, each pdf will need a different date (not current) that the data was updated per the data driven attribute.  The script runs fine but is only taking the last user input.  I'm getting stumped in trying to figure out how to make the element text change with each pdf that is exporting.

# Export maps to pdf
ddp = mxd.dataDrivenPages
pageNumbers = sys.argv[5]
pgIndex = ddp.currentPageID
text_elements = arcpy.mapping.ListLayoutElements(mxd,"TEXT_ELEMENT")

for pageNum in pageNumbers.split(", "):
    ddp.currentPageID = int(pageNum)
    pageName = ddp.pageNameField.name
    for element in text_elements:
        if element.name == 'My Text Field':
            if (pgIndex == 1):
                element.text =  sys.argv[6]
    for element in text_elements:
        if element.name == 'My Text Field':
            if (pgIndex == 2):
                element.text =  sys.argv[7]
    for element in text_elements:
        if element.name == 'My Text Field':
            if (pgIndex == 3):
                element.text =  sys.argv[8]

    arcpy.mapping.ExportToPDF(mxd, r"C:\test\\"".pdf", image_quality="BEST", resolution="300")
mxd.save()
del mxd


texts: Using ArcPy/iterator to generate map when zoomed to each feature of shapefile?

texts:
I am creating a series of maps featuring a certain set of layers (floodplain zone and critical facilities). Each map will zoom in one of our municipalities (there are 62 in total). It's an utterly repetitive process so I am trying to find a way to automate. An example of the map will be like the pictures shown below:

I zoom to the Bethlehem City, export the map

Then I zoom to another municipality and export the map.

There must be a way to automate this. My initial thought was to iterate through feature selections using iterator in ModelBuilder. Then I got stumped on the "Zoom in" and "Export Map" steps. I couldn't even find tools that do these. But I think there shall be ways to do both of these steps through ArcPy. I wish my ArcPy skills were better, but I guess this is the kind of pain that will push me to learn more about Python.


texts: Write a script to create a new feature class and add the point objects of geometry to that feature class


texts: How check in python, cmake or c++ if ArcGIS license is valid

texts:
I'm trying to programmatically check if the ArcGIS license is valid.  I want to query the license validity either in cmake or in c++.  There are also python scripts associated with cmake.  I'd handle the license info in two different possible ways.  I tried looking for how to query the license validity, but can't find anything online.  I don't want to check it as an administrator.  I have code that uses ArcGIS that we want to query/handle that info.

In cmake I'd take this info and set some definitions I can use later to not run tests when the license isn't valid.  or,
In the c++ code, if I could query the license status, I could use that info to not run tests.

I did see this link for CheckProduct, but it doesn't identify what language they are showing the example in (not c++).  I'm not sure if CheckProduct would work for c++, python, or cmake.


texts:
I need to use a fullscreen plugin(Leaflet.fullscreen) but it does not work as I would like.

The image is displayed in full screen but with gray edges.
Like this :

Code :

//Creation de la map
var map = L.map('mapid',{
              zoomSnap: 0,
              fullscreenControl: true});
//On bloque le zoom et le dragging
map.touchZoom.disable();
map.doubleClickZoom.disable();
map.scrollWheelZoom.disable();
map.boxZoom.disable();
map.keyboard.disable();
map.zoomControl.remove();
map.dragging.disable();

//Création de la taille de la carte avec les coordonnées polaires
var coinGauche = new L.LatLng(43.6421,3.9626);
var coinDroit = new L.LatLng(43.6571,3.9909);
var bounds = new L.LatLngBounds(coinGauche,coinDroit);
map.fitBounds(bounds);

// Initialise le FeatureGroup pour sauver les items
var drawnItems = new L.FeatureGroup();
map.addLayer(drawnItems);

// Initialise draw control et passe le FeatureGroup pour sauver les items
var drawControl = new L.Control.Draw({
    edit: {
        featureGroup: drawnItems //OBLIGATOIRE
    }
});
map.addControl(drawControl);

//Image a mettre dans la carte
var imageUrl = 'file:///C:/Users/XXX/Desktop/geofencing/map.svg'

//Creation de l'overlay avec la carte
var overlay = L.imageOverlay(imageUrl, bounds);
map.addLayer(overlay);

But,I would like the image to really take the whole screen.
Any formats (16/9 4/3 or 16/10) display with gray edges...


texts: Is there a metric projection that works everywhere in the world? If not, what's the smallest set of EPSG codes for that?

texts:
I'm doing some calculations per country, using rgeos library in R. For each country, I need to calculate the bounding box area. So I transform the country's bounding box in a sp object, project it into an UTM coordinate system, and finally calculate the area:
library(rgdal)
library(rgeos)
wb <- readOGR('.','WorldBorders')
for (i in 1:nrow(wb)) {
    bb <- bbox2SP(bbox=bbox(wb[i,]))
    bb <- spTransform(bb,CRS('+init=epsg:31998'))
    gArea(bb) # use this value somewhere
}

Only after Ethiopia has given an error, I noticed that EPSG 31998 is only to South America. However, my code worked for countries even farther, such as Afghanistan, Australia, China...
The error may be repeated following this steps:
bb <- bbox2SP(14.88361,3.406389,32.991104,47.98824)
bb <- spTransform(bb,CRS('+init=epsg:31998'))

non finite transformation detected:
[1] 47.988240  3.406389       Inf       Inf
Error in .spTransform_Polygon(input[[i]], to_args = to_args, from_args = from_args,  :
  failure in Polygons 1 Polygon 1 points 4
In addition: Warning message:
In .spTransform_Polygon(input[[i]], to_args = to_args, from_args = from_args,  :
  1 projected point(s) not finite

So my question is: is there any EPSG code that I can use anywhere in the world to calculate area in meters? Or will I have to use different codes in different places? In this case, what is the minimum set of EPSG codes that should I use?


texts: Remove/hide the long connecting line in plotting GeoJSON linestring using Leaflet

texts:
I encounter this long connecting line when plotting a GeoJSON linestring.
How do I hide/remove this connecting line?

When I plot it in linestring:

When I plot it manually (slower than using linestring):

<Map
  style={{ height: "400px", width: "100%" }}
  zoom={1.5}
  center={[
    this.state.passes.coordinates[0][1],
    this.state.passes.coordinates[0][0]
  ]}
  scrollWheelZoom={false}
  maxBoundsViscosity={1.0}
  maxBounds={bounds}
>
  <TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" />
  <GeoJSON
    color="red"
    data={this.state.passes}
    onEachFeature={function(feature, layer) {
      layer.on("click", onLineClick);
      layer.bindPopup(createPopupContent(feature));
    }}
  />
  <Marker position={this.state.marker} icon={iconSatellite} />
</Map>


texts: Programmatically Enable/disable input parameters in a QGIS Processing plugin

texts:
Is there a way to enable/disable a parameter by a checkbox in the processing interface? In my screenshot below, I would like to disable the Output Wall Aspect Raster when the Calculate wall aspect checkbox is ticked off.

Code is shown below:

class ProcessingWallHeightAscpetAlgorithm(QgsProcessingAlgorithm):

INPUT_LIMIT = 'INPUT_LIMIT'
INPUT = 'INPUT'
OUTPUT_HEIGHT = 'OUTPUT_HEIGHT'
OUTPUT_ASPECT = 'OUTPUT_ASPECT'
ASPECT_BOOL = 'ASPECT_BOOL'

def initAlgorithm(self, config):
    self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT,
            self.tr('Input building and ground DSM'),
            None, False))
    self.addParameter(QgsProcessingParameterBoolean(self.ASPECT_BOOL,
        self.tr("Calculate wall aspect"),
        defaultValue=True))
    self.addParameter(QgsProcessingParameterNumber(self.INPUT_LIMIT,
        self.tr("Lower limit for wall height (m)"),
        QgsProcessingParameterNumber.Double,
        QVariant(3.0),
        minValue=0.0))
    self.addParameter(QgsProcessingParameterRasterDestination(self.OUTPUT_HEIGHT,
        self.tr("Output Wall Height Raster"),
        None, False))
    self.addParameter(QgsProcessingParameterRasterDestination(self.OUTPUT_ASPECT,
        self.tr("Output Wall Aspect Raster"),
        None, False))

def processAlgorithm(self, parameters, context, feedback):
    outputFileHeight = self.parameterAsOutputLayer(parameters, self.OUTPUT_HEIGHT, context)
    outputFileAspect = None
    dsmin = self.parameterAsRasterLayer(parameters, self.INPUT, context)
    aspectcalculation = self.parameterAsBool(parameters, self.ASPECT_BOOL, context)
    walllimit = self.parameterAsDouble(parameters, self.INPUT_LIMIT, context)

    provider = dsmin.dataProvider()
    filepath_dsm = str(provider.dataSourceUri())
    gdal_dsm = gdal.Open(filepath_dsm)
    dsm = gdal_dsm.ReadAsArray().astype(np.float)

    feedback.setProgressText("Calculating wall height")
    total = 100. / (int(dsm.shape[0] * dsm.shape[1]))
    walls = wa.findwalls(dsm, walllimit, feedback, total)
    wallssave = np.copy(walls)
    feedback.setProgressText(outputFileHeight)
    saverasternd(gdal_dsm, outputFileHeight, wallssave)

    if aspectcalculation:
        total = 100. / 180.0
        outputFileAspect = self.parameterAsOutputLayer(parameters, self.OUTPUT_ASPECT, context)
        feedback.setProgressText("Calculating wall aspect")
        dirwalls = wa.filter1Goodwin_as_aspect_v3(walls, 1, dsm, feedback, total)
        saverasternd(gdal_dsm, outputFileAspect, dirwalls)
    else:
        feedback.setProgressText("Wall aspect not calculated")

    return {self.OUTPUT_HEIGHT: outputFileHeight, self.OUTPUT_ASPECT: outputFileAspect}

def name(self):
    return 'Urban Geometry: Wall Height and Aspect'

def displayName(self):
    return self.tr(self.name())

def group(self):
    return self.tr(self.groupId())

def groupId(self):
    return 'Pre-Processor'

def shortHelpString(self):
    return self.tr('Here (shortHelpString()) we can write short information string about this tool.')

def helpUrl(self):
    url = 'https://umep-docs.readthedocs.io/en/latest/pre-processor/Urban%20Geometry%20Wall%20Height%20and%20Aspect.html'
    return url

def tr(self, string):
    return QCoreApplication.translate('Processing', string)

def createInstance(self):
    return ProcessingWallHeightAscpetAlgorithm()


texts: Colorify polygons in a pythonic way in Qgis

texts:
I want to addd a Layer  and give the layer a color for the border and for the filling. With the code below i am possible to achieve a color for the border, but a did not found a solution to give a color for the filling. In addition, is it possible to change the width of the border line?

uri.setDataSource("shema_name", "layer_name", "geom","","layer_name_id")
lyr = QgsVectorLayer(uri.uri(), "layer_name_you_like", "postgres")

props = { 'color_border' : '255,165,0,125', 'style' : 'no', 'style_border' : 'solid' }
s = QgsFillSymbolV2.createSimple(props)
lyr.setRendererV2( QgsSingleSymbolRendererV2( s ) )

QgsMapLayerRegistry.instance().addMapLayer(lyr)


texts: ArcGIS 10 Add-In compile problem - Why are new edits to code igonred by ArcMap?

texts:
I've been compiling and debugging my Add-In (a toolbar with a few menus, custom commands, custom selection tool and a context shortcut menu) with no issues until suddenly the edits and changes I do in Visual Studio are reflected in the Add-In. There are no errors and compile success. I first noticed this when I was wanting to debug but application was ignoring new edits and additions.
The Add-In is still there but some commands don't seem to not respond to current changes.

What am I doing wrong?


texts:
I'm having some problems with GdalTools on QGIS 1.8, with MacOsx 10.8: I've the GDAL complete library 1.9 but ECW is still a not supported format.

What should I do?


texts: How to remove Leaflet tooltip label collision

texts:
I am using a permanent tooltip on each marker but the problem is that tooltip texts are overlapping each other and markers are updating every 10 seconds interval. I can't use LayerGroup collision because I need to show markers. I can't find any solution to solve this issue. I tried labelgun but no luck. I used BingMap before in my project and BingMap manages this overlapping issue internally.
Here is my sample code

   let marker = L.marker(pos, {options});
   marker.bindTooltip(vehicleName, {
                       direction: 'auto',
                       permanent: true,
                       className: "my-labels",
                       offset: L.point(5,15)
   });

   newLayer.addLayer(marker);
   newLayer.addTo(map);

See below image how BingMap shows label


texts:
I have a Tiff:
D:\10000>gdalinfo 10000_EPSG2536_2.tif
Driver: GTiff/GeoTIFF
Files: 10000_EPSG2536_2.tif
Size is 58954, 54068
Coordinate System is:
PROJCS["unnamed",..]
Origin = (1450324.596294234700000,438752.955720250490000)
Pixel Size = (1.037488337128723,-1.037488337128723)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 1450324.596,  438752.956)
Lower Left  ( 1450324.596,  382658.036)
Upper Right ( 1511488.684,  438752.956)
Lower Right ( 1511488.684,  382658.036)
Center      ( 1480906.640,  410705.496)
Band 1 Block=512x512 Type=Byte, ColorInterp=Palette
  NoData Value=255
  Color Table (RGB with 256 entries)
    0: 0,0,0,255
    1: 255,255,255,255
    2: 0,0,0,255
    ...
    254: 0,0,0,255
   255: 0,0,0,0

And in QGIS it's looks like:

Here is OMS and my rastr above. So white is transparent.
How can i remove NoData Value and Metadata tags from TIFF?


texts: Getting "Segmentation fault: 11" with ogr in Python

texts:
This is the code I'm trying to run:

In [1]: from osgeo import ogr

In [2]: datasource = ogr.Open('testdata.shp')

In [3]: datasource.GetLayerCount()
Out[3]: 1

In [4]: layer = datasource.GetLayerByIndex(0)

In [5]: layer.GetName()
Segmentation fault: 11

It doesn't matter what datasource I use. I've tried with several (even different formats) but I keep getting the same result.

Anyone faced this issue before? I've tried reinstalling gdal (in my computer) and GDAL (Python bindings) but still no luck. The weirdest thing is that it was working fine 2 days ago, and suddently started failing.

OS X v10.8.5
GDAL==1.10.0


texts: Enabling ArcGIS Spatial Analyst extension by default?

texts:
Anyone know a way to have the Spatial Analyst extension enabled by default?

We have ArcGIS with extensions installed on multiple windows systems in computer labs and when I logon as an admin on any the compluters and run ArcMap open a amp and try to run Spatial Analyst it gives me a license error "you do not have the necessary license to execute the selected tool ERROR 010096"
The license is present, it seems that every use I need to go in and check the spatial analyst checkbox in extensions. The same applies for each user.

I'm hoping there might be a registry setting or some other setting that I can set that will check the spatial analyst checkbox by default for all users.


texts: How to remove vertices or lines within a polygon?

texts:
I have transformed a *.dxf-file into a polygon shape-file. In many of the polygons i have lines whicht do not belong there but i can not delete them as i normally delete vertices on polygons by selecting it and pressing the delete key.

Here an Image (the lines which i want to delete are circled in red).

https://www.dropbox.com/s/62hapho1ip7vgij/screenshot.PNG

Thx for helping!


texts: ArcGIS sr.lock "LOCK file" how to delete?

texts:
http://forums.arcgis.com/threads/312-Beta-10-Lock-Files
ArcGIS 10: Lock Files

According to the above post the only way to delete these sr.lock files is to completely exit all ArcGIS programs.

When attempting copy and paste of a recently used shapefile (with corresponding mxd closed) this error pops up:

It will paste a portion of the shapefiles, but not all of them.

I have both service packs 1 and 2 installed.


texts: Data Driven Pages with a small section of grid

texts:
I'm trying to make map book with data driven pages. Never a problem when it just a grid specified for the complete extent.
But now i am using a grid that covers more than the area i want to print.
i was wondering if it is possible to specify wich pages to print, or to use in the layout.


texts: QGIS Cloud in QGIS 2.0 missing and 2.0 Crashing

texts:
Is QGIS CLoud still missing off QGIS 2.0.

I am having a lot of issues with 2.0. on another matter I cannot load print templates without the system crashing. Are templates non compatible.

When i am also loading projects into 2.0 from 1.8 some raster layer properties have reset to default values....eg greyscale back to colour.


texts: How to move an existing point object to a coordinate?

texts:
Is there a simple way to  move a point to an exact coordinate (do not intend to create a new point but move an existing point)?

Something like, write the coordinates and move a selected point for that coordinate.


texts:
I have a script that creates a text file containing the upper left and lower right coordinates of my geotiff files in the following format.

TileName UpperLeftX UpperLeftY LowerLeftx LowerLeftY

I have been able to create a CSV file from the text and import it as a point shapefile using XY Tools, but I need to import it as polygons. Normally I would just manually make the polygon shapefile using the XY tools point shapefile and snap to the points, but the text file I am using conatins hundreds of tiles. is there a plugin or tool that can create polygons using just the upper left lower right coordinates?

I am using  QGIS 2.12.0-Lyon on Windows 7 64-bit


texts: Creating shapefile from polygon points for CartoDB?

texts:
I have an Excel file that contains polygon coordinates for different areas. The spreadsheet has three columns: latitude, longitude and area name. Each coordinate makes of a part of the boundary of a polygonal area.

A sample of the data can be viewed here on google docs.

A subset of that sample is below:

Latitude   Longitude   AreaName

43.76559098    -79.41218646    Area1

43.76551428    -79.41216573    Area1

43.76516783    -79.41207212    Area1

43.76476698    -79.41196381    Area1

43.73581704    -79.4559399     Area2

43.73327829    -79.45336613    Area2

43.73359084    -79.45189026    Area2

43.73388256    -79.45052026    Area2

How can I turn this data into a shapefile that can be imported into CartoDB as a set of polygons?

Note: CartoDB accepts shapefiles that are in the following format.


texts: How to speed up spatialite-query using spatialindex?

texts:
I have got 2 tables, one of type LineLayer called strlayer, the other one is a PolygonLayer called blayer. The LineLayer contains two rows called fromBland and toBland that should be filled with an sql-query. They should be filled for each line according to in which polygon (from the Polygon-layer) the start- and endpoint of the line is. The names are in the Table PolygonLayer in a row called 'name'. With the following query it would work basically:

update strlayer set fromBland =(select name from blayer as n, strlayer
as s where strlayer.strid = s.strid and n.blevel = 4 and
within(startpoint(s.geometry),n.geometry));

blevel=4 only selects certain polygons, as there are also polygons of another level in this table, that aren´t needed in this query.
Now I'd like to speed up the query as the database is very large and the operation takes several hours.
As I already read it should be much faster with a spatialindex. So I´d like to know how the query above would look like with this index. I already know how to create the index - but not how to use it.
Has anybody an idea how to write that query with the spatialindex and so speed it up?


texts: Looping through polygons overlapping large rasters to calculate mean values

texts:
I previously asked Combine several raster files with heterogeneous bands about an error I was getting trying to combine non-overlapping rasters, and that Q&A surfaced a better approach that warrants a new question.

@JeffreyEvans wrote a very helpful answer to the original question that outlined a better strategy for merging rasters and calculating a mean raster value by polygon. It works well except that for very large rasters and lots of small polygons the memory requirements are intense. Jeffrey suggested a new question thread to outline a different way of looping through the processing steps more efficiently.

Here are the rasters:

southasia_as42-high-resolution-population-density-maps
southasia_as43-high-resolution-population-density-maps
southasia_as44-high-resolution-population-density-maps
southasia_as47-high-resolution-population-density-maps


texts: Using geometries to extract line segments in ArcPy with ArcGIS Pro?

texts:
I'm trying to use geometries to cut down a feature class of polylines to just the first 400m of each polyline. I modified an answer from Split a shapefile of lines into even spaced segments and am receiving an error. I believe the error is related to CopyFeatures not being able to accept multiple inputs, but writing out the geometries to individual feature classes is taking a while. Does anyone have a recommendation for ways to write all 2000+ polylines into one feature class? (update cursor? Does merge work with geometries?)

This is using ArcPy with ArcGIS Pro 2.1.2

featlist = []
out_fc = "outfcname"
with arcpy.da.SearchCursor("inlyr", ["myid", "SHAPE@"]) as cursor:
    for row in cursor:
        k_id = row[0]
        feat = row[1].segmentAlongLine(0,400)
        featlist.append(feat)

arcpy.CopyFeatures_management([item for sublist in featlist for item in sublist],out_fc)

Error below:

  Traceback (most recent call last):   File "", line 1, in
     File "C:\Program
  Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 2101, in
  CopyFeatures
      raise e   File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 2098, in
  CopyFeatures
      retval = convertArcObjectToPythonObject(gp.CopyFeatures_management(*gp_fixargs((in_features,
  out_feature_class, config_keyword, spatial_grid_1, spatial_grid_2,
  spatial_grid_3), True)))   File "C:\Program
  Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing_base.py", line
  506, in
      return lambda *args: val(*gp_fixargs(args, True)) RuntimeError: Object: Error in executing tool

EDIT: Just adding some clarification for others who may land on this question.

In testing, featlist starts out as a list of polyline objects e.g. [<Polyline object at 0x2172f6eb588[0x2172f6e9530]>, <Polyline object at 0x2172f6eb5c0[0x2172f6e9580]>, <Polyline object at 0x2172f6eb5f8[0x2172f6e95d0]>]. The list comprehension turns it into a list of point arrays. (It's unclear whether CopyFeatures can handle list list of point arrays, and it would not be my desired output anyway.)

I believe the question I referenced for this code was turning each line into multiple features and just appending the new list of polylines into featlist so this makes sense (a better way may be to extend the overall list in that answer rather than creating nested lists, which would not require later expansion of the list.)

CopyFeatures DOES work with multiple input geometries of polylines, so using arcpy.CopyFeatures(featlist, out_fc) tested OK (note: loses attributes)

UpdateCursor does work with geometries so for my purposes (trim the line, retaining attributes) it was the best solution. As this modifies in place, copy the feature class before proceeding.

In terms of speed, the SearchCursor/CopyFeatures method was on par with the UpdateCursor method, with UpdateCursor edging out the former due to need to perform spatial join to get back the attributes.


texts: Defining per request modification of layer order and symbology using ArcPy?

texts:
My web app will (hopefully) use dynamic layers with symbols that are rendered dynamically, based on a user chosen attribute.  So far I am doing this by defining a UniqueValueRenderer, then passing these properties to a layer with LayerDrawingOptions.  My work so far is loosely based on this example.

I periodically add new layers to the map and then re-publish them with a Python script using ArcPy.  As far as I know, ArcPy does not provide a way to overwrite an existing map service (please correct me if I am wrong! )  So instead, I delete, then publish, the map service from scratch.

So here is my issue: to allow dynamic symbol rendering in my map services, I need to enable per request modification of the services, which I can do in Manager for the services on that server (see image below).  But, I have not found a way to do this with ArcPy.   Once the map services are re-published, as of now I need to then log into Manger and manually check the 'allow modification' checkbox, and also re-register the file gdb as a dynamic workspace.  I have several map services in this app that need to redner symbols dynamically.
(This question is also posted on ESRI's Geonet here


texts: Invoke PostGIS functions outside of the database? Need to force 3D in GeoDjango

texts:
I'm looking to ensure that all geometries saved to the database are three-dimensional.  It's easy enough to do with a call to the database,

select ST_Force_3D( ST_GeomFromText( blah blah ) )

...but that means for every object saved in the database, we make two database calls.  Yuck!

Is there a simple way of invoking PostGIS functions without making a call to the database? We're using PostGIS 1.5 on top of Postgres 9.1 with GeoDjango on top of Python 2.7.

I've been working with GEOSGeometry objects, and they will tell you if your geometry is three-dimensional with the .hasz function, but I'm looking to FORCE everything to be three-dimensional without having to manually add a third dimension for every coordinate pair on every geometry we create.

Thanks!


texts: Graduated symbols drawing order not displayed correctly

texts:
When I use graduated symbols for a polygon layer to display population density, the layer is always displayed on top of all the other layers even if I dragged it to the bottom of the Table of Contents.

Any idea how to solve this?


texts: Using attribute table values as input for raster calculation in ModelBuilder with iteration?

texts:
I have multiple years of daily XY point shapefiles that contains multiple attributes.  I would like to choose one attribute from my XY point and perform a raster calculation with that value and apply it to a raster to create a new raster.  For example, my XY point is a base station for temperature and I would like to associate temperature with elevation (using a DEM as my raster).

The raster calculation would go something like this:

New raster temp = shapefile temp + (6.5 * (shapefile elev – DEM elev))

Each day has a different temperature.  I have been unsuccessful so far in creating a model to perform this action on one day, let alone iterating through multiple days, without having to manually enter in my attribute value (temperature) into the calculation.  Raster calculation manually will become very tedious over 2000 days…

Does anyone have any suggestions for a tool or sequence of tools that I may have overlooked, and especially how to get it working iteratively in ModelBuilder?


texts:
I have a raster layer of a river network containing weighted flow accumulation values and a raster layer of lakes (see image bellow). I want to replace the values of all the river pixel that fall into the lake by 0. How can I reclassify a raster by zone?

I tried to achieve the same result by doing this :

Use the Extract by Mask to have a layer of the river network that fall into the lakes.
Use the Raster Calculator to subtract the raster layer of the river network by the raster layer of the river network that fall into the lakes.

I though this would give the pixels that fall into the lakes the value of 0, but ALL the pixels get the value of 0 whether the pixel falls into a lake or not.

I have tried with ArcGIS 10.1 and QGIS 2.8.2 with the same result, so I'm probably doing something wrong.


texts: Checking if active layer is a geopackage using PyQGIS

texts: Is there a PyQGIS way to check if an active layer (iface.activeLayer()) is not a geopackage format?


texts: Comparing directories using python in order to transfer files to geodatabase?

texts:
I'm attempting to convert a number of shapefiles into a geodatabase and automate the process using python. The directories that contain the shapefiles that need to be converted are named by county for example "cass". The geodatabases are named after the counties as well but end in the extension .gdb and they end up looking like this "cass.gdb". I've already tried using the os.walk function for both directories and comparing them in order to put the correct files in the correct place but I simply end up with a loop that only compares one county file to one county .gdb without moving to the next item. I was wondering if anyone would know how to correct this problem, or have a more efficient way of doing it. Here is my code as it sits right now.

import arcpy
import os
arcpy.env.overwriteOutput

inFile = "P://County_Map_Book//counties"
outGeoPath = "P://County_Map_Book//mapbookCountiesGeodatabases"
doubSlash = "//"

#This compound loop structure walks
#through directories of shapefiles
for root, dirs, files in os.walk(inFile):
    for compare in dirs:
        compareShapes = compare

for root, dirs,files in os.walk(outGeoPath):
    for compareGD in dirs:
        if compareGD.endswith(".gdb"):
            compareGDB = compareGD[:-4]

for comp in compareShapes:
    if comp in compareGDB:
        print compareGDB + " shares name with " + compareShapes


texts: Using panel info instead of infowindow with CartoDB?

texts:
I am using CartoDB API to develop a map viewer and I would like to get the information from featureClick into a content panel instead of the typical infowindow. Is there any method to do it directly? I mean, I have seen some examples about how to include a template dinamically but it is always displayed as an infowindow popup. Could the template be linked to another html element and disable infowindow popup?

I know that layer has the attributes and values (also using layer interactivity fields) but I would like to know if there is a method which can be used as similar as the template-infowindow.


texts: PyQGIS - Get the provider name of a layer

texts:
In QGIS 3.16.5-Hannover, with pyqgis I wan't to get the provider name of a selected layer. I need to know if it's an ESRI Shapefile layer or a POSTGIS layer for example.

I don't see how to get this value in QgsProviderRegistry, or in QgsVectorDataProvider.
I try this :
# Get the name of a selected layer from a combo box
selectedLayerName = self.mMapLayerComboBox.currentText()
layer = QgsProject.instance().mapLayersByName(selectedLayerName)[0]

# Could it be something like this ?
layerProvider = layer.getProvider()

Is there a way with pyqgis to know the provider of a selected vector layer ? (like metadata informations)


texts: Transfering DXF from QGIS to Trimble TSC3

texts:
I've come up with probably a simple problem when I'm transferring a DXF-file to Trimble TSC3.
So I've created a point layer in QGIS which I exported as a DXF file for transferring into the Trimble machine. The problem is when I am loading the active map in a selected job I only get small points which can hardly be seen on the Trimble.

Is there anyway to store some kind of symbology when exporting a shapefile to DXF, or enlarging or add labels to the points in the Trimble?


texts:
I'm a beginner in this field and tried to display the PostGIS database data in localhost. I used select query in my code, so the table got displayed.  I want to display the geographical points in a map overlay or in GeoMoose. I'm attaching the code which I used to display the table. Can anyone help me?

<!DOCTYPE html>

<?php
  class assets {
    public $gid;
    public $id;
    public $name;
    public $main;
    public $asset_name;
    public $assetname;
    public $geom;

    //Database Variables

    public $connection;
    public function __construct()     {
        $this->connection = pg_connect("host=localhost port=5432 dbname=postgis user=postgres password=1234") or print("cant connect");
    }
    public function __destruct() {
    }
    public function create() {
    }
    public function read() {
          $result = pg_query($this->connection, "SELECT gid,id, name, main,asset_name,assetname,geom FROM assets");
          if (!$result) {
              echo "An error occured.\n";
              exit;
          } else {
          echo "
";
          echo "
gID	ID	Name
                    Main	     asset_name	      assetname	      geom
";

                   while ($row = pg_fetch_row($result))  {
                          echo "
";
                          echo "".$row[0]."	";
                          echo "".$row[1]."	";
                          echo "".$row[2]."	";
                              echo "".$row[3]."	";
                                  echo "".$row[4]."	";
                                      echo "".$row[5]."	";
                                      echo "".$row[6]."	";
                          echo "
";
                   }

          echo "
";
          }

    pg_close($this->connection);
    }
    public function update(){
    }
    public function delete(){
    }
}
$myAssets = new assets();
$myAssets->read();
?>


texts: How to select features which overlap one geometry but are disjoint from another?

texts:
Given a point layer and a polygon layer (P1) in GeoServer, the following CQL Filter selects points which intersect the polygon P1:

CQL_FILTER = "Within(geom,POLYGON((P1_coordinates)))";

The resulting point features are shown in yellow in the left-hand diagram:

Given a second polygon layer (P2) which overlaps the first layer (P1), is there a CQL Filter expression which will select the points which intersect P1 but do not intersect P2? The desired result is shown in yellow in the right-hand diagram.

(In effect I want to treat P1 like a donut with P2 representing the hole, but this is not how the geometries are stored in the database).

Based on the page at http://docs.geoserver.org/latest/en/user/filter/ecql_reference.html#spatial-predicate it seems like I should be using a combination of within and disjoint but I'm not sure how to string them together.

Edit: The database is PostgreSQL and I'm using GeoServer 2.10.1. I'm sending the CQL filter as parameter in an AJAX query from a JavaScript app. Assume for the purposes of this question that I can't access the database, ie I'm hoping for an answer from the GeoServer side, rather than creating a view on the database, etc.


texts: OWA (Ordered weighted average) in TerrSet IDRISI

texts:
How is OWA done in TerrSet IDRISI ?

I have used three factor maps in scale 0 to 1 of wind, distance to grid and distance to road. Factor weights of wind = 0.6, Grid = 0.3, and road= 0.1. I give order weights of 0.7, 0.2, and 0.1. The values of a pixel after OWA = 0.2822. I want to know how we reached that value using OWA? The factor map values of that pixel for Wind= 1, grid = 0.4866, and road= 0


texts: QGIS custom grid / line oriented point displacement?

texts:
I am trying to sort point symbols at the same coordinates in a line. The first picture shows how I want it to be (all symbols in a single horizontal line), the second how it looks with the standard grid-based point displacement (multiple, unwanted rows of symbols, and therefor also an unwanted overlap of text and symbols).

Is there any way/plugin to either change the parameters of how the grid is built (number of rows/lines) or any other way to show symbols in a line?

I am not hugely into scripting or programming though.


texts: How to show related tables in ArcGIS Viewer for Flex v3?

texts: Is there any way to show related tables's result in ArcGIS viewer for Flex? Like identifying in desktop?


texts: Killing a geoprocessing tool without killing all of ArcMap

texts:
When I try to open a geoprocessing tool (typically Layer to KML), the window frequently freezes, especially if I alt-tab away from the map.

I'd like to just kill that window, without killing all of ArcMap and forcing me to re-open it (which often takes several minutes). But, in Task Manager, there is no "Layer to KML" window, and shutting down any Arc-related processes (other than ArcMap) doesn't help.

Is there a way to do this? Note that I have not actually started running the tool-- I have just opened the window.


texts: Where can I find road attribute and network for New York City?

texts: Is there any possible to find the attribute of each road (such as road capacity, speed, longitude and latitude.) in New York City?


texts:
I am looking for a map of polish 'powiaty', eng. 'county' or 'district' (i.e. second-level unit of local government and administration in Poland, equivalent to a county, district or prefecture) in JSON.

You can find shapefiles here: https://gis-support.pl/granice-administracyjne/. I need a JSON to be able to use it in PowerBI as a custom map.

And possibly if you have some ideas is there any online available repository which offers numerous JSON files for different countries to download?


texts: Snapping geometries to a layer without distortion

texts:
I am looking for a plugin / script to snap a polygon layer (A) to a linestring layer (B), the example datasets in image 1.

I have tried the 'Snap geometries to layer' tool in QGIS 3.4.

This snaps the nodes within a set distance, but doesn't 'move' the shape, example in image 2.
It results in the width and shape of the polygon layer being distorted.

I would like the shape to be 'moved' towards the linestring layer.
The nearest node ONLY on the polygon layer snapped to the nearest point on the linestring layer, the rest of the feature should be moved with it.
Example in image 3.
Each feature should be moved separately. The dimensions of each feature should not be changed, only the coordinates.

The projection will be EPSG:27700 - OSGB 1936 / British National Grid - Projected, and the format can be ESRI shapefile or geojson.

Does anyone know a solution to this problem?


texts: How to mask out features outside of the Coverage Layer for Atlas plugin?

texts:
Using the Atlas plugin for qGIS how do I set the coverage so that it will only highlight the feature(s) I want but still show the surrounding features as grayed out areas?

This would have been easy if I don't need to work with several thousand features.

I am not asking just how to mask neighboring features. I am asking how to to make Atlas dynamically mask neighboring features of the POI.

The idea is similar to this map here.


texts:
Context: When an Uber vehicle is very close to the destination, there is an alert on the driver app that indicates that the destination has arrived. This determination is quite accurate.

Two approaches come to mind wrt implementation:

Fence with a small radius around the destination
Distance between current location and Destination

Typically in devices (say android), it is suggested that fences be at least 150m for good results. There is possibility of false alarms as well (based on the accuracy of a location as determined via gps).

What does Uber do to determine if the vehicle is close enough from the destination?


texts: Buffer Distance Problem with TURF AND OL3

texts:
I had this code for my turf-buffer :

var unidades = 'kilometers'
select2 = new ol.interaction.Select({
    condition: ol.events.condition.click
});

map.addInteraction(select2);
select2.getFeatures().on('change:length', function(e){

    var feature_buff = select2.getFeatures();
    var geojson  = new ol.format.GeoJSON();

    for (var i=0;i<feature_buff.getLength();i++){

        json.push(geojson.writeFeature(feature_buff.item(i)));
        prueba.getSource().addFeature(geojson.readFeature(json[json.length-1]) );
        polys_fc=JSON.parse(json[json.length-1]);

        prueba.getSource().addFeatures(geojsonToFeatures(polys_fc, {
            featureProjection: 'EPSG:3857'
        }));

        var buffer = turf.buffer(polys_fc, 100, unidades); // PROBLEM UNITS

        prueba.getSource().addFeatures(geojsonToFeatures(buffer));

    }
});

The error is not showing the actual kilometers and 10,000 km are not that image 1 and 100 km are not the image 2. I do not understand why this error because the buffer think this well done.

Buffer with 100000 units first image:

Buffer with 100 units second image


texts: Symbolizing File Geodatabase feature class with Layer File created from AutoCAD drawing?

texts:
I received an autocad drawing file which I converted into feature classes with the CAD to Geodatabase tool.

I would like to symbolize the exported data in ArcMap the same way it was symbolized in the input drawing file I received.

I visualized the drawing file in ArcMap and saved the "Drawing layers" Layer files as per usual but I am unable to import this symbology into the exported layer properties.

When I import the saved layer files, the resulting "Import Symbology Matching Dialog" correctly matches all 3 fields (Linetype, Colo, LineWt) but clicking OK doesn't do anything - dialog disappears and symbology remains unchanged.

Alternatively, when I load the layer file itself, it is linked with the DWG and source can only be changed for the CAD Feature Class type.

How can i symbolize my exported data the same way as the original DWG is shown in ArcMap.


texts:
I recently posted this issue with esri.  Has anyone experienced this?:

We are experiencing brand new caching issues at 10.2.2. I am unable to either DELETE_TILES or RECREATE_ALL_TILES from an existing cache. The error we keep receiving is:

Line 30Output failure, error string = Error moving bundle Failed to cache extent: -9223211.962860 3087885.815688 -9079003.170544 3271103.291998 at scale 577790.55428899999.

The error occures when running RECREATE_ALL_TILES or DELETE_TILES operations of the Manage Map Cache Tiles (run as a tool or script) when run from a dedicated server gp cluster machine. Our clustered setup consists of a network file server storing our config, security and data-stores, as well as all server and system directories. Two servers serve as a mapCluster for map and image services, a single server in a gpCluster for caching and user-defined gp services, and a virtualized web server for the WebAdaptor.

This has occurred as of lastweek whether reading from the GIS SDE database OR from a data-store file gdb. All permissions for directory shares and folder and file security have been accounted for.

When the error occurs, the entire cache becomes corrupt, making any other caching operations in-operable (delete cache, delete tiles, etc). During the recreate, the bundlx file is being removed but the bundle file is not, thus not allowing the tool to overwrite thebundle from the admin-defined D:/arcgistemp folder(s) on the GP server.

Thus far, the only solution has been to kill the service, stop the site, and then remove the entire cache directory, restart the site, recreate both the service and the cache.

Has anyone encountered this?


texts:
I want to be able to set the height and width of my rectangles, as well as the angles. I have been trying the Rectangles Ovals Digitizing plugin, but I can't seem to make it do anything (besides turn on, I did figure that part out). I'm not finding any tutorials on how to use this plugin. I'm fairly new to QGIS, so I may be missing something blatantly obvious!

I'm running Essen 2.14.


texts: GeoPandas dissolve using an attribute filter

texts:
I am wondering if it is possible in one pass to use GeoPandas' dissolve to merge together only the records matching a query.
Specifically, I have many small areas that should be merged to the larger area with the same ID. It does not matter if they are adjacent or not, or if there is more than one small area are with the same ID. What matters to me is that I can aggregate them taking advantage of the dissolve's aggfunc parameter to sum up the values in another numeric column of the dataset.
I thought to extract the IDs of these small areas by a simple query like df.loc[df.geometry.area < 0.1]['ID'] and to somehow feed this list of IDs to dissolve, but I guess I cannot do that, or at least I don't know how.
A very ugly image to clarify the point.


texts: How to find identify the best 'maximum search distance' while doing breach depression least cost using Whitebox?

texts: I am trying to preprocess my DEM in GeoTIFF format using breach depression least cost algorithm of Whitebox tool and I need to provide an input value of maximum search distance for cells. How can I know which value to set?


texts:
I am perfoming a geospatial process whereby I want to use the flow accumulation (as an input for discharge proxy) in calculating stream power. I am using ArcGIS 10.2

So far I have:
1. Valley/channel slope and width
2. drainage area
3. Terrain analysis grids (flow acc, flow dir etc)
4. rainfall surface grid

I just wanted to know what is the formula behind weighting the flow accumulation with for example, if facc is calculating the number of upstream cells accumulating in that point, when you weight it by rainfall (in mm), what does that mean? Sum? Multiplication of the two layers? I managed to do this step however, the values I got on the highest flow accumulation line is the same throughout the course of the river and that looks incorrect.


texts: Issues using geographic and projected coordinate systems QGIS 2.0

texts:
I am having issues with QGIS 2.0.1 working between local projected coordinate systems (such as OSGB36, NAD83) and Geographic systems (such as WGS84).

The stock answer I have been provided is 'load the data and "save as"'  - this doesn't cut it, the files are always 50m out. The data requires a Helmert or NTV2 transformation but I cannot see how to appy this in QGIS 2.0

Unfortunately I have gone back to ArcGIS and QGIS 1.9 (using the transformation tool plugin), but I cannot be alone in my issues, so has anyone else had this issue and what is the work -around?


texts: Python Script to update all feature classes/datasets in gdb with search and update cursor?

texts:
I have two geodatabases, one is a production sde database, the other is a backup in a local file geodatabase.  The script runs as a task once a month and is very resource intensive.  I am using ArcGIS for Desktop 10 SP 5.

What I would like to do is use a search and update cursor for each feature class in the database, including feature data sets; if there has been any change to the feature class; then just update the backup based on what is in the production instead of deleting it.

The example here shows how to update a feature class based on a field and changes to a field.  I would like to parse and update all feature classes in gdb2 if there is a change to a feature class in gdb1.  How can this script be modified to meet my needs?

import arcpy

#input feature class
fc2 = r"C:\temp\temp.gdb\fc2"
#target feature class
fc3 = r"C:\temp\temp.gdb\fc3"

#check field
checkField = "SRNumber"

#Get list of values in field from target feature class
checkValues = [r[0] for r in arcpy.da.SearchCursor (fc3, checkField)]

#Get list of fields
fields = [f.name for f in arcpy.ListFields (fc2)]

#Get index of check field
index = fields.index (checkField)

#Create insert cursor for fc3 to allow appending of rows
inCursor = arcpy.da.InsertCursor (fc3, fields)

#Create search cursor to iterate input feature class
cursor = arcpy.da.SearchCursor (fc2, fields)
#iterate
for row in cursor:
    #Get value to check
    checkValue = row[index]

    #Check if value is in target fc
    if checkValue in checkValues:
        #skip if value is in target fc
        continue

    #Insert row otherwise
    inCursor.insertRow(row)

#Clean up
del cursor
del inCursor


texts: How to label two sizing for one attribute

texts:
I have a feature of SEA COVERAGE.shp, in the feature, we have attribute field name consist of english and malay name.
For example, LAUT CHINA SELATAN(SOUTH CHINA SEA), LAUT SULU(SULU SEA). Sizing for english and malay is different, is there any way that can i use to label the field name with different size?


texts: ReduceRegions not writting to feature properties in GEE

texts:
I am trying to apply reduceRegions to extract average precipitation from the TerraClimate dataset (developers.google.com/earth-engine/datasets/catalog/IDAHO_EPSCOR_TERRACLIMATE) within each polygon of a feature collection. The problem is that the output of the reduction is not written to each feature property as expected. It only appears in the columns of the output feature collection. The code below is a simple implementation on the first image of the collection, using an arbitrary feature collection with 3 polygons. My end goal is to map the ReduceRegions function to the whole TerraClimate collection. For this I followed the steps to use reduceRegions outlined in this previous post: Calculate mean EVI for multiple polygons across an image collection in Google Earth Engine
The problem, and my question, is why is the result of reduceRegions not writing / added to the feature properties as expected..? It does so in the example given in the post above (mean EVI index example). As a result I cannot map the reduceRegions function to the whole collection...
Link to code: https://code.earthengine.google.com/49680c8f2c6d505ddf437a59b015e906
So. coming back to my post after some more works, it seems this is caused by having null values returned by reduceRegions, so that the property is not set in this case. Now, the only way to NOT have null values is to use scale: 30 with the reduceRegions. The TerraClimate data is in geographic projections with a 2.5 arcminute resolution (about 4 km). Whenever I use a different scale value (1, 20, 40, 100.. 1000) I only get null values. It only works with 30 meters for scale. Anyone knows what is going on?


texts: Analyzing NDVI rasters with same dimensions but different extents with Raster Calculator

texts:
I have drone sourced remote sensing imagery (NDVI) of a trial site set up to measure yield response to varying nitrogen (N) rates.
The trial includes N rates ranging from 0 to 600 kg/ha. The trial features 40 plots with identical dimensions (2m x 10m). There are 4 repetitions of each N rate located randomly thoughout the trial site.
Can the NDVI imagery from each repetition (i.e. 4 individual plots) be analyzed using Raster Calculator in ArcGIS to determine the mean NDVI or can other software be used to perform this task? (Given that the spatial extent of each plot is effectively irrelevant for the required task)
Ultimately I'd like to output a single raster which displays an average for each repetition (4 separate NDVI images).


texts: Converting polar stereographic to lat/lon using ArcGIS Desktop?

texts:
I have a netcdf file of the Greenland ice sheet which I have uploaded in ArcGIS Desktop as a raster file. The projection is WGS84 NSIDC Sea Ice Polar Stereographic North but the units are in meters (top: -655500, left: -655500, right: -655500, bottom: -655500).

However, I want to convert them to lat/lon, how can this be done?


texts: Using Reducers to Produce Seamless Image Mosaic in Google Earth Engine

texts:
I am working on a project that requires classifying Landsat imagery using relatively minor variances in pixel values (i.e. more subtle than simply identifying "forest"/"non-forest"). A seam between Landsat WRS paths runs right up the middle of my ROI. Compositing multiple years of observations for each path still results in significant differences in reflectance values on either side of the seam, which is proving fatal to my classifier. My training data is skewed toward a single WRS path, so training and running a classifier on each path individually would be a problem.

Currently, the best solution I've been able to reach is to create mosaics for each Landsat WRS path in my ROI, export them and download them locally to my computer, mosaic them together using the Orfeo Toolbox's "Mosaic" tool (which adjusts the input images' histograms so that they approximate one another), and then re-upload the merged image to Earth Engine to continue the analysis. While this can get the job done, it's inelegant and makes it harder to transparently document the analytical workflow.

Is there a way I can combine EE's reducers such that these adjacent images' reflectance values can be harmonized?

Something like a "histogram matching followed by mean reducer" tool is what I'm imagining, but I'm not literate enough to know whether the numerous reducer tools described in the API documentation can be combined to that effect.


texts:
I am trying to automize the workflow: import osm
data and select by a special tag.
I have to do this steps a lot of time with different parameters and updated data.

A Solution could be a python script using PyQGIS or using the Graphical modeler.
But in both cases I could not finde the tools to import OSM Data
as pythoncode or within the Graphical modeler in qgis.

The manual workflow is discribed in this great tutorial:
http://www.qgistutorials.com/en/docs/downloading_osm_data.html

Can anybody help me?


texts: Getting attributes of intersected polygons using PostGIS

texts:
I have a PostGIS table containing about 50,000 polygons and some of them are overlapping.

I'm trying to use PostGIS to return a table with all the Intersecting parts of the polygons along with some of the attributes of the original polygons.

To get the Intersecting parts table (table (b) in the figure below), I use this script (Similar to the solution here):

SELECT (ST_intersection(a.geom, b.geom))
INTO Intersecting_parts _table
FROM t1 a
INNER JOIN t1 b ON  ST_Intersects (a.geom,b.geom)
WHERE a.id < b.id

THE PROBLEM I'M STRUGGLING WITH:

I want the table with the intersecting parts (table b) to hold attributes from the original polygons, so anyone exploring new table can retrace the intersection to the originals. Furthermore, database-wise, I know it is better to put these attributes in a new relationship-table, and not in table b).

The process and table schematics:

So, I've put in the figure below a schematic of the new table I want to create (table (c)).
  I tried doing this:

SELECT ST_intersection(a.geom, b.geom), a.*
INTO Intersecting_parts_table
FROM t1 a
INNER JOIN t1 b ON  ST_Intersects (a.geom,b.geom)
WHERE a.id < b.id

But of course – In the simple case although there were only 2 intersecting polygons, it returns only the attributes of one of them, randomly, which clearly does not meet my needs.

But, I think I'm stuck in the basic understanding:

It seems to me that as the ST_Intersection geographic operator (and ST_Overlaps, ST_Intersects and so on) works on whole tables, they are not the answer. They can't return attributes from two polygons at once (or I don't understand how to do it).

I tried extracting the attributes using a point derived from ST_PointOnSurface (and not ST_centroid), but didn't get very far with it).

I'm using PostGIS 2.3 and PostgreSQL 9.6.1.


texts:
I tried to histo-match three red bands of three different landsat8 images, using i.histo.match on Grass7 on Ubuntu and I have this error:

 i.histo.match input=l8_1@list1,l8_2@list1,l8_3@list1 output=mos max=10000
Traceback (most recent call last):
  File "/home/user1/.grass7/addons/scripts/i.histo.match",
line 241, in <module>
    sys.exit(main())
  File "/home/user1/.grass7/addons/scripts/i.histo.match",
line 144, in main
    curs.execute(update_cdf)
sqlite3.OperationalError: database is locked

Do you have any ideas what does it mean? Or what I did incorrectly?


texts: how to predict on hold on test sample using krige.cv from gstat R toolbox?

texts:
I am using the 'krige.cv' function from the gstat toolbox in R.
It does not take any 'newdata' as input for prediction ( as in universal kriging).
How can I predict using the fitted model from this krige.cv function?


texts: Can I delete ".shp.xml" without affecting the shapefile's data?

texts:
The size of my ".shp.xml" file is 100 MB.

1) What is the purpose of the ".shp.xml" file?

2) Can I delete this file without affecting the data?


texts: Displaying sum of frequencies in leaflet cluster maps pointer

texts:
I've a dataset with locations and their frequencies (sum of counts)

I want the leaflet cluster to display the frequencies as pointers instead of the count  of occurrences.

city            state   latitude    longitude   Count

San Juan        PR      18.410462   -66.060533  5
Honolulu        HI      21.2782     -157.82199  8
Boca Raton      FL      26.391346   -80.21824   17
Key Biscayne    FL      25.700966   -80.16195   2

I use the function

leaflet(df) %>% addTiles() %>% addMarkers(
  clusterOptions = markerClusterOptions(),
)

to display the map, but it displays the count of each location pointer as one, regardless of the frequency. How do I customize the code so that it displays the frequencies instead of counts in pointers ?

This is how I want my end result as

http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html


texts: Loading map files using ArcGIS Silverlight API?

texts: Is there a way to use the Silverlight API to load common maps formats (i.e., layers, shapefiles or rasters) off of my local machine?


texts: Geographic limit to overlay analysis in geoprocessing service

texts:
Function:
I've created a geoprocessing service that serves a toolbox containing a custom python tool.  This python tool selects a polygon and buffers it by 1 mile.  This buffer is then used to intersect with another polygon layer to produce a list of features in the overlay.  Pretty simple.

Environment:
The same geoprocessing service is re-created four times [three Oracle environments and four GIS web applications].

Error:
In three of four gp services, when this tool is used at a REST endpoint --and when the overlays is in a specific geographic region [roughly 250 sq. miles]-- this error is produced: “Invalid Topology [Cannot read input cache.] Failed to execute (Intersect). Failed to execute (ToolCustomIntersect)”

Fix:
I've debugged a bazillion ways and have come up with one solution: re-create the  GP service with a different name (as improbable a fix as this seems).

What just happened!?!
The only pattern that I've deduced through various tests is that names of GP services containing a high redundancy of letters in a complete pathname or the length of the name resulted in this error.

The kicker is when I run the same tool in AC on the AGS server it works.  Meaning I'm not utilizing the gp service or the REST endpoint.  No topology or cache error.  So, there is something about the GP service that is producing a geographic limitation to an overlay tool.

Quirk?  Or real issue.  I'd love your ideas and comments.


texts: Why do I need to use labelling when setting fill colour with a python expression in QGIS?

texts:
I'm having problems using a Python function in the expression editor to style a polygon fill in QGIS.

I'm trying to use a random colour scheme. However, I need to do this over a series of different maps from different points in history.

I need the colour for "Norway" to be the same across all maps, likewise the colour should be the same for "Germany". I don't care what the colour is for each country, just that it is consistent between layers.

To do this, I have a Python function which uses the MD5 hash of the column value.

This function works, it looks up an attribute by name and returns an "r,g,b,a" string based on the first 4 bytes of the MD5 hash:-

"""
Define new functions using @qgsfunction. feature and parent must always be the
last args. Use args=-1 to pass a list of values as arguments
"""

from qgis.core import *
from qgis.gui import *
import hashlib

@qgsfunction(args='auto', group='Custom')
def hashcolor(values, feature, parent):
    v = feature.attribute(values)
    if not v:
        v = "Null"
    h = hashlib.md5()
    h.update(v)
    hd = h.hexdigest()
    r = int(hd[0:2],16)
    g = int(hd[2:4],16)
    b = int(hd[4:6],16)
    return "{0},{1},{2},255".format(r,g,b)

So for example,

hashcolour('CNTRY') will always return 213,185,41,255 if the CNTRY field contains "Norway"

I then use this expression as the fill colour for my polygons.

However, I could only get this to work if certain criteria are met:-

I have labelling turned on for that layer and
I have used "CNTRY" somewhere in the label's expression

I don't want labels, and I can't just use the empty string, so I had to use this hack on the label expression to get it to work:-

regexp_replace("CNTRY", '.*','')

Can anyone explain why I need to use labels in this way to get a
python-expression defined colour to work? Is this a bug, or a
side-effect of how the expression editor is supposed to work? It seems odd that labelling should be needed to allow polygon styling...

(Setup : Ubuntu Trusty 32-bit, QGIS 2.12.3-Lyon)


texts:
I have a shapefile with polygons containing UK postcode units, example SL1 1AA. I want to dissolve these into postcode sectors,example SL1 1.

I can use this expression in the filter to get all those postcode units in one sector and dissolve that as the image above.

LIKE 'SL1 1%%'

What i want to do is apply a similar expression with dissolve altering the expression to a regex so it dissolves into SL1 1, SL1 2 etc.

I have an idea how i could tackle this in postgis but wanted to see if i could do this with the QGIS


texts: Extracting attributes from clustered KML layer

texts:
Creating the vector layer from a kml file, as:

kmlLayer = new ol.layer.Vector({
            source: new ol.source.Vector({
                url: "kml_sample.kml",
                format: new ol.format.KML({
                    showPointNames: false,
                    extractStyles: false,
                    extractAttributes: true
                })
            })
        });

I can extract the attributes and display them in a popup:

map.on('click', function(evt) {
    var pixel = evt.pixel;

    var features = [];
    map.forEachFeatureAtPixel(pixel, function(feature) {
        features.push(feature);
    });
    if (features.length > 0) {
        var coordinate = features[0].getGeometry().getFirstCoordinate();

        if (features[0].get("features") && features[0].get("features").length > 1) {
            map.getView().setZoom(map.getView().getZoom()+1);
        } else { // single feature
            popupContent.innerHTML = '<p>' + features[0].get("description") + '</p>';
            popupOverlay.setPosition(coordinate);
        }
    } else {
        popupCloser.onclick();
    }
});

However, when using a Cluster:

kmlLayer = new ol.layer.Vector({
            source: new ol.source.Cluster({
                distance: 10,
                source: new ol.source.Vector({
                    url: "kml_sample.kml",
                    format: new ol.format.KML({
                        showPointNames:    false,
                        extractStyles:     false,
                        extractAttributes: true
                    })
                })
            })
        });

The attributes return undefined.


texts: How to split and reproject a polygon shapefile into a grid based on area proportion with QGIS?

texts:
I have a shapefile with polygons (municipal.shp) which contains a variable (float numbers) for each municipality of an area. I want to distribute these values into a vector grid (grid.shp) with different projection. So, the splitting should be based on the area proportion of the value. In the image below you can see how the files look like and how the output should be.

How I could do that in QGIS?


texts: ArcCatalog import geodatabase xml schema: domain name conflict

texts:
I've exported a geodb xml schema "A" with ArcCatalog from a file geodatabase in order to import it into a sde geodb in Oracle. I've created a geodatabase with the "create enterprise geodatabase tool" with user sde, and another user "A" to import the new schema.

Before importing "A", I've created another schema "B" into the same sde geodb, which has the same domains as schema "A".

My issue is that, when I try to import "A" with ArcCatalog, a conflict is detected for SOME of the domains. Since ALL domain are identical, I would expect a conflict to be detected for ALL domains, or that no conflict is detected at all, instead of having this kind of "hybrid" situation.

So, my question is: How are conflicts detected when importing xml workspaces?


texts: OpenLayers is very slow when using WKT multipolygon with a large number of points

texts:
I'm showing the boundaries of Cyprus regions using OpenLayers with vector layer, I get the coordinates from a shapefile which has a lot of points, for instance some regions can have a multipolygon with in total 30000 points.

This is really slow on Firefox / IE and in Firefox it shows unresponsive script error. Only Chrome works well. What's the best way to get it working faster and smoothly?

I read one answer is to create a WMS server with MapServer to generate the images tiles instead to use the OpenLayers directly but I can't implement that solution because I want to change layer style dynamically to the different features in the vector layer i.e to show different colors to the region based on the dynamic value.

How can I overcome this issue. Any Insights would be much appreciated.


texts: Regex expression in mapinfo sql to remove special character

texts:
Is there a way to clean the values in the column to just have A-Z 0-9 and _ ?

In python/regex I run

def Alphanumeric(string):
 import re
 clean_string=re.sub(r'[^a-zA-Z0-9_]', '', string)
 return clean_string

I need to do this in Mapinfo as an update column. I see something close in http://nyalldawson.net/2013/05/regular-expressions-in-mapbasic/ and am in the process of exploring this.

Additionally, I know I can run InStr() for each of these values but I am hoping for a one-liner.


texts: How to automatically update coordinates in print composer?

texts: I tried "$x" and "$y" for coordinates but it always give me zero "0" values too, and what I really want is to display the coordinates like in this image.


texts: Map tiles below -80 degrees appear inverted in UTM projection

texts:
I have a set of global land cover tiles at 30m per pixel resolution (GlobeLand30 or GLC30). They are TIF files in UTM projection, however I need to do some work using Geographic projection. Here is what it looks like when I import the files into my GIS tool (Global Mapper v22):

And here is what the Projection dialogue looks like when I click on it:

Here is what the Projection dialogue looks like when I click to select Geographic projection:

And here is what the map looks like when I convert it to Geographic projection:

To my untrained eye, it appears as though the "bottom" part of the globe (i.e. anything below -80 degrees latitude) is loading "inverted". Here is a close up of Antarctica south of South America so that you can see what I mean:

The original file set is definitely correct as can be seen from this screenshot from GLC30's online map viewer (from which these TIF files were downloaded):

Am I doing something wrong, or is there perhaps something wrong with the metadata in these TIF files causing them to load incorrectly? How do I get them to load so that the region of Antarctica approaching the South Pole looks correct?
Please let me know if you need any more information from me to solve this problem as I'm not a GIS expert and can only really tell you what steps I've taken and the problem as it appears to me.


texts: Is it real to install PostgreSQL 9 on the virtual machine Windows Server R2?

texts:
I have Virtual Box with GuestAddition. And virtual machine "Windows Server 2008 R2"

When I use real computer with Windows Server 2008 R2 I can install postgresql-9.2.3-2-windows.
But when I install postgresql-9.2.3-2-windows on virtual machine I have error "Problem running post-install step. Installation may not complete correctly"

Please, help me.


texts:
I'm struggling to understand how the geo projections work in practice.

The info a the CRS is as follows:
{'ellps': 'WGS84', 'no_defs': True, 'proj': 'longlat'}

Does it mean that the coordinates are planar? if so,

how do I know what it was projected from (I need areas preserved, so this is important)
do I need to do something to displayed it on a map?

My region is South Africa-
 - how do I choose the best coordinate system?


texts:
I want to make a translation of a grib file to tif with gdal, I use the python script, and I have always error "the specified file not found '

import subprocess

src ="donnee1.grib2"
dst ="donnee2.tif"
subprocess.call(["gdal_Translate -of Gtiff -b 1",src,dst])


texts: Create features from ArcGIS Topology errors

texts:
I have imported field users shapefiles into an ESRI geodatabase so that I can create some topology rulesets that identifies the errors as needed.  Unfortunately the field users do not have a license that can read gdb topology rules (or obviously fix them).

I would like to be able to generate a new set of shapefiles that capture where all of the errors and exceptions are at so the users can go in an fix the obvious ones themselves (saving me a bunch of work!).  This can also be a quick way of organizing the errors based on size (area or length) so that you deal with the biggest issues first.

Does anyone have any suggestions on a way to generate features from ArcGIS Topology errors & exceptions?

I have an ArcInfo license available so any tool within the package is at my disposal.  While I am not an ArcObjects programmer, I am very familiar with Python scripts or ModelBuilder to develop such a tool/process.

UPDATE: I did just find this ArcGIS Idea and developer sample, but I was hoping for something that I would be able to put into a toolbox, not a custom VB module.


texts:
I have py script which is creating shapefiles using shapefile.py. Once the shapefile is created I have to add them manually to the geoserver. Is there a way to add it dynamically to the geoserver? through postgis or something?

UPDATE

Ok so seems my project manager has changed his plan, he wants me to add the shapefiles to the PostGIS Database which will update the newly added shapefiles to the geoserver where there will be a connection to the PostGIS Database. Is it possible to update the newly added shapefiles to reflect in the Geoserver?


texts: How to enable UI Theme Support in QGIS 2.12?

texts:
According to the 2.12 Changelog QGIS now ships with a light and a dark UI Theme. A longer description of the UI themes can be found at Nathan Woodrows blog on QGIS UI themes.

However, when I install QGIS 2.12.0-1 via OSGeo4W there is only the option to choose the default theme.

Does anybody know whether there is another option I am missing to enable the dark theme?

Edit:

According to the QGIS repository the Theme should be saved under QGIS/ressources/themes. I am missing said themes folder even after a re-install and a fresh install of QGIS 2.12 from OSGeo4W.

Edit2:

Nathan Woodrow confirmed it as a bug and is on it. In the meantime I copied the themes folder, like @Mapperz suggested, and everything looks great now.

Edit3:

Annnnnd it is fixed. That was fast!