-1

I need help to put markers on Android Map. I am receiving a JSON string from a WebService that use GeoJSON. I could parse it, but the coordinate system is not the traditional, and I don't know how to put the markers on map.

This is the example that I am using:

 double latitude = 5441638.1188548915 // this value came from WS
 double longitude = 6352789.023657421 // this value came from WS


      map.addMarker(new MarkerOptions()
            .title(jsonObj.getString("Restaurants"))
            .position(new LatLng(
                    latitude,
                    longitude
             ))
        );

What i want to know if is there is any method to convert the coordinates to the classic system (ex: -30.5645, -50.2328) , or an Android method to work with the other system of coordinates. I hope you can help me, Thanks!

Nico812
  • 47
  • 5
  • Could you use something like proj4j or proj4js to convert? (Say from 3857 to 4326) – tofarr Jul 17 '15 at 15:20
  • If it is mercator projection, maybe this could help : http://stackoverflow.com/questions/14329691/covert-latitude-longitude-point-to-a-pixels-x-y-on-mercator-projection – tofarr Jul 17 '15 at 15:21
  • Thanks ! The proj4 is available to use with Android ?, because I read that is a Javascript library..Thanks for the link, what do you mean with "mercator projection" sorry I did'nt understand – Nico812 Jul 17 '15 at 15:40
  • Projection systems are standard methods of turning real world coordinates into positions on a flat plain - proj4 is a library for working with projection systems - there are c/c++, javascript and java ports, (although as far as I know, the java version does not have a final release candidate.) Still, in my experience it does seem to handle simple conversions like Mercator to WGS84 - the coordinates you have in your example look like mercator to me - they would translate into [lon=57.06807476738193, lat=43.84598019735821] - Somewhere in Uzbekistan? – tofarr Jul 20 '15 at 08:31
  • Hmmm - since there is not much there (looks like a rural area), I guess that the coordinates are probably not in mercator - you should find out which projection system is in use and work from there. – tofarr Jul 20 '15 at 08:32
  • 1
    Hi, thanks for your response. I found that the used system is EPSG 22185, the location is Rosario, Argentina. Do you think is posible to convert this system ? – Nico812 Jul 20 '15 at 19:32
  • Please consider editing your post to add this information. – Peter Jul 20 '15 at 22:18

1 Answers1

1

I've put this as an answer, but regrettably it's not a complete one.

Your position is likely not to be lat/lon but Eastings and Northings. The conversion process is quite complex. In actuality your WebService should be stating which Coordinate Reference System (crs) it is using as the GeoJSON default is WGS84

You should see if you can get the WebService to supply "proper" coordinates instead.

vogomatix
  • 4,856
  • 2
  • 23
  • 46
  • Thanks for your response ! I have no possibilities to change the coordinate system on Web Service, so I have to make a conversion. There is no native method to work with this coordinates system? – Nico812 Jul 17 '15 at 15:42