data export tool
Frank Warmerdam
warmerdam at POBOX.COM
Thu Oct 13 08:31:42 PDT 2005
On 10/13/05, Martin Tomko <m.tomko at pgrad.unimelb.edu.au> wrote:
> I am desperately seeking a tool/workflow o export vector data into
> text/tables with basically the arc/node topological description of my data.
>
> So If I export polygons, I need a table with the polygon IS and the IDs
> of all its arcs, without any coordinates. Does anyone know a way?
>
> I was thinking about postgress/postgis? Dump a shp in it and try an sql?
> Would ogr2ogr do it somehow? I did not find a way to include the IDs of
> the arcs of a polygon. Seems like export to CSV would help, but I need
> to get the arcs IDs somehow.
Martin,
You didn't mention what data you are starting with. Is it a shapefile?
If so, part of your problems is that you need to build the topology from
a non-topological structure. As Flavio mentioned, FME would be a
good choice for that. GRASS also has support for converting
non-topological dataset to topological.
If you are already starting with a topological Arc/Info binary vector
coverage, then you will see from the ogrinfo reports that the topology
information is available as attributes.
OGRFeature(PAL):2
ArcIds (IntegerList) = (1:-349)
AREA (Real) = 0.92814
PERIMETER (Real) = 5.35872
COUNTRYD# (Integer) = 2
COUNTRYD-ID (Integer) = 3027
POLYGON ((-153.022781372070312 57.383213043212891,...
OGRFeature(ARC):1
UserId (Integer) = 1394
FNODE# (Integer) = 1
TNODE# (Integer) = 2
LPOLY# (Integer) = 24
RPOLY# (Integer) = 26
LINESTRING (56.360397338867188 25.983451843261719,...
The ArcIds on the polygons and the node/poly information on the
arcs is enough to establish the topological relationships. With a
script or C++ program written on OGR you could get that information
out into a text format of some kind.
If you use GRASS to export to E00 you could use avcimport to
convert to a binary coverage for use with OGR. FME can write
binary coverages directly. Of course, both FME and GRASS offer
other mechanisms to interact with the topology that might be more
direct.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the MapServer-users
mailing list