New answers tagged

1

From the Python GDAL/OGR Cookbook: Create a Polygon (and the correct formulation is Point(x,y) -> Point(longitude, latitude) ) ring = ogr.Geometry(ogr.wkbLinearRing) ring.AddPoint(-122, 40) ring.AddPoint(-120, 40) ring.AddPoint(-120, 39) ring.AddPoint(-122, 39) ring.AddPoint(-122, 40) # close the LinearRing - Polygon poly = ogr.Geometry(ogr.wkbPolygon) poly....


1

I don't think there is a workaround to this. I'm having the same problem and I just ended up leaving the generated FID column as is and created an unique index on the column I wanted to create the primary key on. If you don't really need a primary key but just an index and/or a unique constraint then just go that way. I found this link where it has been ...


0

We have to: Replace the second geometry by using: ST_GeomFromText('POLYGON(( # #, # #, ... ))' Select the required columns: column1, column2, column3 Use the SQL function ST_Intersects ogrinfo myTargetLayer.shp -dialect sqlite -sql "SELECT column1, column2, column3 FROM myTargetLayer WHERE ST_Intersects(GEOMETRY, ST_GeomFromText('POLYGON(( # #, # #, ... )...


Top 50 recent answers are included