Page MenuHome

DXF import, inverted longitude latitude
Closed, ResolvedPublic

Description

Blender Version
v2.76

Short description of error
Using georeferencing option in dxf importer, the resulting longitude/latitude in custom scene properties are inverted.

Error come from file do.py line 179 in function georeference

latlon = transform(self.pScene, wgs84, center[0], center[1], center[2])
scene['latitude'] = latlon[0]
scene['longitude'] = latlon[1]
scene['altitude'] = latlon[2]

The function transform from the pyproj library return a tuple (longitude, latitude, altitude) so the code must be

lonlat = transform(self.pScene, wgs84, center[0], center[1], center[2])
scene['longitude'] = lonlat[0]
scene['latitude'] = lonlat[1]
scene['altitude'] = lonlat[2]

Pyproj documentation

Please also update tracker url in bl_info because it redirects to an obsolete bitbucket repository instead of developer.blender.org

Details

Type
Bug

Event Timeline

domlysz (domlysz) added a project: Addons.
domlysz (domlysz) set Type to Bug.
domlysz (domlysz) created this task.
domlysz (domlysz) raised the priority of this task from to Needs Triage by Developer.

Same at line 149 :

add = Vector(transform(wgs84, self.pScene, cscn_lat, cscn_lon, cscn_alt))

must be

add = Vector(transform(wgs84, self.pScene, cscn_lon, cscn_lat, cscn_alt))
Sergey Sharybin (sergey) triaged this task as Normal priority.Jun 28 2016, 9:56 AM

ok... next time maybe somebody not struggling with git wants to do it...
the bugfix by domlysz seems to be valid according to the pyproj documentation. I don't have test environment at hand atm. I expect the amount of users using pyproj to be very low anyway.

tracker url in bl_info has been updated in an earlier commit