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

List:       postgis-users
Subject:    RE: [postgis-users] Dividing an area to closest line
From:       "Randall, Eric" <ERandall () eriecountygov ! org>
Date:       2008-12-29 13:54:00
Message-ID: CD32AE6ACD828644B29601ADC966FDCB01B4ABB3 () ex1 ! eriecountygov ! local
[Download RAW message or body]

--===============1829419124==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C969BC.E69C9CA4"

This is a multi-part message in MIME format.


 
 

If I understand correctly I think that you want to use the method Regina is \
suggesting to group points nearest your line parts and then use ST_collect and \
ST_convexhull to make polygons out of your point groups.

-Eric

 -----Original Message-----
From: postgis-users-bounces@postgis.refractions.net \
[mailto:postgis-users-bounces@postgis.refractions.net]On Behalf Of \
                nicklas.aven@jordogskog.no
Sent: Monday, December 29, 2008 7:28 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] Dividing an area to closest line



 
Thanks for the answer.
My problem is that I just have the roadparts and nothing to relate them to. I would \
like to create polygons with their borders between the roads so every possible point \
inside the polygon share the same closest road. But if it isnt possible I will have \
to build a raster of rectangels or just points and use the method you suggested on \
them.  
/Nicklas

2008-12-29 Obe Regina wrote:

> 
Why wouldn't you use a nearest neighbor calculation as demonstrated here (using \
DISTINCT ON)?
> 
 
> 
http://postgis.refractions.net/documentation/manual-svn/ST_DWithin.html
> 
 
> 
Keep in mind ST_DWithin and  ST_Distance don't care about whether a geometry is a \
line or polygon or point or collection or whatever.  They will always consider the \
minimum distance between 2 geometries.
> 
 
> 
ST_DWithin will use a spatial index where as ST_Distance will not.  So for ST_DWithin \
to work, you have to make the assumption,
> 
the closest road to any point is no more than X units away.  The bigger you make the \
X, the less efficient the index search, but the less likely you will leave a point \
out.
> 
 
> 
Hope that helps,
> 
Regina

> > 
  _____  

From: postgis-users-bounces@postgis.refractions.net \
[mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of \
nicklas.aven@jordogskog.no
> Sent: Monday, December 29, 2008 3:18 AM
> To: postgis-users@postgis.refractions.net
> Subject: [postgis-users] Dividing an area to closest line
> 
> 
> 
 
> 
Hallo
> 
 
> 
My first time writing here.
> 
 
> 
The case is that I need to find the closest road from every point in the terrain. The \
roads are defined in "roadparts". The very best thing would be to get polygons around \
every roadpart which I could use on other data to bind it to the right road.
> 
 
> 
The only solution I can see is making a raster of small rektangels that I bind to my \
roadparts using nearest neighbour-calculations.
> 
 
> 
My question is if someone has a more efficient and better solution.
> 
 
> 
Sorry for my bad english
> 
 
> 
Thanks
> 
/Nicklas Avén


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE></TITLE>

<META content="MSHTML 6.00.6000.16764" name=GENERATOR></META></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<P><SPAN class=125394913-29122008></SPAN><FONT face=Arial><FONT size=2><SPAN 
class=125394913-29122008>If I understand correctly </SPAN>I<SPAN 
class=125394913-29122008> think that you want to use&nbsp;the method Regina is 
suggesting to group points nearest&nbsp;your line parts and then use ST_collect 
and ST_convexhull to make polygons out of your point 
groups.</SPAN></FONT></FONT></P>
<P><SPAN class=125394913-29122008></SPAN><SPAN 
class=125394913-29122008></SPAN><FONT size=2>-<SPAN 
class=125394913-29122008>Eric</SPAN></FONT><BR><FONT face=Tahoma><BR><FONT 
size=2><SPAN class=125394913-29122008><FONT 
face=Arial>&nbsp;</FONT></SPAN>-----Original Message-----<BR><B>From:</B> 
postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net]<B>On Behalf Of 
</B>nicklas.aven@jordogskog.no<BR><B>Sent:</B> Monday, December 29, 2008 7:28 
AM<BR><B>To:</B> PostGIS Users Discussion<BR><B>Subject:</B> RE: [postgis-users] 
Dividing an area to closest line<BR><BR></P></FONT></FONT>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV>&nbsp;</DIV>
  <DIV>Thanks for the answer.</DIV>
  <DIV>My problem is that I just have the roadparts and nothing to relate them 
  to. I would like to create polygons with their borders between the roads so 
  every possible point inside the polygon share the same&nbsp;closest road. But 
  if it isnt possible I will have to build a raster of rectangels or just points 
  and use the method you suggested on them.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>/Nicklas<BR><BR>2008-12-29 Obe Regina wrote:<BR><BR>&gt;</DIV>
  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Arial">Why wouldn't you 
  use a nearest neighbor calculation as&nbsp;demonstrated here (using DISTINCT 
  ON)?</SPAN></DIV>&gt; 
  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Arial"></SPAN>&nbsp;</DIV>&gt; \


  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Arial"><A 
  href="http://postgis.refractions.net/documentation/manual-svn/ST_DWithin.html">http: \
