Questions tagged [ogr]

The OGR Simple Features Library is a C++ open source library (and commandline tools) providing read (and sometimes write) access to a variety of vector file formats including ESRI Shapefiles, S-57, SDTS, PostGIS, Oracle Spatial, and Mapinfo mid/mif and TAB formats. OGR is a part of the GDAL library

The OGR Simple Features Library is a C++ open source library (and commandline tools) providing read (and sometimes write) access to a variety of vector file formats including ESRI Shapefiles, S-57, SDTS, PostGIS, Oracle Spatial, and Mapinfo mid/mif and TAB formats.

OGR is a part of the GDAL library

199 questions
31
votes
7 answers

readOGR() cannot open file

wmap <- readOGR(dsn="~/R/funwithR/data/ne_110m_land", layer="ne_110m_land") This code is not loading the shape file and error is generated as Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, : Cannot open…
Ritesh Jung Thapa
  • 967
  • 2
  • 11
  • 18
15
votes
2 answers

In R and knitr, can I suppress the message of readOGR?

I'm building small report using R & knitr, sending the output to pdf. I'm using several shape files in my analysis and whenever I use readOGR function of rgdal package I get information on what is being read, for instance: OGR data source with…
radek
  • 6,256
  • 7
  • 48
  • 74
14
votes
2 answers

How can I get the installed GDAL/OGR version from python?

How can I get the installed GDAL/OGR version from python? I aware of the gdal-config program and are currently using the following: In [3]: import commands In [4]: commands.getoutput('gdal-config --version') Out[4]: '1.7.2' However, I suspect…
fmark
  • 50,804
  • 25
  • 88
  • 106
11
votes
2 answers

What is relationship between GDAL, FDO and OGR?

Their documentations are simple and professional. But they don't mention too much about the relationship between these open source projects. When should I use which one? And which one is suitable for what scenario? If you are a GIS developer who is…
Cui Pengfei 崔鹏飞
  • 7,124
  • 4
  • 38
  • 79
10
votes
1 answer

Get feature extent using gdal/ogr

This feels like something that should already have a function to do easily, but I can't find one. What I'm ultimately trying to do: I have a shapefile with 3 features that show bounding boxes; I want to use one of those features to select all the…
Jessica
  • 423
  • 3
  • 11
10
votes
2 answers

Incorporating GDAL/OGR into an iOS project - A quick guide

Here is the problem: GDAL is a fantastic open source library designed to manage complex GIS data, both raster as well as vector. It is fully compiled for the Mac OS (courtesy of William Kyngesburye) and other platforms but not for iOS. Browsing the…
MiKL
  • 1,820
  • 1
  • 15
  • 23
8
votes
2 answers

How to extract vertexes of geometries in ESRI shapefiles using ogr library with c++

I have answered the question and also changed the title of the question from How to access vertices in a polygon layer using ogr library with c++ to How to extract vertexes of geometries in ESRI shapefiles using ogr library with c++. The code can…
Sepideh Abadpour
  • 2,039
  • 9
  • 44
  • 78
8
votes
1 answer

gdal/ogr: How to really crop a shapefile?

Given a SHP file corresponding to European countries, and... Given defined area corresponting to France such : West : 005° 48' W East : 010° E North : 051° 30' N South : 041° N How to get only the dots/geometries which intersects my defined area…
Hugolpz
  • 14,637
  • 24
  • 85
  • 173
6
votes
1 answer

Adding custom Feature attributes to ESRI Shapefile with Python

I am seeking a way to take an existing ESRI Shapefile that has a Feature set of 200 countries. Each country Feature has an attribute of "NAME." My objective is to create a Python script that adds an arbitrary (for now) additional attribute, say,…
mattdeboard
  • 680
  • 1
  • 6
  • 17
6
votes
1 answer

GTiff mask with shapefile in python with gdal, ogr, etc

OK, After a bit of fiddling, I've tweaked a script from the site hyperlink in the second comment line. The purpose of the script is to clip/mask a LARGE raster (i.e. that cannot fit into a 32-bit Python 2.7.5 application) in GTiff format with a…
ksed
  • 317
  • 1
  • 4
  • 11
5
votes
1 answer

Can't get EPSG from Shapefile with OGR/GDAL

At this moment, i'm working in a shapefile visor in C++ and QT and using the GDAL/OGR library. I have this method to get the EPSG of my shapefiles: OGRLayer layer = dataset->GetLayer(0); OGRSpatialReference *spatialRef =…
Zharios
  • 183
  • 17
5
votes
1 answer

Ways to project topojson?

Given a shapefile : Natural_earth/ne_10m_admin_0_sovereignty.zip Given we want to reproject it for a D3js data viz, we could reproject at different levels. 1. Get a reprojected shapefile (1), using ogr2ogr : ogr2ogr -f 'ESRI Shapefile' -t_srs…
Hugolpz
  • 14,637
  • 24
  • 85
  • 173
5
votes
3 answers

trouble installing Fiona in python cpl_error.h: No such file or directory

I have tried to install geopandas two different ways: pip install geopandas or by cloning git clone https://github.com/kjordahl/geopandas In both cases, the installation file setup.py runs for a while and then returns this error…
john mangual
  • 6,258
  • 10
  • 47
  • 85
5
votes
1 answer

Gdal: How to conditionally assign a new value to pixels of a raster image?

Given a topographic GIS raster of one country crop.tif: # download: curl -o ETOPO1.zip 'http://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registered/georeferenced_tiff/ETOPO1_Ice_g_geotiff.zip' # unzip: unzip ETOPO1.zip #…
Hugolpz
  • 14,637
  • 24
  • 85
  • 173
5
votes
2 answers

PHP GDAL/OGR library usage, which approach is cleaner?

I will be using gdal/ogr for a new project. I want a lean but fully functional app, so will not be using other implementations such as mapserver, because they have extraneous components that I doubt will be needed in the application, even in the…
Ego_I
  • 250
  • 2
  • 14
1
2 3
13 14