Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

Latest news

Last at Mon, 6 Sep 2010 12:27:06
Topic: Let your feedback ideas flow
See more news »

Nutiteq on Twitter

12 weeks 2 days ago Nutiteq is proud sponsor of StateOfTheMap 2010 #sotm10

epsg90013 to epsg4326

4 replies [Last post]
kenjinboy
User offline. Last seen 29 weeks 2 days ago. Offline
Joined: 02/04/2010

how can we WgsPoint'lonlat in epsg90013
but I need the epsg4326.
I can't find the convert API.
Anyone know that?

jaak
User offline. Last seen 7 hours 36 min ago. Offline
Joined: 06/19/2008

What do you mean by "lonlat in epsg90013". Can you give a example coordinate?

For server-side conversion do you know about http://trac.osgeo.org/proj/ tools?

/JaakL

kenjinboy
User offline. Last seen 29 weeks 2 days ago. Offline
Joined: 02/04/2010

I have the follow data in my database
ESPG 900913
"POINT(-742990.597843593 7056832.45410695)"
"POINT(-742923.06030853 7058383.83956466)"
"POINT(-742900.250944863 7058167.17745916)"
"POINT(-742879.489859832 7057444.59612811)"
"POINT(-742861.912512237 7058406.77027894)"

but I need these
ESPG 4326
"POINT(-6.6743981 53.3973213)"
"POINT(-6.67379140000001 53.4056302)"
"POINT(-6.67358649999998 53.4044699)"
"POINT(-6.6734 53.4006)"
"POINT(-6.67324210000001 53.405753)"

I can Transform inside the database,but I want to transform them outside the data. I'm looking for a java API, or math function

jaak
User offline. Last seen 7 hours 36 min ago. Offline
Joined: 06/19/2008

You can transform them using library code, via pixel space. First make sure that active map is in EPSG 3785 (forget about 90913). E.g. just use default OSM map. Then convert your projected coordinates to pixels of some zoom using linear calculation, like they were map pixel coordinates. Note that with bigger zoom accuracy is better. Then use map service mapPosToWgs method. My code:

// some constants
double xmax = 20037508.34; // ymax is same for EPSG:3785
int basezoom=20;

// test coordinate conversion
double x = -742990.597843593; // in projected
double y = 7056832.45410695;

// convert to pixels on some zoom
double xpix=(1+(x/xmax)) * Float11.pow(2,basezoom-1)*256;
double ypix=(1+(y/xmax)) * Float11.pow(2,basezoom-1)*256;
		
// convert to WGS
Point wp = map.getMap().mapPosToWgs(new MapPos((int) xpix,(int) ypix,basezoom));
System.out.println(wp);

I got result as: 53.39732S, 6.674398W which is quite close to your numbers.

Finally you can use the WGS point in library API to add points to map. This will convert it internally back to pixel coordinates, but this should not too much overhead.

/JaakL

kenjinboy
User offline. Last seen 29 weeks 2 days ago. Offline
Joined: 02/04/2010

Thank you for your comments
I create the new database with espg4326