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
1
vote
0 answers

PHP GDAL/OGR library

I would like to run ogr2ogr in exec() function. How to do it? I installed GDAL and I can run ogr2ogr using GDAL Command Prompt but can't use it in exec(). Im using XAMPP and I tried to find some libraries which I can add, but didn't find anything…
wtk13
  • 387
  • 1
  • 6
  • 15
1
vote
1 answer

Script Loop through files in directory

I have the following code which creates the txt file I require from a shp.file with the data I need. I have a folder called profiles containing a few number of shape files named (profil1.shp, profil2.shp, profil3.shp etc.). I was wondering how to…
1
vote
1 answer

Necessary to Reproject Raster before Mosaic?

I have a list of rasters which I would like to mosaic together. The projection is the same except for the utm zone. Here is the coord line from one rasterStack in UTM zone 50: coord. ref. : +proj=utm +zone=50 +datum=WGS84 +units=m +no_defs…
Michael Davidson
  • 1,391
  • 1
  • 14
  • 31
1
vote
1 answer

Wrong field type in osgeo.org for ogr.FieldDefn('field', ogr.OFTInteger)

I have a problem with osgeo.org for python using versions python version 2.7 osgeo.org version 1.3.39 I want to use osgeo to convert MapInfo File from MongoDB. With from osgeo import ogr, osr, gdal driver = ogr.GetDriverByName("MapInfo File") …
1
vote
0 answers

D3js projection EPSG code for ogr2ogr?

I use d3js for vector projection, it's something such as d3.geo.mercator(): var projection = d3.geo.mercator() .scale(150) .translate([0, 0]); I also use ogr2ogr for raster projections, it's something such as epsg:3857: gdalwarp -of…
Hugolpz
  • 17,296
  • 26
  • 100
  • 187
1
vote
0 answers

How to use ogr2ogr in java gdal

I would like to code ogr2ogr -f "GeoJSON" destination.geojson source.geojson -s_srs EPSG:3068 -t_srs EPSG:4326 in java-gdal. I tried to understand how it should work by looking at this example but since ogr2ogr has many many uses I could not quite…
Selphiron
  • 897
  • 1
  • 12
  • 30
1
vote
1 answer

How to register a Boost.Geometry distance strategy for OGRPoint and OGRLineString?

I am creating a wrapper that allows using OGR's classes with Boost.Geometry. So far, I've created that necessary iterator facade and registered OGR's geometry classes (OGRPoint, OGRLineString, OGRLinearRing and OGRPolygon) with Boost.Geometry. Now,…
Technaton
  • 944
  • 4
  • 15
1
vote
0 answers

python shapely plot multiple layers

There is a set of (lat, long) points which can be simply visualized by matplotlib.pyplot.scatter(list_of_longitudes, list_of_latitudes). But I want to plot these points on top of a road network which happens to be in a shapefile. How can I simply…
Asif Rehan
  • 983
  • 2
  • 8
  • 25
1
vote
2 answers

Using GDAL and ogr utilities in MAC terminal in conjunction with QGIS

I am pretty new to the open-source GIS software. I am trying to clip and project data layers using GDAL and ogr in my MAC terminal. I can get the data to clip when I am just clipping but when I try and combine the two (clip and project), I am…
Ash
  • 81
  • 1
  • 9
1
vote
1 answer

How to clip a shapefile to a bounding box?

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…
blehman
  • 1,870
  • 7
  • 28
  • 39
1
vote
0 answers

Using gdal (1.11.0) to export from SQL Server 2008 R2 to KML

I've got a SQL Server table that I'd like to turn into a KML file. I've kind of got it working, but not quite. Here's my command: C:\Temp\gdal>ogr2ogr -f "KML" "test.kml" "MSSQL:server=devbox;database=test;trusted_conneciton=yes" -sql "SELECT name,…
dfmurphy
  • 11
  • 3
1
vote
0 answers

Java not recognizing GDAL/OGR environment variable

Doing some stuff on OGR in Java - specifically importing a spatial reference from EPSG code, I get this error: ERROR 4: Unable to open EPSG support file gcs.csv. Try setting the GDAL_DATA environment variable to point to the directory containing…
wowohweewah
  • 429
  • 5
  • 16
1
vote
1 answer

Error on ogr2ogr to generate a US state map for d3

I am attempting to get a topojson file with US state names & ids. Using http://www.tnoda.com/blog/2013-12-07 for reference. I read that it was recommended we generate our own topojson files and I have been attempting to get ogr2ogr working on MAC…
shrnkrn
  • 121
  • 1
  • 9
1
vote
0 answers

Transformation of OGR style data

I have been using GDAL/OGR in a project and it is going quite well. I have been re-projecting data from various source formats into a single CRS (using the C# bindings), but one issue I have come across is with the associated OGR style…
Mohit Vashistha
  • 1,824
  • 3
  • 22
  • 49
1
vote
1 answer

Associate shadows to their source in image analysis

I've got two rasters. The first one corresponds to an cloud mask, that is an image with 1 when the pixel corresponds to a cloud and 0 when it does not. The second is a shadow mask, 1 if the pixel is classified as a shadow, else 0. To reduce the…
WAF
  • 1,141
  • 20
  • 44