Bookmark this page: Add Polygon from unordered collection of straight line segments    to Yahoo MyWeb Add Polygon from unordered collection of straight line segments    to Google Bookmarks Add Polygon from unordered collection of straight line segments    to Windows Live Add Polygon from unordered collection of straight line segments    to Del.icio.us Digg Polygon from unordered collection of straight line segments   ! Add Polygon from unordered collection of straight line segments    to Netscape
  •  
  • Subject
  • Author
  • Date
If you were  Registered and logged in, you could reply and use other advanced thread options
Posted by Nathan Baulch on February 22, 2006, 1:17 am
Is there a standard way to go from an unordered collection of line segments
(that all butt up against each other) to a polygon in your average GIS
programming toolkit?



eg: I have a database full of straight walls (x1,y1,x2,y2). Any space
completely enclosed by walls makes a room. I must draw a room as a polygon
so I can shade its area when selected. How do I create a polygon (sequence
of coordinates) based on the collection of walls that surrounds it?



My next problem after this one is that the toolkit I'm using interprets
polygons that are specified counter-clockwise as holes, or negative shapes.
How do I ensure that the polygon coordinates are specified in clockwise
order?





Nathan



Posted by prashant on February 22, 2006, 7:16 am
No idea about toolkits... what you're talking about is called "building
polygon topology". And if your lines overlap and cross each other,
you'd have to perform a "clean" operation, where the intersections are
broken, dangles removed. A lot of the cleaning process requires manual
supervision.

Although our software has this clean and build topology functionality,
we have not made it available to the public yet. If it is just an odd
map or two, send it over. If it's many maps, i could tell you rates
after taking a look at a sample.

Prashant
http://www.prithvitech.com/


Posted by jimirwin on February 22, 2006, 7:45 am

> Is there a standard way to go from an unordered collection of line
> segments (that all butt up against each other) to a polygon in your
> average GIS programming toolkit?
>
>
>
> eg: I have a database full of straight walls (x1,y1,x2,y2). Any space
> completely enclosed by walls makes a room. I must draw a room as a
> polygon so I can shade its area when selected. How do I create a
> polygon (sequence of coordinates) based on the collection of walls
> that surrounds it?
>
>
>
> My next problem after this one is that the toolkit I'm using
> interprets polygons that are specified counter-clockwise as holes, or
> negative shapes. How do I ensure that the polygon coordinates are
> specified in clockwise order?
>

You could take a look at the JTS toolkit, which support Polygonization.
Google for JTS Topology Suite, from Vivid Solutions. Open source Java.


--
Jim Irwin
http://www.holoscenes.com