No subject


Tue Oct 7 10:08:30 PDT 2008


elevation point.

 

e.g.

POINT (2 2)

MULTILINSTRING((0 0, 3 3, 6 6), (3 3, 3 4, 4 5))

Returns would be

LINESTRING(0 0, 3 3)

 

So if I write it in pseudo code, function prototype should look like :

LINESTRING get_matching_segment(MULTILINESTRING source, POINT needle)

 

I found something about how to split a MULTI* geometry (GeometryN(geometry,
index)), getting points inside a geometry (PointN(geometry, index) or
getting a part of a geometry (Line_SubString(geometry, double, double)), .
but I can't find a way to put them together to get what I want.

 

Any tips about detailed existing functions' documentation and the way to
create custom SQL functions would be greatly appreciated.

 

Thank you :-).

 

Best regards.

 

Nicolas

Gillet


------=_NextPart_000_00A7_01CA4110.B066A6C0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-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;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DFR-BE link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><span lang=3DEN-US>Hello,<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>I am new in postgis environment =
and start
to discover this powerful tool.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>I am facing problem with the =
data I have
and need to transform them.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>I use a library to render maps =
based on &#8220;painter&#8217;s
algorithm&#8221;. (We are especially focused on roads transportation =
elements).<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>So to be more accurate I need to =
represent
road crossing properly with bridges above tunnels and not the opposite =
&#8230;<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>I can match elevation points and =
road
elements being able to see an &#8220;above / below&#8221; information =
but there
is a big problem :<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>One road element can match many =
elevation
points because a long road element can be once above and, a few meters =
further,
below another road. It becomes impossible to order =
them.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>My only solution is to split =
road elements
into pieces which can have one and only one possible =
elevation.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>I think I will need a function =
in order to
do this and .. I have never written any SQL function =
:&#8217;(<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>The behavior I would reach =
is<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>From one multilinestring extract =
the line segment
that intersects my elevation point.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>e.g.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>POINT (2 =
2)<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>MULTILINSTRING((0 0, 3 3, 6 6), =
(3 3, 3 4,
4 5))<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>Returns would =
be<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>LINESTRING(0 0, 3 =
3)<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>So if I write it in pseudo code, =
function
prototype should look like :<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>LINESTRING
get_matching_segment(MULTILINESTRING source, POINT =
needle)<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>I found something about how to =
split a
MULTI* geometry (GeometryN(geometry, index)), getting points inside a =
geometry
(PointN(geometry, index) or getting a part of a geometry =
(Line_SubString(geometry,
double, double)), &#8230; but I can&#8217;t find a way to put them =
together to
get what I want.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>Any tips about detailed existing =
functions&#8217;
documentation and the way to create custom SQL functions would be =
greatly
appreciated.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>Thank you =
:-).<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>Best =
regards.<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>Nicolas<o:p></o:p></span></p>

<p class=3DMsoNormal><span lang=3DEN-US>Gillet<o:p></o:p></span></p>

</div>

</body>

</html>

------=_NextPart_000_00A7_01CA4110.B066A6C0--