]> err.no Git - mapper/blob - docs/example-queries.sql
Rename s2s table to n2n. Add flags field to nodes table. integer -> int
[mapper] / docs / example-queries.sql
1
2 /* Select way near given int lat,lon */
3 select wid,type,flags,num,nodes,((911084432-lat)*(911084432-lat))+((265542144-lon)*(265542144-lon)) as dist from way,way_seg,nodes where wsid=wid and node=nid and lat between 911084432-10000 and 911084432+10000 and lon between 265542144-10000 and 265542144+10000 order by dist;
4
5 /* Select nodes for given way */
6 select num,lat,lon from way_seg,nodes where wsid=4216626 and node=nid order by num
7
8 /* Select ways of specific type inside box */
9 select wid,flags,num,nodes,((911084432-lat)*(911084432-lat))+((265542144-lon)*(265542144-lon)) as dist from way,way_seg,nodes where wsid=wid and node=nid and lat between 911084432-1000000 and 911084432+1000000 and lon between 265542144-1000000 and 265542144+1000000 and type=1 order by dist;