[GRASS-user] Importing a SDTS/DLG files?
Hamish
hamish_nospam at yahoo.com
Thu Nov 30 19:46:30 EST 2006
Tom Russo wrote:
> > SDTS files contain several tables with no geometry (OGR calls them
> > "Layers") that probably confuse v.in.ogr, and also contain point,
> > line, and polygon features. My guess is that v.in.ogr doesn't quite
> > grok which things it needs to ignore.
> >
> > When I do an ogrinfo on an SDTS road file I see:
> > > ogrinfo TR01CATD.DDF
> > ERROR 4: SDTS Driver doesn't support update.
> > Had to open data source read-only.
> > INFO: Open of `TR01CATD.DDF'
> > using driver `SDTS' successful.
> > 1: ARDF (None)
> > 2: ARDM (None)
> > 3: AHDR (None)
> > 4: NP01 (Point)
> > 5: NA01 (Point)
> > 6: NO01 (Point)
> > 7: LE01 (Line String)
> > 8: PC01 (Polygon)
> >
> > I bet if you were to use a "layer=NO01,LE01,PC01" option to v.in.ogr
> > your woes would go away. In fact, when I try to import the very
> > same SDTS file above, it worked fine and gave line, point, and
> > polygon features; the vector map displays Just Fine.
>
> That particular choice of "layers" is appropriate for SDTS files that
> contain only polylines (such as road layers), but not for anything
> that contains meaningful polygons --- if you tried to use this on,
> say, a surface cover layer all the attributes of the polygons would be
> missing because those are in the centroids from the NA "module" (which
> is the SDTS terminology). To get polygons with attributes you'll
> need to attach centroids to the polygons, and those are in the NA
> module. You'll need to use the "type=" option to v.in.ogr to read in
> "layers" with the right types. I'm not exactly sure how to do that,
> although I think I can guess:
>
> v.in.ogr dsn=<catd file> layer=NO01,LE01,PC01,NA01
> type=point,line,boundary,centroid output=...
>
> If I read the v.in.ogr help correctly, that should import the NO01
> module/"layer" as points, the LE01 module/"layer" as polylines, the
> PC01 "layer" as boundaries, and the NP01 "layer" as area centroids.
> But someone more knowledgable should step in and correct me.
this sounds like the basis for a nice "v.in.sdts" script for GRASS 6.
Hamish
More information about the grass-user
mailing list