Hi Pedro,<br><br>thank you for your reply. <br><br>I cannot use pointn, the line can be up to several hundred kilometers long and consits of up to 800 points, so this would be too rough.<br><br>Regardinf the decond suggestion, that is exactly what I am doing now, but I don't know, which projection (srid) to transform the wgs84 data into. It should work on all of the earth's surface, at least in all of europe for a start. And from what I found, the projections are usually tied to a small territory. I was thinking about mercator projection, but there is a zillion of them in postgis. And I found a post, that the one with srid 900913 is working great, but I don't have that one in my postgis.<br>
<br><div class="gmail_quote">2009/7/10 Pedro Doria Meunier <span dir="ltr"><<a href="mailto:pdoria@netmadeira.com">pdoria@netmadeira.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Hi Peter<br>
<br>
You could use the pointn(geometry, n) for the first point of the<br>
linestring as a first approach.<br>
As far as meters are concerned here's a little example of transforming<br>
the geometry to the desired projected system:<br>
<br>
select distance(transform(u.coordinates,srid),<br>
transform(p.geometry,srid)) AS thedistance<br>
<br>
HTH,<br>
<br>
Pedro Doria Meunier<br>
GSM: +351 96 17 20 188<br>
Skype: pdoriam<br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
Peter Kukuča wrote:<br>
> Dear sir,<br>
><br>
> I am not sure if I am writing to the correct email address. I have<br>
> found a post on the postgis-users formu from *Rich Gibson *and this<br>
> address was next to it.<br>
><br>
> I am using postgis for a while now and it is great. It solved a lot<br>
> of problems for me.<br>
><br>
> However, I am now facing a problem I cannot solve. I searched for<br>
> almost two days now, but I still cannot find an answer. Here is my<br>
> problem:<br>
><br>
> I have a database of linestrings in wgs84 projection and points in<br>
> wgs84 projection. I would like to determine the distance between a<br>
> line and a point. The ST_distance function does this very well, but<br>
> it does not take the wgs84 projection into account and also, the<br>
> result is in degrees. On the other hand, the ST_Distance_Spheroid<br>
> does take the wgs84 into accound and does give the result in meters,<br>
> but it does not accept a linestring as an input parameter.<br>
><br>
> Is there any way i can the distance between a line and a point in<br>
> meters from the wgs84 projected input? I do not need grat accuracy.<br>
> +-5 meters is still good enough. Thank you for your tips.<br>
><br>
> --<br>
> S pozdravom (regards)<br>
> Ing. Peter Kukuča<br>
><br>
</div></div>> ----------------------------------------------------------------------<br>
><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>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.7 (GNU/Linux)<br>
Comment: Using GnuPG with Fedora - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br>
<br>
iD8DBQFKVv052FH5GXCfxAsRAqS1AJ0dfphFX3wrMuo+FdXVRTgmUzHRUACfUmvH<br>
146yGHfxoVmlnt9a91rpWmE=<br>
=G70f<br>
-----END PGP SIGNATURE-----<br>
<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>
</blockquote></div><br><br clear="all"><br>-- <br>S pozdravom (regards)<br>Ing. Peter Kukuča<br>