1
{
  "type": "MultiPolygon",
  "coordinates": [[[
        [6707794.77817316, 1952512.97762237],
        [6707794.43138905, 1952566.21209599],
        [6707897.49942442, 1952567.26754007],
        [6707897.9039513, 1952513.5347079],
        [6707794.77817316, 1952512.97762237]
      ]]]
}

these are my UTM coordinates for Sacramento city

from pyproj import Proj
Lat = 52.063098675
Lon = -114.132980348
ZoneNo = "11" #Manually input or from other sources
myProj = Proj("+proj=utm +zone="+\
ZoneNo+", +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
Lon2, Lat2 = myProj(UTMx, UTMy,inverse=True)



 [57.645243963689346, -97.82662155895939][57.64521883657446, 
-97.82633467103226][57.64520287229081, -97.82615238782866] 
[57.64518564728056, -97.82595574421379][57.646086991794625, 
-97.82587777819731][57.64614690939316, -97.8265560026529] 
[57.645243963689346, -97.82662155895939]

But this return coordinates located at Canada. But I want to Locate this longitudinal and latitudinal's in SACRAMENTO city

Can anyone help me to convert the correct format to convert the UTM to LAN LONG coordinates.

Udi
  • 29,222
  • 9
  • 96
  • 129
Manikanta
  • 325
  • 6
  • 20
  • 1
    your coords are halfway between calgary and edmonton - in canada: https://www.google.de/maps/place/52%C2%B003'47.2%22N+114%C2%B007'58.7%22W/@52.6329169,-121.8445565,5z/data=!4m5!3m4!1s0x0:0x0!8m2!3d52.0630987!4d-114.1329803 – Patrick Artner Jun 09 '18 at 11:58
  • this might help: https://stackoverflow.com/questions/6778288/lat-lon-to-utm-to-lat-lon-is-extremely-flawed-how-come – Patrick Artner Jun 09 '18 at 12:00

1 Answers1

0

Your coordinates are using the "NAD83(NSRS2007) / California zone 2 (ftUS)" coordinate system:

from django.contrib.gis.geos import Polygon
from pprint import pprint

DATA = [
    [6707794.77817316, 1952512.97762237],
    [6707794.43138905, 1952566.21209599],
    [6707897.49942442, 1952567.26754007],
    [6707897.9039513, 1952513.5347079],
    [6707794.77817316, 1952512.97762237]
]

poly_california = Polygon(DATA, srid=3492)
poly_gps = poly_california.transform(4326, clone=True)
pprint(poly_gps.coords)

Result:

(((-121.48923204074042, 38.52249222070792),
  (-121.48923220705949, 38.5226384001039),
  (-121.48887193496923, 38.52263970700418),
  (-121.48887157735834, 38.522492158296565),
  (-121.48923204074042, 38.52249222070792)),)

(Tip: GeoJSON should only use WGS84)

Community
  • 1
  • 1
Udi
  • 29,222
  • 9
  • 96
  • 129