[postgis-users] Newbie to postGIS

Mark Leslie mark at refractions.net
Tue Apr 17 14:34:16 PDT 2007


The MakePolygon function expects a linestring that will form the
exterior boundary, and optionally an array of linestrings to form
interior holes.  It's unable to merge the multilinestring components
into a single linestring.  That needs to be done before feeding it into
the function.
Mark

Michael Welter wrote:
> Hello,
> 
> Can anyone tell me why I get this error:
> 
> lwline_deserialize: attempt to deserialize a line which is really a
> Invalid type
> 
> with this statement:
> 
> SELECT
> AsText(MakePolygon(Simplify(MLineFromText('MULTILINESTRING((-105.277943
> 39.499826,-105.277316 39.499146),(-105.277943 39.499826,-105.276814
> 39.500724),(-105.277316 39.499146,-105.276609 39.498454),(-105.276814
> 39.500724,-105.276611 39.501081,-105.276278 39.501365,-105.275958
> 39.501489),(-105.276609 39.498454,-105.276243 39.498945,-105.276032
> 39.499161,-105.274805 39.499972,-105.274401 39.500162,-105.273858
> 39.500229,-105.273437 39.500364,-105.272911 39.500702,-105.272707
> 39.500908),(-105.275958 39.501489,-105.275769 39.501311,-105.275471
> 39.501257,-105.275226 39.501379,-105.27477 39.501487,-105.274507
> 39.501311,-105.274226 39.500973,-105.274121 39.500905,-105.273946
> 39.500878,-105.273437 39.501081,-105.273191 39.501108,-105.273034
> 39.501068,-105.272707 39.500908))'),0.000001)));
> 
> I get the same error with or without the Simplify function.
> 
> It works when substituting the ConvexHull function for the MakePolygon
> function.
> 
> Must the line segments in a multiline string be in order?
> 
> Thanks,
> Mike
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list