0

I have a Database with GeoCoordinates of every Zipcode in a Decimal form (e.g. 5099755, 928690)

I want to do an area search based on these values, but in the formula that I'v found, I should pass the Lat and Lon values as Double.

How can I convert these "decimal" values to "double" values?

hoomb
  • 649
  • 2
  • 12
  • 24

2 Answers2

0

If GeoPoints is the GeoCoordinates variable

double lat = GeoPoints.getLattitude(); or double lat = GeoPoints.getLattitudeE6; double lon = GeoPoints.getLongitude(); or double lat = GeoPoints.getLongitudeE6;

0

I think we need to know what sort of coordinate system your numbers are in - they look like they might be UTM (universal transverse mercator), but if so, there should also be a 'Zone' parameter (e.g. 55H). This document describes how to convert from UTM to DMS (and provides parameters for the various geographic datums) and also provides Javascript which you should be able to convert into Java pretty easily.

Also, have a look at this stackoverflow post, which talks about java packages which can do coordinate system conversion.

Then again, maybe your code wants data in exactly the format they're already in, in which case all you need to do is cast your decimals to doubles.

Community
  • 1
  • 1
Simon MᶜKenzie
  • 8,344
  • 13
  • 50
  • 77