Tag Info

New answers tagged

1

Maybe try something like this? http://docs.geotools.org/stable/userguide/library/jts/geometry.html#creating-circularstring


0

After a lot of thinking and research here, I believe I found a solution. I would love to receive some peer review and feedback on this approach. I used ogr2ogr to generate a GeoJSON file from a PostGIS query using the CIRCULARSTRING function. ogr2ogr -s_srs EPSG:26910 -t_srs EPSG:26910 -f GeoJSON testArc.geojson PG:"host=localhost ...


1

Not really a answer but a valid workaround: because the CreateLayer() method accept a SRS as parameter, one can create a new empty layer with the correct SRS and then fill it with the features from the input layer: import ogr driver = ogr.Open(input_file).GetDriver() datasource = driver.Open(input_file, 0) input_layer = datasource.GetLayer() dest_srs = ...


2

Don't expect OGR to be Pythonic. In fact, there is a large list of gotchas documented to describe these. Essentially, all of the variables are references to objects described in C++, so they often don't make sense with workflows in Python. Modules like copy only work on Python objects, which is why your example doesn't work as expected. You need to keep ...


0

Use this if you don't care ppa addition, $ sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable $ sudo apt-get update $ sudo apt-get install python-gdal


0

First if you are on windows,then there are straight away installers,on the link told my friends above.But if you are on Linux this is the way for installing libgdal 1.11. go to this page http://packages.ubuntu.com/trusty/libgdal1h download the required .deb file choosing your system architecture. after downloading it go to downloaded directory and run ...


1

Your 'ENGL_NAME' shouldn't be abbreviated at all (less than 10 characters), but writeOGR has its own will, it seems. Instead of writeOGR(shp, "PolygonsV2", speciesname, driver="ESRI Shapefile") you might try currdir <- getwd() #store your current working directory setwd(paste(currdir,"PolygonsV2",sep="/")) #switch to your desired folder ...


0

There is a node.js module and not just for ogr and osr but for the whole of gdal. You can find the repository here.


4

This is a GDAL/OGR Python gotcha. So when you use print inputlyr[0].GetGeometryRef(), the reference to the indexed feature has been cleaned up before geometry functions can be used. This is expected behaviour, and there is no roadmap to change it. The issue is that the GDAL/OGR Python bindings are over a decade old, and are tightly coupled with the ...


0

The build is broken. After a long debugging, I found out that if PROJ4 isn't compiled before gdal, the resulting library will NOT work correctly with different reference spaces.


1

In your solution you mix geometries and predicates of ogr and Shapely With Shapely only (intersection(), intersects()) from shapely.geometry import Point, LineString, mapping geom1 = LineString([(0, 0), (0, 1)]) geom2 = LineString([(1, 1), (-1,-1)]) intersection = geom1.intersection(geom2) # geo_interface -> GeoJSON mapping(intersection) {'type': ...


3

Numbers in any programming language does not have "absolute" precision. As they must be represented as bits in the computer hardware its precision is limited. Anyway review this links, because maybe they can help you: http://comments.gmane.org/gmane.comp.gis.gdal.devel/19331 http://lists.osgeo.org/pipermail/gdal-dev/2011-August/029793.html



Top 50 recent answers are included