//postgis.refractions.net/documentation/manual-svn/ST_DWithin.html</A></SPAN></DIV>&gt; \


  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Arial"></SPAN>&nbsp;</DIV>&gt; \


  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Arial">Keep in mind 
  ST_DWithin and &nbsp;ST_Distance don't care about whether a geometry is a line 
  or polygon or point or collection or whatever.&nbsp; They will always consider 
  the minimum distance between 2 geometries.</SPAN></DIV>&gt; 
  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Arial"></SPAN>&nbsp;</DIV>&gt; \


  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Arial">ST_DWithin will 
  use a spatial index where as ST_Distance will not.&nbsp; So for ST_DWithin to 
  work, you have to make the assumption,</SPAN></DIV>&gt; 
  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Arial">the closest road 
  to any point is no more than X units away.&nbsp; The bigger you make the X, 
  the less efficient the index search, but the less likely you will leave a 
  point out.</SPAN></DIV>&gt; 
  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Arial"></SPAN>&nbsp;</DIV>&gt; \


  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: Arial">Hope that 
  helps,</SPAN></DIV>&gt; 
  <DIV align=left><SPAN 
  style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: \
Arial">Regina</SPAN></DIV><BR>&gt;&gt; 

  <DIV align=left>
  <HR>
  <SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><B>From:</B> 
  postgis-users-bounces@postgis.refractions.net 
  [mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of 
  </B>nicklas.aven@jordogskog.no<BR>&gt;<B>Sent:</B> Monday, December 29, 2008 
  3:18 AM<BR>&gt;<B>To:</B> 
  postgis-users@postgis.refractions.net<BR>&gt;<B>Subject:</B> [postgis-users] 
  Dividing an area to closest line<BR>&gt;</SPAN><BR>&gt;</DIV>&gt; 
  <DIV>&nbsp;</DIV>&gt; 
  <DIV>Hallo</DIV>&gt; 
  <DIV>&nbsp;</DIV>&gt; 
  <DIV>My first time writing here.</DIV>&gt; 
  <DIV>&nbsp;</DIV>&gt; 
  <DIV>The case is that I need to find the closest road from every point in the 
  terrain. The roads are defined in "roadparts". The very best thing would be to 
  get polygons around every roadpart which I could use on other data to bind it 
  to the right road.</DIV>&gt; 
  <DIV>&nbsp;</DIV>&gt; 
  <DIV>The only solution I can see is making a raster of small rektangels that I 
  bind to my roadparts using nearest neighbour-calculations.</DIV>&gt; 
  <DIV>&nbsp;</DIV>&gt; 
  <DIV>My question is if someone has a more efficient and better 
  solution.</DIV>&gt; 
  <DIV>&nbsp;</DIV>&gt; 
  <DIV>Sorry for my bad english</DIV>&gt; 
  <DIV>&nbsp;</DIV>&gt; 
  <DIV>Thanks</DIV>&gt; 
  <DIV>/Nicklas Avén</DIV></BLOCKQUOTE></BODY></HTML>



_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

--===============1829419124==--

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

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