[vtkusers] How can I add ESRI Shape Files supporting to VTK?

Malcolm Drummond malcolm at geovision.co.za
Wed Nov 6 04:01:42 EST 2002


Hi Alexey

I've imported polygonal Shapefiles into VTK via Python and Tcl scripts, just to see if I was getting it right. My time-frame for a vtkShapefileReader was the Christmas holidays - I wanted to test some scripts on multi-patch Shapefiles (which would be the most difficult case) before I moved to C++.

As the record structures vary from type to type I thought it made sense to have a separate file-header reader and record-header reader and then subclass a record-contents reader to handle particular types - the appropriate subclass would be instantiated by the file-header reader. This would allow for easy additions should ESRI extend the number of shape types and also allow reading of mixed-types if allowed later.

None of the shapefile libraries I've come across so far are OO, plus you still have to convert their output into VTK datasets - so I think it makes sense to start from scratch and take advantage of vtk reader infrastructure already available. 

I've also read dBase attribute files (just as binary) through Python scripts - it should be pretty easy to knock together a data-object source for those that don't want to connect to a database.

Have you read the shapefile white paper on the ESRI site?

Malcolm Drummond
GeoVision cc
  ----- Original Message ----- 
  From: Alexey Yutkin 
  To: vtkusers at public.kitware.com 
  Sent: Wednesday, November 06, 2002 1:03 AM
  Subject: [vtkusers] How can I add ESRI Shape Files supporting to VTK?


  I plane to add ESRI Shape Files supporting for VTK.   I think the simple way is using "the Shapefile C Library by Frank Warmerdam" for direct Shapefiles IO. 

  Which steps must I do? Where can I find more detailed information about this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20021106/11486432/attachment.htm>


More information about the vtkusers mailing list