[OpenLayers-Users] snap to road

Stephen Woodbridge woodbri at swoodbridge.com
Wed Mar 18 23:09:35 EDT 2009


emmexx wrote:
> Jordan Anderson scrisse:
>> Hey Maxx,
>>
>> ridethecity.com does something similar to this and you can see it in two places:
>>
>> On the main page (http://www.ridethecity.com), if you drop a marker or
>> drag the market around, we send the lon/lat to the server and look up
>> the nearest street name in our PostGIS street database (but only in
>> NYC).
> 
> Thanks to you and to Stephen for your answers.
> 
> My doubt is about what kind of server I need to get this.
> I mean, is it enough some standard hosting with php (and mysql) or I
> need to setup some kind of map server?
> Or can I query some public server to get the info needed to snap.
> In the case of OSM can I get some "point" info from it or what OL gets
> from OSM is just a picture?

Basically, what you get is a picture. OSM has the underlying vectors, 
but you would need to know about the data structures and need to know 
how to find the vector closest to the point and some math to project the 
point onto the vector.

What I do is have all the data on my servers and I use that to generate 
the map images and also to do the reverse geocoding or snapping. I use 
PostGIS because it is well integrated with Mapserver. But you can use 
MySQL with GDAL/OGR interface. I also use PHP for building simple AJAX 
servers.

The bottom line is that you are going to have to get into the data, how 
it is stored, how it is rendered, and probably write some code to glue 
it all together. Well this is how I would do it at any rate.

Maybe others can provide other tools that would make this easier to do.

Good luck with this.

Best regards,
   -Steve

> Thank you
> 	maxx
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list