7

What is Google map's spatial reference system using when you enter a lat, long into the maps search bar?

I've found hints that it might be WGS84 but after converting to that coordinate system, nothing shows up when i paste the coordinates into the google maps search box.

I am converting from GDA MGA 56.

Sample:

  • Input MGA56 coords: 336301, 6253363
  • Expected WGS86 coords: -33.8473340793201, 151.230631835944
  • I get: 16834916.928327594 -4008321.1020318186

Spatial coord systems:

  • EPSG:28356 for MGA56
  • EPSG:900913 for WGS86 (google maps)

I am using geotools to do the transform:

    CoordinateReferenceSystem crsMga56 = CRS.parseWKT(mga56);
    CoordinateReferenceSystem crsGmaps = CRS.parseWKT(gmaps);

    Coordinate coordinate = new Coordinate(336301, 6253363);
    Point point = new GeometryFactory().createPoint(coordinate);

    MathTransform transform = CRS.findMathTransform(crsMga56, crsGmaps);
    Geometry geometry = JTS.transform(point, transform);

I know the transform is not correct, as when i use an online tool it gives me the correct coords. http://www.environment.gov.au/cgi-bin/transform/mga2geo_gda.pl?east=336301&north=6253363&zone=56

Kara
  • 6,115
  • 16
  • 50
  • 57
JavaRocky
  • 19,203
  • 31
  • 89
  • 110
  • 1
    Could you be more specific regarding "nothing shows up"? What coordinate system are you converting *from*? – Greg Hewgill Nov 04 '09 at 22:04
  • I guess that's the expected result, since Australia contains a whole lot of nothing. :) – Greg Hewgill Nov 04 '09 at 22:24
  • More seriously, could you also give an example of your input coordinates, and your converted WGS84 coordinates? Google Maps should show *something* for any valid geographic coordinate, even if it's outback or ocean. – Greg Hewgill Nov 04 '09 at 22:25

2 Answers2

11

Google uses a spherical mercator projection based on WGS84. There's a writeup on the OpenLayers website.

Sarge
  • 2,367
  • 2
  • 23
  • 36
1

If it is any use, we found GeoTools were changing the JVM so that lat & long were the opposite way around (i.e. 151,-33), which might explain why you are getting out of bounds {151 > 90}) it was a nightmare to find

j-dogg
  • 11
  • 1