Please excuse my slightly off forum question, it appears that pyproj does not have a forum or email list for questions. It uses proj.4 which does have an email list but not help forum that I can see. There seem to intelligent mapping answers here, so I thought I’d ask here especially since I got into this by the use of OSM data and tool sets.
I am creating paper topographic maps by layering information derived from USGS DEM data for contours and slope shading. I am using OSM data for trails, roads, water features, etc. Finally I am overlaying a UTM grid. All this is being formatted using Mapnik.
Everything is registering well (trails and road appear correct with respect to the contours. The waterways nicely match up with the drainages as shown by contours, etc. And if I use WGS84 for my UTM grid it seems to line up well too, at least the positions of map features are the same within my measuring capability as a USGS topo map. But if I overlay a NAD27 UTM grid my easting grid lines appear to be off by about 85 meters. The northing grid lines appear to be correct. I could live with 5 or 10 meters as that is the accuracy of my GPS but not 85 meters.
I create the UTM grid by determining the UTM measurements for the edges of my map and then going to points the nearest even 1000 meters off paper and putting ways between the points so located. The position of the points is converted to from UTM to lat,lon and the points and ways are written to a OSM XML file which is used as the source for the UTM grid layer in Mapnik.
Conversion of UTM to lat,lon is using pyproj. My instantiation of the projection objects is as follows:
wgs84utm = pyproj.Proj(proj='utm', zone=v['zone'], datum='WGS84', ellps='WGS84') nad27utm = pyproj.Proj(proj='utm', zone=v['zone'], datum='NAD27', ellps='clrk66')
When I convert a point from UTM to lat,lon I use the following:
if (proj == 'wgs84'): point = wgs84utm(easting, northing, inverse=True) elif (proj == 'nad27'): point = nad27utm(easting, northing, inverse=True)
One thing that confuses me is I only see one NAD27 UTM setup in the pyproj espg list. Based on my GPS and other mapping programs I was expecting to see several (CONUS, Alaska, Canada, etc.). There is a NAD27 CONUS but it has a different projection. Based on values for that I tried
nad27utm = pyproj.Proj(proj='utm', zone=v['zone'], datum='NAD27', ellps='clrk66', lat_1=29.5, lat_2=45.5, lat_0=23, lon_0=-96, x_0=0, y_0=0)
But the results were the same, depending on which area I look at (both in zone 11) I am 84 or 86 meters off on the easting.
I am a newbie with python and map projection conversions, so I’m pretty sure that I’ve made some mistake in my usage of the projection library but don’t know what. I’d appreciate any suggestions on where I have gone wrong.