Hot answers tagged geometry
Here's a pared down version of @crmackey's answer. The polygon layer is called 'POLY1', and should be the only thing you need to change to get an output point file of farthest vertices - it creates centroids on-the-fly: >>> points =  >>> with arcpy.da.SearchCursor("POLY1",['SHAPE@']) as cursor: ... for row in cursor: ... ...
Those coordinate differences are measured in Angstroms. File geodatabase uses a technique similar to the integer storage representation conversion in enterprise geodatabases (ArcSDE) to snap 64-bit floating-point coordinate values to a feature class coordinate resolution grid. This coordinate resolution is established at feature class creation (and it's ...
I have figured this one out. I ended up using the NeighborFinder as I initially suspected. The trick is to store all candidate details in a list (I called it NeighbourList). I then connected that to a ListExploder to create features from all elements in the list. Then I used a tester to filter out the features with a distance of zero. Finally, I used ...
Maybe you can modify pySkeleton by Olivier Teboul to suit your needs. I haven't had the chance to look at the actual code but from what he says it should be pure Python.
Further to Russell's Answer It's unfortunate that you have you locations stored in the wrong data type. The easiest way to get an accurate distance between your is to cast the geometries as geographies. You will need to confirm the the Lat is stored in the Y and the Long is stored in the X of the geometry, otherwise you will most likely end up with ...
It's kludgy, but you could query point geometries into geography SELECT Geography::STPointFromText('POINT(' + CAST(geomcol.STX AS Varchar(20)) + ' ' + CAST(geomcol.STY AS Varchar(20)) + ')', 4326).STDistance(...)
If your data is stored in your SQL Server database as native spatial data, you can certainly do this. Assuming your territories (T) and sub-territories (ST) have attributes for their name and/or type, my suggestion would be along the lines of: Create a view (a dynamic table in your database) that joins your two polygons together using a join, where the ...
This seems to be peanuts for JTS. Let's hope that the method is ported into GEOS so that you can enjoy from it with Python and PostGIS. JTS has a minimum diameter method tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/… that can also directly return "the minimum rectangular Polygon which encloses the input geometry". Convert you point set into ...
I guess you are looking for ol.geom.Polygon.fromExtent(extent). Try to uncheck the "Stable Only" checkbox in the API docs to see all methods.
I think your feature layer is not projected into Projected Coordinate System(e.g UTM). So re-project Geographic Coordinate Systems (e.g WGS84) into Projected (e.g UTM) and then you will be able to calculate area.
This worked for me. The script will create an output point feature class that returns the point that is farthest from the centroid for all polygons: import arcpy import os import sys import traceback import math from datetime import datetime as d arcpy.env.overwriteOutput = True def Message(msg): print str(msg) arcpy.AddMessage(msg) def ...
Only top voted, non community-wiki answers of a minimum length are eligible