2

I have to do some geometrical calculations in 2D(point, lines, line segments and intersection points) in Python, and then use it in GRASS GIS. What is the best library to use for it? I'm trying with SymPy, but I'm not sure is that good choice.

1 Answer 1

2

Sympy is inappropriate here (or very difficult to use). For geometrical calculations in 2D, the best solution is Shapely.

But don't forget that GRASS GIS 6.4.x has the module grass.script (look at GRASS Geoprocessing in Python Script) and GRASS GIS 7.x, the new module pygrass.

You can also use the general Python modules GDAL/OGR (osgeo) or Fiona to open and save the GRASS vector files.

After, it is possible to mix all as in GRASS and the Python geospatial modules (Shapely, PySAL,...)

1
  • Thank You! I hope it's easy to rewrite my code with Shapely.
    – bartekch
    Commented Jan 15, 2015 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.