New answers tagged

2

row.getPart(0) is necessarily returning the first geometry in the row, so it won't be an iterable. Thus your code becomes: import arcpy # Set up the Environment arcpy.env.overwriteOutput = True arcpy.env.workspace = r"C:\temp" fc = r"C:\Utemp\cities.shp" fields = ['SHAPE@XY'] output = open(r"C:\temp\cities.txt", 'w') COFilePath = r"C:\temp\cities.csv" ...


1

There are two answers depending on your definition of distance: bird's flight or along the road. they wil be identical on a straight line but differ on curves or broken lines. bird's flight you could create a buffer around your point, then intersect the buffer geometry with the line. You can do this for all your points at once using the geoprocessing tool ...


0

The solution was to use a SearchCursor and an InsertCursor to copy the data from the event layer to the feature class. This solution was found here. It is multple times faster than the arcpy.CopyFeatures_management tool.


-1

I solved this problem with Java + Ibatis implementing the interface TypeHandlerCallback. You need to add postgis.jar lib; Create a handle class implement TypeHandlerCallback from Ibatis;


1

try this: var provider = vectorLayer.DataSource; var geometry = p.GetGeometryByID(fid); var location = geometry.Centroid.Coordinate; //map.Center = location; mapBox1.Map.Center = location; mapBox1.Refresh();


0

I am not familiar with sharpmap, but from the available documentation I guess you could do as follows: Get the envelope of the point call map.ZoomToBox(Envelope) with the envelope as a parameter. Probably (1) can be achieved by calling something like new Envelope(-9.205626, -9.123736, 38.690993, 38.740837) with the point coordinates as parameters. Or ...


2

I propose two different ways. Using processing tools: see my answer to another question. It is not difficult to adapt it to your problem, since it is about polygon overlays A Python script to copy&paste into Python console or to run from Python editor The script get 2 layers A, B. Replace them with the names of your layers. B is the one providing ...


2

You've got a few options depending on how your data is organized. You can perform a table join/relate using a common field between your data sets (with the .dbf of shape file A as the table being joined to shape B) or if your .dbf's present data for the exact same shapes in the exact same order you should be able to replace the .dbf from one to another. ...


2

Best explained from Microsoft in Spatial Data Types Overview: Measurements in spatial data types In the planar, or flat-earth, system, measurements of distances and areas are given in the same unit of measurement as coordinates. Using the geometry data type, the distance between (2, 2) and (5, 6) is 5 units, regardless of the units used. In the ...


1

I'll speculate that what the GeoDjango docs are trying to say is that if you have geographic (lat/lon) data, and you want to perform range queries on that data (like ST_DWithin) in meters rather than units of degrees, then you are better served by using the geography type, which uses meters natively. The geography distance calculations themselves (ie ...


5

Distance calculations that assume shortest distance on the Earth will always be faster than geometry because geometry can be in any projection, and there's no way generally to know that the shortest path in that projection is the 'shortest path' and so you need to go to ellipsoid calcs and potentially insert more vertices for the curvature from the source to ...


-1

This article has good examples using both GEOPY and PYPROJ and potential issues with underlying calculations.


4

Yes. QGIS: the QuickWKT plugin. The description of the tool is as follows: Quick WKT/WKB viewer, this Qgis Plugin opens a dialog where the user can paste (E)WKT and WKB code and see it on the map. Pasted data are stored in a temporay (memory) layer and are completely lost when the user quits QGIS. Wicket: if you need/want to do this in the ...



Top 50 recent answers are included