<!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.19328"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV dir=ltr align=left><SPAN class=554124111-12112012><FONT color=#0000ff 
size=2 face=Arial>You should try the st_buffer tip :</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=554124111-12112012><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=554124111-12112012>select 
st_astext(<BR>    
st_difference(<BR>        
st_buffer(st_geomfromtext('POLYGON((-5.66666 43.53301,-5.66704 43.53335,-5.66931 
43.53374,-5.66975299919511 43.533380063154,-5.66979 43.53335,-5.66971 
43.53478,-5.66969091189271 43.5348058613067,-5.67026768864541 
43.5374211525033,-5.67084666354158 43.5376334432986,-5.67111 
43.53773,-5.67059550578171 43.53754135212,-5.66854 43.53971,-5.66854 
43.53971,-5.66854 43.53971,-5.66758 43.53976,-5.6665 43.5402,-5.6665 
43.5402,-5.66609712188377 43.539781395014,-5.66401 43.54013,-5.66401 
43.54013,-5.66351576708437 43.5392869195307,-5.66281 43.53909,-5.6626 
43.53851,-5.66159162498075 43.5369268527413,-5.66131 43.53695,-5.66196 
43.53617,-5.66272791899155 43.5356642562857,-5.66378432333548 
43.5344801289574,-5.66384 43.53414,-5.66452 43.53344,-5.6656 43.53337,-5.66611 
43.5331,-5.66666 43.53301))', 
4326),0),<BR>       st_buffer(st_geomfromtext('POLYGON((-5.66577 
43.53447,-5.66612 43.53455,-5.66675167677363 43.5349178897119,-5.66735 
43.53529,-5.66811 43.5355,-5.66786 43.53678,-5.66816 43.53697,-5.66801 
43.53717,-5.66729498033211 43.5375449497042,-5.6665 43.53782,-5.66634200990626 
43.5386936730934,-5.66634 43.53876,-5.66554366174751 43.5384386684555,-5.66521 
43.53856,-5.66457 43.53781,-5.6640744056249 43.5375662650614,-5.66341231504476 
43.5372589777288,-5.66324 43.53718,-5.66334987968078 
43.536344363177,-5.66304550704754 43.5357063513112,-5.66299 43.53559,-5.66358 
43.53544,-5.66413 43.53529,-5.66521 43.535,-5.66577 43.53447,-5.66577 
43.53447))', 4326),0)<BR>    )<BR>);</SPAN></DIV>
<DIV><SPAN class=554124111-12112012></SPAN> </DIV>
<DIV><SPAN class=554124111-12112012><FONT color=#0000ff size=2 
face=Arial>Hugues.</FONT></DIV>
<DIV dir=ltr align=left><BR><BR></DIV></SPAN><BR>
<DIV dir=ltr lang=fr class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>De :</B> postgis-users-bounces@lists.osgeo.org 
[mailto:postgis-users-bounces@lists.osgeo.org] <B>De la part de</B> Angel 
Cervera Claudio<BR><B>Envoyé :</B> lundi 12 novembre 2012 
12:23<BR><B>À :</B> postgis-users@lists.osgeo.org<BR><B>Objet :</B> 
[postgis-users] st_difference throws an error<BR></FONT><BR></DIV>
<DIV></DIV><TT>Hello.<BR><BR>I post this problem in <A 
class=moz-txt-link-freetext 
href="http://gis.stackexchange.com/questions/40872/st-difference-throws-an-error">http://gis.stackexchange.com/questions/40872/st-difference-throws-an-error</A> 
buy i'm sure in this mailing list people can help me.<BR><BR>I'm retrieving 
"</TT><CODE>GEOSDifference: TopologyException: found non-noded intersection 
between</CODE><TT>" error when executing st_difference sql.<BR><BR>Followed an 
example:<BR><BR>Error: </TT><BR><PRE><CODE>ERROR:  GEOSDifference: TopologyException: found non-noded intersection between LINESTRING (-5.67027 43.5374, -5.67085 43.5376) and LINESTRING (-5.67111 43.5377, -5.6706 43.5375) at -5.6708422794605911 43.537631835802237
SQL:
</CODE><CODE>select st_astext(
    st_difference(
        st_geomfromtext('POLYGON((-5.66666 43.53301,-5.66704 43.53335,-5.66931 43.53374,-5.66975299919511 43.533380063154,-5.66979 43.53335,-5.66971 43.53478,-5.66969091189271 43.5348058613067,-5.67026768864541 43.5374211525033,-5.67084666354158 43.5376334432986,-5.67111 43.53773,-5.67059550578171 43.53754135212,-5.66854 43.53971,-5.66854 43.53971,-5.66854 43.53971,-5.66758 43.53976,-5.6665 43.5402,-5.6665 43.5402,-5.66609712188377 43.539781395014,-5.66401 43.54013,-5.66401 43.54013,-5.66351576708437 43.5392869195307,-5.66281 43.53909,-5.6626 43.53851,-5.66159162498075 43.5369268527413,-5.66131 43.53695,-5.66196 43.53617,-5.66272791899155 43.5356642562857,-5.66378432333548 43.5344801289574,-5.66384 43.53414,-5.66452 43.53344,-5.6656 43.53337,-5.66611 43.5331,-5.66666 43.53301))', 4326),
        st_geomfromtext('POLYGON((-5.66577 43.53447,-5.66612 43.53455,-5.66675167677363 43.5349178897119,-5.66735 43.53529,-5.66811 43.5355,-5.66786 43.53678,-5.66816 43.53697,-5.66801 43.53717,-5.66729498033211 43.5375449497042,-5.6665 43.53782,-5.66634200990626 43.5386936730934,-5.66634 43.53876,-5.66554366174751 43.5384386684555,-5.66521 43.53856,-5.66457 43.53781,-5.6640744056249 43.5375662650614,-5.66341231504476 43.5372589777288,-5.66324 43.53718,-5.66334987968078 43.536344363177,-5.66304550704754 43.5357063513112,-5.66299 43.53559,-5.66358 43.53544,-5.66413 43.53529,-5.66521 43.535,-5.66577 43.53447,-5.66577 43.53447))', 4326)
    )
);</CODE>

