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
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
  • 17,296
  • 26
  • 100
  • 187
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
  • 350
  • 3
  • 14
4
votes
2 answers

Creating Shape Files from SQL Server using Ogr2ogr

I am trying to run the following code in a command window. The code executes, but it gives me no values in the .SHP files. The table has GeographyCollections and Polygons stored in a Field of type Geography. I have tried many variations for the…
Tor Storli
  • 41
  • 1
  • 3
4
votes
1 answer

Listing Attribute values of Shape file ogrinfo/ogr2ogr

How do I list the values of an attribute in a shape file. ogrinfo -so -al build/SLA11aAust.shp shows the attributes. Which command to list values of STATE_CODE: : Layer name: SLA11aAust Geometry: Polygon Feature Count: 1390 Extent: (96.816941,…
Dawid
  • 165
  • 4
4
votes
1 answer

readOGR(), "cannot open file" error

Let me begin by saying that I have exhaustively looked at the other threads that have dealt with readOGR errors, and have made several attempts to implement them for my own benefit. The issue I have is similar to questions previously addressed:…
MLU0907
  • 43
  • 1
  • 4
4
votes
1 answer

Is there a way to store date and time info in a field in QGIS?

I have a bunch of input values in this format: 2014-05-14 17:42:18 And I would like to store them in a field in QGIS. I am using the Python API for GDAL/OGR. I notice that QGIS supports a field type "QDate", but it seems that it can only handle…
wfgeo
  • 2,716
  • 4
  • 30
  • 51
4
votes
1 answer

Undefined reference to `OGRRegisterAll'

I am trying to write a gdal program to read shapefiles but I don't seem to be able to get past registering the drivers. Here is the code, I'm not sure why the functions in the header files are not available my source file even after including…
4
votes
2 answers

US Zipcode TOPOJson for D3

I am creating US map using D3 , i have to implemented three level zooming , from nation map to state , from state to county and from county to zip boundaries. I am already done with first two level , I used AngularJS directives. GIST URL : D3 two…
Senthil
  • 946
  • 1
  • 14
  • 34
4
votes
1 answer

Are DWG files supported by readOGR in the rgdal package?

I want to read a .DWG file into R. DWG is on the list of supported OGR formats in GDAL: Link So in theory, I should be able to read in the .DWG file using readOGR() in rgdal. But I don't know how to define the dsn. The ogrDrivers() command gives me…
4
votes
0 answers

KML to geojson with ogr2ogr not copying styles

I am running the following command to convert a kml file to geojson: $ ogr2ogr -f GeoJSON geojson.json doc.kml -nln test -append In the KML styles look like this:
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
4
votes
2 answers

VSI File API support in ogr2ogr

It seems that support for streaming input is weak in ogr2ogr. For example, why can I do this: curl "http://data.usgin.org/arizona/wfs?service=WFS&version=1.1.0& request=GetFeature&typeName=azgs:activefaults&maxFeatures=10" | ogr2ogr -f "KML"…
Ryan Clark
  • 301
  • 2
  • 8
4
votes
2 answers

Displaying vector files in QT using GDAL/OGR

I am writing an application to load vector maps/shape files using gdal/ogr and display them onto a gui designed using Qt. I am new to dealing with vector files, I am not able to decide how to render them on GUI. Few approaches that come to my mind…
akshay202
  • 586
  • 1
  • 5
  • 23
3
votes
1 answer

Empty outputs with python GDAL

Hello im new to Gdal and im struggling a with my codes. Everything seems to go well in my code mut the output bands at the end is empty. The no data value is set to 256 when i specify 255, so I don't really know whats wrong. Thanks any help will be…
thomas
  • 31
  • 1
  • 2
3
votes
0 answers

Writing SpatialPointsDataFrame to Shape File gives Error rgdal::writeOGR : Non-unique field names

I'm trying to write a SpatialPointsDataFrame to a Shape file, like so: class(sampled_points) [1] "SpatialPointsDataFrame" attr(,"package") [1] "sp" rgdal::writeOGR(obj=sampled_points, dsn=paste0(getwd(),"/Data"), layer="pixels_pakistan1",…
D. Li
  • 123
  • 6
3
votes
2 answers

No module named ogr

I'm trying to use ogr module, I tried to install it with pip got the errors : Could not find a version that satisfies the requirement ogr (from versions: ) No matching distribution found for ogr tried to install all the package including GDAL and…
Michael
  • 135
  • 2
  • 9
1
2
3
14 15