[Qgis-developer] [Qgis-user] Using/visualizing 3D data (Z values)

gene martin.laloux at gmail.com
Tue Sep 25 23:26:06 PDT 2012


Hello, In Python:
- For shapefiles, , I use the pyshp ( pyshp: Python Shapefile Library/
<http://code.google.com/p/pyshp/>  ) module of Joel Lawhead to read or write
3D shapefiles:
(see  CreateElevationValues  : How to work with elevation (a.k.a. z) values.
<http://code.google.com/p/pyshp/wiki/CreateElevationValues>  
>>>import shapefile
>>>r = shapefile.Reader("MyPolyZ")
>>>r.shapes()[0].points
[[-89.0, 33.0], [-90.0, 31.0], [-91.0, 30.0]]
>>>r.shapes()[0].z
[12, 11, 12]

I use it without problem in the Python console  to process the results with
Shapely, Numpy or Grass.script

- For kml files, it is relatively easy to parse files with standard modules
like Elementtree,  or with more specialized modules (
http://pypi.python.org/pypi?%3Aaction=search&term=kml&submit=search
<http://pypi.python.org/pypi?%3Aaction=search&term=kml&submit=search>  )

I also use this approach in the Python console



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-Qgis-user-Using-visualizing-3D-data-Z-values-tp5004272p5004487.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list