[pgrouting-users] question : Shortest Path Shooting star using python

bino oetomo bino at indoakses-online.com
Thu Feb 2 23:47:43 EST 2012


Dear Daniel and all
I really appreciate your enlightment
On 02/03/2012 11:18 AM, Daniel Kastl wrote:
>
> The unit is the unit of your projection. It's probably degree in your case.
>
>

> You can transform your projection for example to some meter projection like
> "World Mercator" (ie. EPSG:3785).
> Then length(geometry) will be in meter.
>
> Like "SELECT length(ST_transform(<geometry column>,3785)) AS meter FROM
> <table>".
>

I tried to change the query to :
---START----
SELECT rt.gid, ST_AsGeoJSON(rt.the_geom) AS geojson,
         length(ST_transform(rt.the_geom,3785)) AS length, ways.gid
         FROM "ways",
         (SELECT gid, the_geom
         FROM shootingstar_sp(
         'ways',
         195690, 11690,
         0.1, 'length', true, true)
         ) as rt
         WHERE ways.gid=rt.gid;
----STOP----

but I got error, looks like that '3785' is not listed in 'spatial_ref_sys' :
---Start---
Traceback (most recent call last):
   File "routecalc01a.py", line 21, in <module>
     cur.execute(mysqlquery)
psycopg2.InternalError: AddToPROJ4SRSCache: Cannot find SRID (3785) in 
spatial_ref_sys
----stop---

How to add that projection to spatial_ref_sys ?
Anyway .. my data is for indonesia are, and I want the unit is in meter. 
What projection is the right one ?

Sincerely
-bino-


> Daniel
>
>
>
>> Note : When I try to count the route using same start Lat/Lon and end
>> lat/lon, google map said it was about 2.1 km
>>
>> Sincerely
>> -bino-
>>
>> ______________________________**_________________
>> Pgrouting-users mailing list
>> Pgrouting-users at lists.osgeo.**org<Pgrouting-users at lists.osgeo.org>
>> http://lists.osgeo.org/**mailman/listinfo/pgrouting-**users<http://lists.osgeo.org/mailman/listinfo/pgrouting-users>
>>
>
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20120203/cef39072/attachment.html


More information about the Pgrouting-users mailing list