[GRASS5] GRASS -> SF
Morten Hulden
morten at untamo.net
Sat Feb 21 14:11:58 EST 2004
On Sat, 21 Feb 2004, Radim Blazek wrote:
> On Saturday 21 February 2004 01:29, Morten Hulden wrote:
> > What about centroid rules? When I imported (+ rebuilt topology) polygons
> > from e00 to Postgis I had to drop part of the 'polygons' (actually,
> > I imported them as lines just like the open ended arcs) because inner
> > rings touched the outer ring at more than one single point.
> >
> > Following is an illegal inner ring. In Mapserver it is not possible to
> > fill A with a color without filling B too.
> >
> > +---------+
> > | A |
> > +-----+ |
> > | B | |
> > +-----+ |
> > | |
> > +---------+
> >
> > So, would the new Grass vector format allow this topology, and could flood
> > fills still be handled correctly?
>
> ??? I don't understand why the example above should not be handled correctly
> in GRASS, regardless version. How GRASS is involved if Mapserver doesn't
> do what you want. Did you use GRASS to import e00 to PostGIS?
No, I wrote a perl-script that parsed a e00-file and rebuilt the topology
in Postgis (POLYGON and LINESTRING) format. (MULTIPOLYGON and
MULTILINESTRING did not exist in Postgis at that time). Selected
attributes were extcacted in a second pass with e00pg
(http://e00pg.sourceforge.net), with a little perl-parsing of the output.
I am talking about the DCW e00-files. I tried to use m.in.e00 in Grass but
got too many 'Unclosed area, free end or edge inside area' and other
errors, too tidy to clean up afterwars, too many countries to handle etc..
Since the end purpose was to populate Mapserver with vector maps of many
countries I decided to use the perl approach, cleaning and splitting into
polygons and linstrings in the process, and wrapping everything up in a
shell script so several countries could be imported simultaneously. There
was another advantage: re-projection is not necessary until maps are
rendered, and that is handled by Mapserver 'on-the-fly'.
I also rationalize a bit and use SQL-hierarchy, e.g. dn_py and dn_ln
parent tables contain 'drainage network' polygons and lines, respectively,
and are inherited by dn_py_reg and dn_ln_reg, where 'reg' is the three
letter acronym for the country.
So, for me it would be very useful if I could interface the vector data in
Postgis from both Mapserver and Grass. I use Grass alot for raster map
generating and v.digitizing, but Grass is becoming a little 'isolated' now
from the vector storage. Maybe there is something in 5.7 that I don't know
about, but I haven't been able to get it to compile yet :-(
regards
Morten
PS. my perl script is at http://gis.untamo.net/download/e002pgis.pl and my
mapserver is at http://gis.untamo.net/mapserv
More information about the grass-dev
mailing list