Any suggestions for how to clip this shapefile to the appropriate bounding box? In particular, I'd like to view only these bounds: [(-105.53 , 39.9) (-104.93,40.27)]. The site for ogr2ogr has an example fo using the -clipdst
option that looks promising. I use Anaconda to manage my python installs. I have GDAL installed such that conda update gdal
produces:
Fetching package metadata: ..
# All requested packages already installed.
# packages in environment at /Users/<me>/anaconda:
#
gdal 1.10.1 np18py27_2
Running which ogr2ogr
ogr2ogr is /Users/<me>/anaconda/bin/ogr2ogr
With the Natural Earth subunits files downloaded and unzipped, I run the following:
ogr2ogr -f GeoJSON -clipdst -105.53 39.9 -104.93 40.27 places.json ne_10m_admin_0_map_subunits.shp
Unfortunately, I receive this error:
ERROR 6: GEOS support not enabled.
I've looked up this error and the suggestion here is to enable geos
(a package that I installed using conda install geos
). So I have geos
version 3.3.3. However, I am lost as to how to enable ogr2ogr
to access the geos
library.
Any help is greatly appreciated. I'm not set on using ogr2ogr
but I didn't see many alternatives.
UPDATE: 2015-02-26
After reinstalling anaconda, I then installed gdal and geos. This is the current situation:
$ ogr2ogr -f GeoJSON -clipdst -105.53 39.9 -104.93 40.27 places.json ne_10m_admin_0_map_subunits.shp
FAILURE:
Unable to open datasource `ne_10m_admin_0_map_subunits.shp' with the following drivers.
-> ESRI Shapefile
-> MapInfo File
-> UK .NTF
-> SDTS
-> TIGER
-> S57
-> DGN
-> VRT
-> REC
-> Memory
-> BNA
-> CSV
-> GML
-> GPX
-> KML
-> GeoJSON
-> GMT
-> GPKG
-> SQLite
-> WAsP
-> PostgreSQL
-> PCIDSK
-> OpenFileGDB
-> XPlane
-> AVCBin
-> AVCE00
-> DXF
-> Geoconcept
-> GeoRSS
-> GPSTrackMaker
-> VFK
-> PGDump
-> OSM
-> GPSBabel
-> SUA
-> OpenAir
-> PDS
-> WFS
-> HTF
-> AeronavFAA
-> EDIGEO
-> GFT
-> GME
-> SVG
-> CouchDB
-> Idrisi
-> ARCGEN
-> SEGUKOOA
-> SEGY
-> ODS
-> XLSX
-> ElasticSearch
-> PDF
-> CartoDB
-> SXF