[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] overlapping geometries
From:       Hugues François <hugues.francois () irstea ! fr>
Date:       2015-02-26 14:08:18
Message-ID: 3CB901080554B04881D30F111F62D93004BE8914 () nadia ! grenoble ! cemagref ! fr
[Download RAW message or body]

--===============7634916877999534823==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01D051CD.ABCA5F61"

This is a multi-part message in MIME format.

[Attachment #2 (text/plain)]

Hello,

 

I'm not sure I understand your whole problem, but I can try to give you the beginning \
of some answers :

-          The use of ST_Overlaps seems more natural to me to find overlapping \
geometries (it depends on what you're looking for, and you may also have look to \
ST_Intersects but ST_Contains does not return the same kind of results)

-          To compare geometries within a single layer, you can make an auto jointure \
and a select distinct to remove duplicates. Something like this query may work :

 

SELECT DISTINCT a.* FROM table AS a, table AS b

WHERE a.gid != b.gid  and ST_Overlap(a.geom, b.geom) 

 

HTH

 

Hugues.

 

De : postgis-users-bounces@lists.osgeo.org \
[mailto:postgis-users-bounces@lists.osgeo.org] De la part de volker.emmel@lwk-rlp.de \
Envoyé : jeudi 26 février 2015 14:33 À : postgis-users@lists.osgeo.org
Objet : [postgis-users] overlapping geometries

 

hey list, 

i have the following problem: 

- i have overlapping geometries in one layer in my postgis (8.3) database. 

-> how could i find the overlapping geometries?? 

->i could not divide into two layers... 
-> if i have two layers i could use st_contain, but in one ?? 

- it will be over 6 million geometries.... 

any idea? 

thanks 
vollbtz


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:36.0pt;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:935358972;
	mso-list-type:hybrid;
	mso-list-template-ids:1533317632 -125303664 67895299 67895301 67895297 67895299 \
67895301 67895297 67895299 67895301;} @list l0:level1
	{mso-level-start-at:8;
	mso-level-number-format:bullet;
	mso-level-text:-;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-font-family:Calibri;}
@list l0:level2
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:"Courier New";}
@list l0:level3
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Wingdings;}
@list l0:level4
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Symbol;}
@list l0:level5
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:"Courier New";}
@list l0:level6
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Wingdings;}
@list l0:level7
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Symbol;}
@list l0:level8
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:"Courier New";}
@list l0:level9
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Wingdings;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hello,<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I'm not \
sure I understand your whole problem, but I can try to give you the beginning of some \
answers&nbsp;:<o:p></o:p></span></p><p class=MsoListParagraph \
style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span \
lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span \
style='mso-list:Ignore'>-<span style='font:7.0pt "Times New \
Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
</span></span></span><![endif]><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The use of \
ST_Overlaps seems more natural to me to find overlapping geometries (it depends on \
what you're looking for, and you may also have look to ST_Intersects but ST_Contains \
does not return the same kind of results)<o:p></o:p></span></p><p \
class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if \
!supportLists]><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span \
style='mso-list:Ignore'>-<span style='font:7.0pt "Times New \
Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
</span></span></span><![endif]><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>To compare \
geometries within a single layer, you can make an auto jointure and a select distinct \
to remove duplicates. Something like this query may work :<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>SELECT \
DISTINCT a.* FROM table AS a, table AS b<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>WHERE a.gid \
!= b.gid   and ST_Overlap(a.geom, b.geom) <o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>HTH<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hugues.<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De&nbsp;:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> \
postgis-users-bounces@lists.osgeo.org [mailto:postgis-users-bounces@lists.osgeo.org] \
<b>De la part de</b> volker.emmel@lwk-rlp.de<br><b>Envoyé&nbsp;:</b> jeudi 26 \
février 2015 14:33<br><b>À&nbsp;:</b> \
postgis-users@lists.osgeo.org<br><b>Objet&nbsp;:</b> [postgis-users] overlapping \
geometries<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p \
class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>hey \
list,</span> <br><br><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>i have the following \
problem:</span> <br><br><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>- i have overlapping \
geometries in one layer in my postgis (8.3) database.</span> <br><br><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>-&gt; how could i find the \
overlapping geometries??</span> <br><br><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>-&gt;i could not divide \
into two layers...</span> <br><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>-&gt; if i have two layers \
i could use st_contain, but in one ??</span> <br><br><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>- it will be over 6 million \
geometries....</span> <br><br><span \
style='font-size:10.0pt;font-family:"Arial","sans-serif"'>any idea?</span> \
<br><br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>thanks</span> \
<br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>vollbtz</span><o:p></o:p></p></div></body></html>




_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
--===============7634916877999534823==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic