Hot answers tagged polygon
The simple way to do this, without writing any Python, would be to translate the start and end to a WKT version of the line: Open the csv in Excel or Open Office, or whatever you use Create a new column with the formula: ="LINESTRING(" & A1 & " " & B1 & "," & C1 & " " & D1 & ")" Replacing A1, etc, with your start and end ...
Those lines and vertices are actually holes or islands on your polygon. Try using the delete part or delete ring tools in the advanced digitizing toolbar, and click on one of the nodes. I have noticed that sometimes you need to drag one or more nodes a bit to be able to click on the hole\island boundaries to delete it. Hope it helps.
sapply won't be faster in this case. Try spChFIDs instead (package sp): SPoly <- spChFIDs(SPoly, as.character(SPoly@data[, 3])) From ?spChFIDs: change feature IDs in spatial objects Description When the feature IDs need to be changed in SpatialLines* or SpatialPolygons* objects, these methods may be used. The new IDs should be a ...
If you are using MySQL 5.6.1+, take a look at ST_Contains. Given table called points and polygons, with a primary key called id and a geometry column called geometry, this should work: SELECT points.id FROM polygons, points WHERE ST_CONTAINS(polygons.geom, points.geom); If there's no geometry column for the points table, but there are latitude and ...
I would do this using the Create Fishnet tool wrapped in a Python script tool that uses Feature Sets to request the two coordinates. If you are using ArcGIS for Desktop 10.1 or later then I would recommend doing this as a Python Add-in instead.
Something like this? import arcpy for polygon in arcpy.SearchCursor("path/to/polygon file"): feature = polygon.shape # Set the base geom to each polygon for point in arcpy.SearchCursor("path/to/point file"): feature2 = point.shape # Set the comparison geometry to each point print "Point %d is within polygon %d: %s" % ...
Such holes can often occur when you merge polygons (depending on the data quality). There is a tool called delete ring on the Advanced Digitizing toolbar. Select it and then click near (depending on your snapping presets) one of the nodes around the "hole". This will delete the ring.
As I suggested above the solution to this is to edit the polygons and then using the explode multi-part polygon tool separate the triangles from the rest of the feature, select and delete.
You may use GeoTools, which is an open source java toolkit, for doing your union/dissolve process, check out this Q/A: combine several polygon objects in one polygon object with geotools (is it possible)?
Only top voted, non community-wiki answers of a minimum length are eligible