How to show a point on Google Map ?

Topics: Algorithms, SharpMap v0.9 / v1.x
May 29, 2011 at 8:25 PM

Hello, everybody!!!

I use TileLayer with google map loaded in my project. And when I move cursor above my map, I see coordinates like <7582631 10325286>. I understand it's for google map projection. And I have another layer with points (some objects I want to display on my map). I'd like to add points using coordinates like <XX* XX' XX''   XX* XX' XX''>(i.e. degrees for the latitude and the longitude). The question is how to transform degrees into Google coordinates? Can anybody help?

Sincerely Yours, polcovnic

Coordinator
May 30, 2011 at 9:32 AM

Have a look at

http://proj4net.codeplex.com/SourceControl/changeset/view/50536#829943

Hth FObermaier

May 30, 2011 at 9:56 AM

Thanks for Your reply. But as I understand these methoda only format angles output (degrees, radians, degrees+minutes, etc.). But coordinates for google map - like <7582631 10325286> - are not radians. Am I wrong? How to transform it to degrees or radians?

Sincerely Yours, polcovnic

Coordinator
May 30, 2011 at 10:54 AM
Edited Jul 5, 2011 at 9:28 PM

Seems that I didn't read carefully :).

If you use TileLayer, your coordinates are almost certainly in EPSG:3857 (WebMercator). To get your lat/long coordinates in that projection you need to setup an aproriate coordinate transformation or transform your points beforehand.

There are numerous threads on this topic, almost every post on TileLayer deals with that topic.

Hth FObermaier

Jul 5, 2011 at 9:04 PM

Okay, if I want to setup an aproriate coordinate transformation - I need two coordinate systems (original and target). The target is EPSG:3875 (WebMercator). What is original? My points are not from any shapefile or other source. Just data like (latitude, longitude), -90 < latitude < 90; -180 < longitude < 180 (in degrees, or I can convert to radians). What coordinate system is it?

polcovnic

Coordinator
Jul 5, 2011 at 9:27 PM

I suppose it is WGS84 or EPSG:4326

The spatial reference ID for web mercator is EPSG:3857 (my fault).

Hth FObermaier