[Routing] render the postgresql query into openlayers (GeoJSON output)

Daniel Kastl daniel at georepublic.de
Thu Aug 11 15:23:01 BST 2011


Hi Javad,

Why don't you just try it and then see if it works?
And if it doesn't and you can't find the reason why, then you come back here
and tell us the error you get.
Btw., you're now more asking questions about OpenLayers than about routing
and OSM.



> you said me that I have to delete the Properties but I dont know exactly
> which lines. please delete the Property in my php code and copy the correct
> file for me. and also look to added line in the lines that I added to
> display the result of PHP file in the browser. for example if you look to my
> added lines you see that I created a new seore(var store1) . is that
> right?
> why the codes doest work? what was the problem?
> thanks
>
>
You could search for "properties" in the PHP code and then you would find
it. It's a key/value of the GeoJSON output you want to return.

If you don't know what I mean, change your SQL to

SELECT gid, ST_AsGeoJSON(the_geom) AS geojson, length(the_geom) AS length
FROM ways WHERE ...

It should work then as it is.
And once again, consider to change to the OpenLayers mailing list if your
questions are not related to routing anymore.

Daniel



> On Thu, Aug 11, 2011 at 4:01 AM, Daniel Kastl <daniel at georepublic.de>wrote:
>
>>
>>
>>> .is it ok?
>>>
>>
>> More or less, but you need to to try it yourself. (Remove the "properties"
>> from the GeoJSON, because you don't query for them, or add them to the
>> query)
>>
>>
>>>
>>> then to display it in html file with opn layers:  I have to the following
>>> steps:
>>> 1-create the layer where the query result will be drown
>>> 2- add the layer to the map
>>>
>>
>> Yes, it's all described in the workshop. You just need one more layer.
>>
>> Daniel
>>
>>
>>
>>
>>>
>>>
>>> thanks
>>>
>>>
>>>
>>>
>> --
>> Georepublic UG & Georepublic Japan
>> eMail: daniel.kastl at georepublic.de
>> Web: http://georepublic.de
>>
>> _______________________________________________
>> Routing mailing list
>> Routing at openstreetmap.org
>> http://lists.openstreetmap.org/listinfo/routing
>>
>>
>
> _______________________________________________
> Routing mailing list
> Routing at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/routing
>
>


-- 
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
Web: http://georepublic.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/routing/attachments/20110811/8bdfe12e/attachment.html>


More information about the Routing mailing list