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
0
votes
0 answers

OGR2OGR and SQL: selecting only official cities in places from a country?

I am building a geojson with gdal and the ogr tool. I am doing something like to retrieve places of one particular country. ogr2ogr -f GeoJSON -where "adm0_a3 = 'CODEISO3OFMYCOUNTRY'" places.json ne_10m_populated_places.shp Then I am drawing all of…
ackuser
  • 5,681
  • 5
  • 40
  • 48
0
votes
0 answers

Gdal crashes when creating geometry from json

I want to create a geometry from a geojson file. I load the file with the json library in python 2.7, then use this line point = ogr.CreateGeometryFromJson(geojson) to convert. This line is from the ogr library which depends on the GDAL Library…
four-eyes
  • 10,740
  • 29
  • 111
  • 220
0
votes
1 answer

Geopy to shapefile

Trying to use the latitude and longitude that is returned by geopy to create a shapefile. The shapefile creator part works line if I give it a set of numbers (44.977753, -93.2650108) but it will not work with the returned data lat_long. My thought…
jeffkrop
  • 147
  • 1
  • 1
  • 9
0
votes
0 answers

Django Truncating Floats

I'm having an issue similar to https://groups.google.com/forum/#!msg/django-users/I-YH28xg0po/59ZJawSlTVkJ in which when I upload data into my database via LayerMapping import utility, it is truncating the float fields all the way down to integer…
brock
  • 365
  • 1
  • 3
  • 11
0
votes
0 answers

Access violation in Visual Studio when compiled with Multi-threaded Debug DLL

I am building an application using the GDAL/OGR library and have faced a really strange issue, namely getting an access violation error when running my program compiled with Multi-threaded Debug DLL (/MDd) runtime library option. The following…
mcserep
  • 3,231
  • 21
  • 36
0
votes
0 answers

Creating a shapefile using PyQt4 and GDAL/OGR: rounds down decimals

this post is the sequel of this other post: Can't write decimal data into shape (shp) attribute table with Python In that post I tried to simplify the problem, but it was a mistake, because that didn't express my real problem. I'm Sorry. The problem…
Rodrigo E. Principe
  • 1,281
  • 16
  • 26
0
votes
0 answers

Comparing the coordinates with GEOS C++ fails

I m trying to compare every point of MultiPoint geometry with start point and end point of LineString , there is my code below: First method: geos::geom::LineString* ptLine = dynamic_cast( ptCurrentGeomIntersection ); for( int…
0
votes
2 answers

gdalinfo - how to pause the outputting data

I am using GDAL. in command prompt, i am doing $ gdalinfo (my file location) It works but because it is a huge file the command gives a lot of information. I am only interested in seeing what's near the beginning. The command prompt only allows…
mark
  • 1
  • 2
0
votes
1 answer

Python GDAL/OGR - get KML headers

Is there anyway to get the KML name and/or description fields using GDAL/OGR for Python? I can get the fields for the individual layers easily enough, just not for the entire thing. Code is: from osgeo import ogr file = #path to file goes…
Josh
  • 3,385
  • 5
  • 23
  • 45
0
votes
1 answer

Python gdal stopped working when using ogr Within, Contains or other

Update: By further ivestigation I found out it must be caused by somehow corrupted geometry. But even if I run: if drillhole[1].IsValid(): It is causing the crash. So not sure how to check it. I am trying to test if lines are within polygons. Using…
Miro
  • 599
  • 10
  • 29
0
votes
1 answer

Node-GDAL npm module, how to use Ogr2Ogr

I installed the npm module, GDAL, is the ogr2ogr utility bundled with the module or must I install additional npm modules?
RustyShackleford
  • 25,262
  • 6
  • 22
  • 38
0
votes
2 answers

Create a well-behaved iterator for a write-to-pointer API

I have to create an iterator for an API that features old-style "write-out to pointer" accessors only. The API in question is OGR's; one of the classes in question is OGRLineString (For reference: Link). This class stores a number of points, which…
Technaton
  • 944
  • 4
  • 15
0
votes
1 answer

OGR Geometry changes Floating Points

I'm creating a Polygon in OGR and adding coordinates to it in Python. It is a must that my coordinates aren't allowed to change when adding, however they do and I don't understand why. Here is my example: import ogr ring =…
Timothy Dalton
  • 1,290
  • 2
  • 17
  • 24
0
votes
1 answer

How can I open an unzipped map file

I am trying to read a zipped map file to use as a map overlay on contours, but I do not seem to be able to unzip the file. Below are the commands I have; library(rgdal) setwd("C:/R_Progs") unzip("ZMB_adm.zip") zmb <- readOGR(dsn = "C:/R_Progs",…
Zilore Mumba
  • 1,346
  • 4
  • 23
  • 33
0
votes
1 answer

ogr2ogr to import GML with spatial and non-in SQL Server

I am trying to use ogr2ogr to import GML file into SQL Server Spatial. I successfully import features with geometry, but I have few without geometry column. How can I import all of them? EDIT: I reinstalled GDAL, installed latest, works fine, but…
Aleksandar
  • 1,163
  • 22
  • 41