Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Geo coordinates

you have to subtract the net offset if you want to convert from x,y to lon,lat. See https://github.com/eclipse-sumo/sumo/blob/89ad34cf688de9a4dfc49f6389521cb22b2bb17b/tools/sumolib/net/__init__.py#L528-L533

Am Di., 2. Juli 2024 um 18:58 Uhr schrieb Amir hkr via sumo-user <sumo-user@xxxxxxxxxxx>:
Hello,
I have a question. I got a map from OSM webwizard and this is information in the generated net file.

    <location netOffset="-556346.00,-4765337.00" convBoundary="0.00,0.00,60045.24,51972.26" origBoundary="-82.369472,42.949606,-79.569114,43.507382" projParameter="+proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"/>

I used this code to find geo coordinates of x=0 and y=0:


import pyproj

# Define the projection
proj_utm = pyproj.Proj(proj="utm", zone=17, ellps="WGS84", datum="WGS84", units="m", no_defs=True)

# Define the offset
net_offset_x = -556346.00
net_offset_y = -4765337.00

# Calculate the UTM coordinates for x=0, y=0
utm_x = net_offset_x
utm_y = net_offset_y

# Convert UTM coordinates to geographic coordinates (latitude and longitude)
lon, lat = proj_utm(utm_x, utm_y, inverse=True)
(lat, lon)

However, this code returns Latitude: 43.03857438535148 and Longitude: -82.369472, while in NetEdit I see that for x=0 and y=0, the coordinates are 43.038632, 30.808277. I would like to know where my mistake is.  
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top