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

212 questions
35
votes
8 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
  • 1,177
  • 2
  • 13
  • 20
19
votes
3 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
  • 7,240
  • 8
  • 58
  • 83
16
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
  • 57,259
  • 27
  • 100
  • 107
13
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
  • 505
  • 1
  • 3
  • 11
12
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 崔鹏飞
  • 8,017
  • 6
  • 46
  • 87
11
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,850
  • 1
  • 15
  • 23
10
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,550
  • 10
  • 52
  • 88
10
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
  • 17,296
  • 26
  • 100
  • 187
8
votes
2 answers

Dissolve Overlapping Polygons (with GDAL/OGR) while keeping non-connected results distinct

Is there any way to dissolve (merge) overlapping polygons, using any GDAL/OGR API or command line tool, while keeping the resulting non overlapping areas distinct? I have searched a lot and I cannot find anything resembling what need. However, I…
StarSheriff
  • 1,477
  • 2
  • 17
  • 23
6
votes
2 answers

Use GeoDataFrame as a osgeo.ogr DataSource

I have read shapefile into a GeoDataFrame and did some modification to it: import geopandas as gpd # Read shapefile into geodataframe geodf = gpd.read_file("shapefile.shp") # Do some "pandas-like" modifications to shapefile geodf =…
Marjan Moderc
  • 2,747
  • 23
  • 44
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
  • 700
  • 1
  • 7
  • 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
  • 335
  • 1
  • 4
  • 13
6
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
  • 17,296
  • 26
  • 100
  • 187
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
  • 1
  • 18
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
  • 7,718
  • 13
  • 56
  • 95
1
2 3
14 15