New answers tagged osgeo
1) I just don't know how to convert .geojson file to .shp. This is a one of the bases of ogr Python. If you have a geometry, it is very easy to convert it to a shapefile # geojson is GeoJson Polygon from osgeo import ogr output = "geojson.shp" driver = ogr.GetDriverByName('ESRI Shapefile') if os.path.exists(output): driver.DeleteDataSource(output) ...
To cut an image (tif file) by using GDAL python library, and without gdalwarp utility, you need to find row and column raster indexes of top point [p1=(minX, maxY)] and bottom point [p2=(maxX, minY)]. The formulas, based in your code, are: i1 = int((p1 - xOrigin) / pixelWidth) j1 = int((yOrigin - p1 ) / pixelHeight) i2 = int((p2 - xOrigin) / ...
sr.ImportFromEPSG() You have the S and P transposed. For the record, I don't see an entry for EPSG::29613 so that code may be invalid or deprecated. http://epsg.io/?q=29613
Top 50 recent answers are included