1

I am trying to take points and buffer them to create polygons in my django project. I queried for points and tried to take the geometry of the first point and transform it to a meters based system (3395) so I can buffer in meters.

In [32]: from django.contrib.gis.geos import Point

In [33]: p = workingqueryset[0].geo_location

In [34]: p
Out[34]: <Point object at 0x1cfeb4bf090>

In [35]: p.transform(3395)
---------------------------------------------------------------------------
GEOSException                             Traceback (most recent call last)
<ipython-input-35-ee3c41c5bae3> in <module>()
----> 1 p.transform(3395)

C:\Anaconda3\lib\site-packages\django\contrib\gis\geos\geometry.py in transform(self, ct, clone)
522
523         if not gdal.HAS_GDAL:
--> 524             raise GEOSException("GDAL library is not available to transform() geometry.")
525
526         if isinstance(ct, gdal.CoordTransform):

GEOSException: GDAL library is not available to transform() geometry.

I have gdal installed with python bindings and even have the GDAL_DATA variable set up for postgis. I've never ran into a gdal issue before. I found this answer but I definitely have gdal already installed and variables set up.

In [36]: import gdal

In [37]: p.transform(3395)
---------------------------------------------------------------------------
GEOSException                             Traceback (most recent call last)
<ipython-input-37-ee3c41c5bae3> in <module>()
----> 1 p.transform(3395)

C:\Anaconda3\lib\site-packages\django\contrib\gis\geos\geometry.py in transform(self, ct, clone)
522
523         if not gdal.HAS_GDAL:
--> 524             raise GEOSException("GDAL library is not available to transform() geometry.")
525
526         if isinstance(ct, gdal.CoordTransform):

GEOSException: GDAL library is not available to transform() geometry. 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.