[GRASS-dev] 3D polygons (faces) and attributes

Hamish hamish_b at yahoo.com
Wed Sep 2 15:50:22 EDT 2009


Ben wrote:
> I have some 3D polygonal data in 3D shapefiles that I need
> to process in GRASS and then export to VTK for interactive
> exploration.
> The data represents what archaeologists call "profiles",
> i.e. vertical cross-sections through the soil that document
> soil layers.
> 
> I think the term "catena" exists in some geosciences for
> roughly the same thing. The data is synthetic, i.e.
> digitized from idealized hand-drawings done in the field.
> As such, it  has no actual W-E or N-S extent, only top to
> bottom.
> 
> I realized that v.in.ogr cannot import such data. Even
> though it reads the 3D coordinates just fine, it treats the
> topology as 2D, trying to calculate X-Y areas and finding
> labeling points to attach the attributes.
> Which fails of course, as no 2D centroid can be calculated
> for a 3D area that has no extent in the X-Y plane!

.... you could always relabel the axes ... GRASS won't know
what it thinks is x-y is really x-z or x-time. You can then
swap it back once in VTK.

> So I went on to patch v.in.ogr to import 3D lines w/o area
> checking and that at least gave me an option to import the
> geometries. I then added support for 3D faces which allowed 
> me to import a better representation.
> 
> But now I am stuck on the attribute side of things:
> How do I attach attributes to GV_FACE type geometries? 
> I suppose it should be equivalent to how it is done for
> GV_BOUNDARIES? 
> But using V_KERNEL instead of V_POINT for attaching the atts?
> Does anyone here have any experience with this? 
> Any other GRASS modules that need to do the same thing so I
> could learn from them?

v.in.dxf is probably your best bet, but you may have already
surpassed what it does.


Hamish



      



More information about the grass-dev mailing list