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
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,...)
-
Thank You! I hope it's easy to rewrite my code with Shapely.– bartekchCommented Jan 15, 2015 at 13:23