support for different coordinate systems and projections in osmand

316 views
Skip to first unread message

spinxz

unread,
Jul 18, 2011, 5:38:50 AM7/18/11
to Osmand
Hi

I am wondering how much effort it would be to make osmand support
other coordinate systems, e.g. the swiss grid (https://
secure.wikimedia.org/wikipedia/en/wiki/Swiss_grid CH1903).
In my case, I bought tiles from the swiss maps and would like to
render them with osmand. But the tiles are defined using the CH1903
coordinate system and the projection is also different (i.e. one
could not simply convert the coordinate entries in the tile
database).
How generic is tile rendering implemented and how generic are
coordinates handled within osmand? Are there any plans to support
country/region specific coordinate systems?

Regards
spinxz

Victor Shcherb

unread,
Jul 18, 2011, 5:45:32 AM7/18/11
to osm...@googlegroups.com
Hi

I briefly read your message. Are your coordinate system is elliptic merkator? It is already supported.
Actually you can install on osmand YandexMap and MicrosoftMap, go to osmand/tiles and find in each folder .metainfo file.
That file contains information about tile system, actually the scripting language (Java) can be used to convert queries from osmand to correct tiles.

So there are possibilities to do without updating application.

Please take a look

2011/7/18 spinxz <pinkpan...@gmail.com>

andre van atten

unread,
Jul 18, 2011, 5:48:06 AM7/18/11
to osm...@googlegroups.com

Very difficult, coordinate systems. You can use globalmapper 12.02 to convert them to osm tiles. With osmmapcreator you can store them in a .sqlite database and this file can be put on your SD card in Osmand/tiles.

Andre

Op 18 jul. 2011 11:38 schreef "spinxz" <pinkpan...@gmail.com> het volgende:

spinxz

unread,
Jul 22, 2011, 5:21:51 AM7/22/11
to Osmand
Hi Victor

Thanks for the answer.

This sounds interesting, so I can control myself how the tiles are
accessed - this would be perfect.

Yes, the projection of the swiss grid is (from wikipedia): "Oblique
Mercator on an 1841 Bessel ellipsoid"

I checked the folders on my phone to find the .metainfo file but I
could not find them first. Downloading the Microsoft Map with osmand
map creator helped me out. In the "Microsoft Map" folder I found
the .metainfo file with the content attached below.

Please note that I already have some tiles offline. Hence I want to
build a db and use it with osmand.

Is there any documentation on how to use these files? In the osmand
wiki maybe?

Thanks for an answer!

.metainfo file for ms maps:
----------------------------------------------
[rule]
beanshell
[url_template]
public static String eqt(int z, int x, int y) {static final char[]
NUM_CHAR = { '0', '1', '2', '3' };char[] tn = new char[z];for (int i =
z - 1; i >= 0; i--) {int num = (x % 2) | ((y % 2) << 1);tn[i] =
NUM_CHAR[num];x >>= 1;y >>= 1;}return new String(tn);} String
getTileUrl(int z, int x, int y) { return "http://" + "r" + "0" +
".ortho.tiles.virtualearth.net/tiles/" + "r" + eqt(z,x,y) + ".png" + "?
g=45";}
[ext]
png
[min_zoom]
1
[max_zoom]
19
[tile_size]
256
[img_density]
16
[avg_img_size]
18000

-----------------------------------

On 18 Jul., 11:45, Victor Shcherb <vics...@gmail.com> wrote:
> Hi
>
> I briefly read your message. Are your coordinate system is elliptic
> merkator? It is already supported.
> Actually you can install on osmand YandexMap and MicrosoftMap, go to
> osmand/tiles and find in each folder .metainfo file.
> That file contains information about tile system, actually the scripting
> language (Java) can be used to convert queries from osmand to correct tiles.
>
> So there are possibilities to do without updating application.
>
> Please take a look
>
> 2011/7/18 spinxz <pinkpanther4...@gmail.com>

spinxz

unread,
Jul 22, 2011, 5:22:54 AM7/22/11
to Osmand
Thanks for the answer.

Sadly the globalmapper is no free nor open source solution to this
problem.

On 18 Jul., 11:48, andre van atten <andrevanat...@gmail.com> wrote:
> Very difficult, coordinate systems. You can use globalmapper 12.02 to
> convert them to osm tiles. With osmmapcreator you can store them in a
> .sqlite database and this file can be put on your SD card in Osmand/tiles.
>
> Andre
> Op 18 jul. 2011 11:38 schreef "spinxz" <pinkpanther4...@gmail.com> het

Victor Shcherb

unread,
Jul 22, 2011, 5:28:02 AM7/22/11
to osm...@googlegroups.com
Unfortunately I think Andre is right. If you already have downloaded data you should somehow reconvert tiles to standard Osmand projection. .Metainfo file helps only when you want specify templates how download that tiles.

I think there are programs that can help you convert your tiles to different projection.

Best Regards,
Victor

2011/7/22 spinxz <pinkpan...@gmail.com>
Reply all
Reply to author
Forward
0 new messages