Tag Info

Hot answers tagged

2

Using IDLE, I ran your test using ArcGIS 10.2.2 for Desktop, immediately after a reboot (by coincidence) so there should be nothing laying around from previous tests. The code is identical to the third example at Writing Geometries, and I agree with you that the point does not get written. I believe that part of the documentation is in error and that ...


2

PyScripter is somewhat lax with object lifetimes and will keep stuff around after it's run. Use the with statement to ensure you close the edit session. import arcpy fc = r"C:\Users\djh\Desktop\topo_map\test.gdb\well_location" xy = (206901.75, 5997594.47) with arcpy.da.InsertCursor(fc, ["SHAPE@XY"]) as cursor: cursor.insertRow([xy])


2

Shapely PyQGIS, and GeoDjango use the same API based on the GEOS library: With Shapely: with a list of points: from shapely.geometry import Point, LineString, mapping pt1 = Point(0,0) pt2 = Point(20,20) pt3 = Point (50,50) line = LineString([pt1,pt2,pt3]) #GeoJSON format print mapping(line) {'type': 'LineString', 'coordinates': ((0.0, 0.0), (20.0, ...


2

You probably should just create a new column and I would suggest if you are new to PostGIS, you probably want to use geography instead of geometry. So somethng like ALTER TABLE m_copy ADD COLUMN geog geography(POINT,4326); UPDATE m_copy SET geog = ST_SetSRID(ST_Point(longitude,latitude),4326)::geography; If you decide to use geometry, just replace the ...


1

Alternatively, if you do not have an Advanced license and you do want centroids even if they fall outside the shape, there is another slightly more involved method. Open the polygon attribute table and create two new fields, X and Y. Right-click on each one in turn and use Calculate Geometry to calculate the respective X centroid coordinate and Y centroid ...


1

Sounds like you are using the wrong tool. To create a separate dataset of points that are the centroids of a polygon use the Feature To Point tool. It requires an Advanced license.


1

That's a feature in pgadmin/PostGIS - it won't show geometry column values if they are too long. It's mentioned in the PostGIS manual http://postgis.net/docs/manual-dev/PostGIS_FAQ.html#pgadmin_shows_no_data_in_geom


1

include ESRI.ArcGIS.DatabaseSourcesFile in your project here is a C# code showes you how to open a shape file,you can convert it to VB.Net simply IWorkspaceFactory ipShapeWF = new ShapefileWorkspaceFactoryClass(); `//strfilepath the path to shape file,include only folder not shape file itself' IWorkspace ipShapeWS = ipShapeWF.OpenFromFile(strfilepath, 0); ...


1

JTS polygons are clockwise (see http://tsusiatsoftware.net/jts/jts-faq/jts-faq.html#B6 for an explanation of why). Why it would give you an invalid geometry is a difficult question to answer with out seeing your input polygons. Most likely causes are self intersection, self touching, invalid geometry in input list.


1

My lib PyGeoj is specifically meant as a geojson file reader and writer, with a simple API that turns the file contents into objects with attributes, so you don't have to deal with the dictionaries directly. It also has some convenience methods, like calculate and add the bbox for the entire feature collection or just for each feature. So for instance, the ...


1

Probably after your requirements get complicated, it is best to think of making a scalable application. The advantage of working with a geometric column is the index, plus you can also work with wkt, GeoJSON and other standards that openlayers postgis and handle very well, so you would simplify the development Here you can find a good tutorial



Only top voted, non community-wiki answers of a minimum length are eligible