Tag Info

New answers tagged

4

When you start with a Python module, there are several solutions to find the available functions. One of them is dir: geom = feat.GetGeometryRef() print dir(geom) ['AddGeometry', 'AddGeometryDirectly', 'AddPoint', 'AddPoint_2D', 'Area', 'AssignSpatialReference', 'Boundary', 'Buffer', 'Centroid', 'Clone', 'CloseRings', 'Contains', 'ConvexHull', 'Crosses', ...


1

Go to the Python GDAL/OGR Cookbook 1.0 documentation and you'll have the answers to all your questions: from osgeo import ogr driver = ogr.GetDriverByName('ESRI Shapefile') shape = driver.Open('my.shp') layer= shape.GetLayer() # the crs crs = layer.GetSpatialRef() and you can also create a projection file if the shapefile does not ...


1

ogrinfo layer.shp layer -so will give you general information about the shapefile.



Top 50 recent answers are included