<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18828"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial>Mehmet,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial>One point does not make a linestring :)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial>I suppose what you could do is change these to points with 
something of the form</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial>UPDATE ways</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial>SET linestring = ST_PointN(linestring,1)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial>WHERE ST_NPoints(linestring) = 1</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial>though you'll need to drop your geometry type constraint on 
your table first to do that.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial>Alternatively you could just delete these records  sine 
they are cases where ST_MakeLine had only one point in the 
result).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=920491419-27102009><FONT color=#0000ff 
size=2 face=Arial>Regina</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> 
postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of 
</B>Mehmet Sirin<BR><B>Sent:</B> Tuesday, October 27, 2009 3:13 PM<BR><B>To:</B> 
PostGIS Users Discussion<BR><B>Subject:</B> Re: [postgis-users] ST_UNION - 
Exception in LWGEOM2GEOS<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Hi, <BR></DIV>
<DIV>indeed there are some linestrings with only 1 Point.</DIV>
<DIV>But I don't know how come.. after checking these points I saw that they are 
nothing but normal </DIV>
<DIV>points on the way ,that means nothing special that should cause a 
problem.</DIV>
<DIV></DIV>
<DIV>one of then is on the way 'Ahlde' -> "LINESTRING(7.3402594 
52.3361277)"</DIV>
<DIV></DIV>
<DIV>maybe you should know, that I imported data via osmosis and then created 
linestringsby using :</DIV>
<DIV></DIV>
<DIV>  UPDATE ways w SET linestring = (<BR>  SELECT MakeLine(c.geom) 
AS way_line FROM (<BR>  SELECT n.geom AS geom FROM nodes n INNER JOIN 
way_nodes <BR>wn ON <A href="http://n.id">n.id</A> = wn.node_id<BR>  
WHERE (wn.way_id = <A href="http://w.id">w.id</A>) ORDER BY 
wn.sequence_id<BR>  ) c<BR>  );<BR><BR></DIV>
<DIV></DIV><BR>
<DIV class=gmail_quote>2009/10/27 Paragon Corporation <SPAN dir=ltr><<A 
href="mailto:lr@pcorp.us">lr@pcorp.us</A>></SPAN><BR>
<BLOCKQUOTE 
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" 
class=gmail_quote>
  <DIV>
  <DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 
  face=Arial>Mehmet,</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 face=Arial>It sounds 
  like your line string might have 0 or 1 points.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left> </DIV>
  <DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 
  face=Arial>Use</FONT></SPAN></DIV>
  <DIV dir=ltr align=left> </DIV>
  <DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 
  face=Arial>ST_NPoints(linestring) < 2  to find all linestrings with 
  fewer than 2 points</FONT></SPAN></DIV>
  <DIV dir=ltr align=left> </DIV>
  <DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 
  face=Arial>Leo</FONT></SPAN></DIV><BR>
  <DIV dir=ltr lang=en-us align=left>
  <HR>
  <FONT size=2 face=Tahoma><B>From:</B> <A 
  href="mailto:postgis-users-bounces@postgis.refractions.net" 
  target=_blank>postgis-users-bounces@postgis.refractions.net</A> [mailto:<A 
  href="mailto:postgis-users-bounces@postgis.refractions.net" 
  target=_blank>postgis-users-bounces@postgis.refractions.net</A>] <B>On Behalf 
  Of </B>Mehmet Sirin<BR><B>Sent:</B> Monday, October 26, 2009 7:24 
  PM<BR><B>To:</B> PostGIS Users Discussion<BR><B>Subject:</B> [postgis-users] 
  ST_UNION - Exception in LWGEOM2GEOS<BR></FONT><BR></DIV>
  <DIV>
  <DIV class=h5>
  <DIV>Hi,<BR></DIV>
  <DIV>I just tried to create a mutlilinestring out of a set of linestrings 
  via </DIV>
  <DIV>SELECT AsText( ST_UNION(linestring) )<BR><BR>FROM ways w, way_tags wt 
  WHERE <A href="http://w.id" target=_blank>w.id</A>=wt.way_id <BR>AND 
  wt.v='Dörnter Weg'<BR><BR></DIV>
  <DIV>(it lies in Osnabrück, lower saxony)</DIV>
  <DIV>but I'm getting this strange error: </DIV>
  <DIV>HINWEIS: IllegalArgumentException: point array must contain 0 or >1 
  elements<BR><BR><BR>FEHLER: Exception in LWGEOM2GEOS<BR><BR>********** Fehler 
  **********<BR><BR>FEHLER: Exception in LWGEOM2GEOS<BR>SQL 
  Status:XX000<BR><BR><BR></DIV>
  <DIV>Replacing wt.v='Dörnter Weg' with wt.v='Some other Streets' it 
  works properly. </DIV>
  <DIV>So it is because of this street 'Dörnter Weg' (i got a few other ones of 
  this kind in my database). </DIV>
  <DIV>Anybody can tell me why these sort of ways leads to a problem?</DIV>
  <DIV>thank you</DIV>
  <DIV>kind regards</DIV>
  <DIV>mehmet 
  sirin</DIV></DIV></DIV></DIV><BR>_______________________________________________<BR>postgis-users 
  mailing list<BR><A 
  href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A><BR><A 
  href="http://postgis.refractions.net/mailman/listinfo/postgis-users" 
  target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>