In <TT>gis.stackexchange.com i attached images with various shapes with this problem. 
</TT>All share a common pattern. Some parts of edge are near to be parallel.


How to resolve this problem? Is a bug?

Thanks!
</PRE><TT><BR></TT><PRE class=moz-signature cols="132">-- 
Silyan Software SL
Consultoría, desarrollo y gestión de proyectos j2ee
web: <A class=moz-txt-link-freetext href="http://www.silyan.com">http://www.silyan.com</A> <A class=moz-txt-link-freetext href="http://www.simplexportal.com">http://www.simplexportal.com</A>
Ángel Cervera Claudio
email: <A class=moz-txt-link-abbreviated href="mailto:angelcervera@silyan.com">angelcervera@silyan.com</A>
tlf. móvil: 670819234

Gijón (Asturias) – Spain


- Mensajería ---------------------
msn: <A class=moz-txt-link-abbreviated href="mailto:angelcervera@hispavista.com">angelcervera@hispavista.com</A>
yahoo: angelcervera
aol: angelcervera
jabber: angelcervera en jabber.org
google talk: angelcervera
skype: angelcervera


Este mensaje y cualquier documento adjunto que lleve consigo es sólo para la persona o compañía a la que va dirigido y puede contener información privilegiada, confidencial o cuya revelación o uso esté prohibido. Si el receptor de esta transmisión no es la persona a quien iba dirigida, o el empleado o agente encargado de hacer llegar dicho material al receptor previsto, se le notifica que cualquier uso, forma de reproducción, difusión, copia, revelación, modificación, distribución y/o publicación de este mensaje o sus documentos adjuntos por cualquier otro que no sea su destinatario previsto está estrictamente prohibido por el remitente. Si ha recibido esto por error, por favor, devuélvalo al remitente y destruya el mensaje y/o las copias que pueda haber en su posesión.

This message and any attachments to it is intended only for the individual or company to which it is addressed and may contain information which is privileged, confidential or prohibited from disclosure or unauthorized use. If the recipient of this transmission is not the intended recipient, or the employee or agent responsible for delivering such materials to the intended recipient, you are hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message or its attachments other than by its intended recipient is strictly prohibited by the sender. If you have received it in error, please return it to the sender and destroy the message and/or copies in your possession.
</PRE></BODY></HTML>