<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [postgis-users] masking out part of a MULTILINESTRING</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>What a difference difference makes.  Thanks for the help, strk.  But I've got a related question now.  Hope I haven't worn out my welcome.</FONT></P>

<P><FONT SIZE=2>The difference(the_geom,***) works beautifully when done as part of the DATA clause in a .map, but I'm ready to nuke the data directly in the table so that I won't have to mask out the unwanted area every time.</FONT></P>

<P><FONT SIZE=2>However, when I do that, I end up w/ a total of 3 different geometries:</FONT>
</P>

<P><FONT SIZE=2>etopo2_bathy=# select distinct(GeometryType(difference(the_geom,GeometryFromText('BOX3D(-87 24,-79 31)'::box3d,-1)))) from etopo2_contours;</FONT></P>

<P><FONT SIZE=2>    geometrytype    </FONT>
<BR><FONT SIZE=2>--------------------</FONT>
<BR><FONT SIZE=2> GEOMETRYCOLLECTION</FONT>
<BR><FONT SIZE=2> LINESTRING</FONT>
<BR><FONT SIZE=2> MULTILINESTRING</FONT>
</P>

<P><FONT SIZE=2>My original table has MULTILINESTRINGs and are bathymetry contours.  Of course, when I try to do an update, I get constraint problems on the geometry type.  I'm happy to drop the constraint if that's what I need to do.  And masking doesn't seem to do the trick, either.  I would have thought that a GEOMETRYCOLLECTION geometry type could handle it all, ach no.</FONT></P>

<P><FONT SIZE=2>Any ideas?</FONT>
</P>

<P><FONT SIZE=2>Thanks.</FONT>
</P>

<P><FONT SIZE=2>________________________________________</FONT>
<BR><FONT SIZE=2>From: Purvis, Charlton [<A HREF="mailto:cpurvis@asg.sc.edu">mailto:cpurvis@asg.sc.edu</A>] </FONT>
<BR><FONT SIZE=2>Sent: Wednesday, April 20, 2005 1:02 PM</FONT>
<BR><FONT SIZE=2>To: 'PostGIS Users Discussion'</FONT>
<BR><FONT SIZE=2>Subject: RE: [postgis-users] masking out part of a MULTILINESTRING</FONT>
</P>

<P><FONT SIZE=2>> This should be difference(geom, box); </FONT>
<BR><FONT SIZE=2>> --strk; </FONT>
<BR><FONT SIZE=2>Genius!  Works like a charm.  Thanks. </FONT>
</P>

</BODY>
</HTML>