How can I do this command (source):

ogrinfo -q -sql "SELECT SUM(OGR_GEOM_AREA) AS TOTAL_AREA FROM way" way.geojson

with Python ogr?

from osgeo import ogr
  • Are you aware that the result will not make much sense because GeoJSON is using long/lat degrees as units and square degree as an area unit is useless?
    – user30184
    Aug 13, 2018 at 11:48
  • Is shapefile better? Aug 13, 2018 at 13:28
  • The problem is in the projection, not in the format.
    – user30184
    Aug 13, 2018 at 13:49
  • Don't understand me wrong, what you want to do is OK and you can do it with Python and executeSQL like in gis.stackexchange.com/questions/114112/…. The result just is not useful for you. You must learn a bit about different projections and transform data into some suitable coordinate system for area measurements.
    – user30184
    Aug 13, 2018 at 20:57


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.