1

Here is my situation:
The company I work for are using some third party software that plots the location of devices on a wifi network. The software requires you to upload a floor plan of the area (this is just a 2000 x 1187 px jpeg). The software spits out xy coordinates for every device location which is visualised over the floor plan.

I have been asked to take these xy coordinates and display them using the Google maps API, so therefore need to somehow convert them to latitude and longitude.

The third party software uses the pixel dimensions of the jpeg as reference to calculating the xy coordinate, according to the limited documentation. I have attempted to use Python and the pyproj module to make the conversion (there are over half a million coordinates to convert), but the results just seem to plot the lat long in roughly the same position every time.

Here is what I have so far:

projection = Proj("+proj=lcc +lat_1=53.466082 +lat_2=53.464971 +lat_0=53.465482 +lon_0=-2.338944 +x_0=0 +y_0=0 +no_defs +a=6378137 +rf=298.257222101 +to_meter=1 +k_0=200")

wgs84 = Proj(init='epsg:4326')

lat = xCoordinate
lon = yCoordinate

xx, yy = transform(projection, wgs84, lat, lon)
latLong = {'lat':xx, 'long':yy}

return latLong

I admittedly have very little experience with mapping etc and have very little time to get my head around the topic.

I hope this is enough information to go on. If anyone can help in pointing me in the right direction then I would be eternally grateful.

Cheers.

Anil_M
  • 10,893
  • 6
  • 47
  • 74
James_101
  • 13
  • 7
  • How did you got the argument to Proj(), i.e. "+proj=lcc +lat_1=53.466082 +lat_2=53.464971 +lat_0=53.465482 +lon_0=-2.338944 +x_0=0 +y_0=0 +no_defs +a=6378137 +rf=298.257222101 +to_meter=1 +k_0=200" ? Does your 3rd party software said it used this specific projection? If so things would be relatively simple, if not you have to make guess work of what this string should be – yosukesabai May 03 '17 at 14:50
  • No this is not the projection used, I have just been fumbling around trying to guess these arguments to be honest by using Google maps to roughly plot the Latitude of origin and Latitude of first standard parallel etc. – James_101 May 03 '17 at 14:59
  • 1
    You might be looking for Mercator projection... But If you hit rock bottom, maybe you could split your area into squares. you store the coordinate of the squares' center. You do the same on the png, but with the x,y this time. Then you just have to link the two. Also, this might help http://read.pudn.com/downloads136/sourcecode/embed/581566/GPSPet%200505/NMEA2OSG.cs__.htm – pwnsauce May 03 '17 at 15:06
  • 1
    How large the extent of your x,y? Is it like tens of km, or more like thousands? Hope it is closer to the former. Is there set of point where you know lat/lon and x,y at the same time? then you come up with some linear transformation to map lat/lon and xy, and call it as decent approximation. approximation becomes worth as extent of points got greater, as curvature of earth plays bigger role and different projection (arguments or Proj()) behave differently, and guess work starts to fail... – yosukesabai May 03 '17 at 15:13
  • I'd start with lcc that you have, but make lat_1 and lat_2 be approximately cover extent of your points, north-south wise. e,g if points are for Texas, it would be 25 and 40, something like that. make lat_0 and lon_0 to be mid point. the rest of parameter should be file. then this converts lat/lon in degree to x,y in kilometers. you then need to translate your images x,y into kilometer, which needs some guess work. – yosukesabai May 03 '17 at 15:16
  • In terms of the extent of the xy - we are talking meters, it is not a large area. And yes, I can roughly plot the lat/lon for the x/y at 0,0. – James_101 May 03 '17 at 15:18

0 Answers0