[postgis-users] depict a polygon using cross hatching

Michael Welter mike at introspect.com
Fri Jun 3 11:17:33 PDT 2011


Hello,

I have a polygon (with interior holes) that I would like to depict on a map using diagonal lines.  I don't suppose there's a ST_ function for this  :-)

Thinking out loud, I should derive the bounding box of the polygon, divide the top and right edges into equidistant points.  From the top points draw 135° vectors, and from the right points draw 225° vectors to the other side of the box.

Now the hard part:  for each line, determine the point where it enters the polygon and the point where it exits.  Also, where it enters an interior hole and where it exits.  

The actual drawing on the map happens on a client computer (without postGIS), so the desired result from postGIS would be a list of line segments.

Does anyone have any ideas on this?

Thanks,
Mike


More information about the postgis-users mailing list