I have a shapefile that contains data for both sides of the Greenwich meridian.
According to ogrinfo
, this shapefile has the extents of (-9.298157, 35.265607) - (4.327108, 45.046054)
. I want to copy all data in the bounding box (42.5, -0.5) - (43.5, 1)
. But using ogr2ogr
, I got an empty shapefile (it had just 100 bytes …)! I used the following command:
ogr2ogr -progress -spat 42.5 -0.5 43.5 1 outfile.shp infile.shp
If ogr2ogr
does not understand negative coordinates, then how do I get that data out of that shapefile?
-spat -0.5 42.5 1 43.5