Tag Info

New answers tagged

2

Since OGR version 1.10.0 the sqlite SQL dialect has been able to be applied to any spatial datset. Which is great, as it means that you can apply it to your GeoJSON files. Looking at the OGR GeoJSON documentation you can see that the layer name for a GeoJSON file is OGRGeoJSON which means that the SQL that selects from the GeoJSON file will translate from ...


0

Providing a Environment Variable to the GDAL data directory solved it. import os os.environ["GDAL_DATA"] = 'C:\Python27\Lib\site-packages\osgeo\data\gdal' import fiona from fiona.crs import from_epsg schema = {'geometry': 'Point', 'properties': {'X':'float'}} shp = fiona.open('F:/temp/asdf.shp', 'w', driver='ESRI Shapefile',crs=from_epsg(4326), ...


0

POINT (13531245.47570414 2886003.268927813) is not a Shapely object but the WKT format of a Point A point in Shapely is : point1 = Point(13531245.47570414,2886003.268927813) type(point1) <class 'shapely.geometry.point.Point'> The WKT representation of the point is: # WKT print point1.wkt POINT (13531245.47570414 2886003.268927813) ...


1

Your capital_pt is the coords attribute of the original capital shapely geometry object. In itself this is not a shapely geometry, rather a sequence of tuples of flots which are the point objects. Instead you should be using distance_between_pts = capital.distance(city_items) Given your case where you're trying to calculate distances for all points in a ...


2

If you only want the point coordinates, you don't need Shapely, simply use the appropriate key of the dictionary: for point in filter_list: print point['geometry']['coordinates'] (270977.604378, 153144.810665),... If you want a Shapely geometry, use the shape function of Shapely: from shapely.geometry import Point, shape for point in filter_list: ...


2

A MultiPoint, by definition, comprises several points, so geom = '{"type": "MultiPoint", "coordinates": [[100.0, 0.0], [101.0, 1.0]]}' geom = ogr.CreateGeometryFromJson(geom) # iterate through the points for i in range(0, geom.GetGeometryCount()): g = geom.GetGeometryRef(i) print "%d,%d" % (g.GetX(), g.GetY()) 100,0 101,1 as explained in Iterate ...


0

AFAIK, QGIS can't load FileGDB using either the ESRI FileGDB API or the OpenFileGDB driver from a zip file, even though GDAL supports reading datasets via the /vsizip/ method. Loading datasets from a zip file is something that needs to be coded into QGIS. Feel free to open a feature request if one doesn't exist already =) Your dataset is probably valid and ...


2

You can test it with gdalsrsinfo http://www.gdal.org/gdalsrsinfo.html gdalsrsinfo epsg:3068 PROJ.4 : '+proj=cass +lat_0=52.41864827777778 +lon_0=13.62720366666667 +x_0=40000 +y_0=10000 +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.45 5,6.7 +units=m +no_defs ' OGC WKT : PROJCS["DHDN / Soldner Berlin", GEOGCS["DHDN", ...


0

For reference: Note that there is a fiona package in debian gis (waiting in the new queue) and on ubuntugis unstable (you can install packages python-fiona and python3-fiona). For building from source you will need Cython (recent version 0.21) and libgdal-dev. You can actually check the full build dependencies in the package mentioned above.



Top 50 recent answers are included