[Xastir] Datum conversions

Tom Russo russo at bogodyn.org
Sun Dec 19 14:58:51 EST 2004


On Sun, Dec 19, 2004 at 11:04:44AM -0800, we recorded a bogon-computron collision of the <archer at eskimo.com> flavor, containing:
> On Sun, 19 Dec 2004, Tom Russo wrote:
> 
> > Unfortunately, the numbers you show above don't look like they're UTM
> > coordinates for the area you're saying they represent.  Longitude 112W is
> > right at the boundary of UTM zone 12, and if I try to convert 112.8W, 53.5N
> > to UTM in zone 12 with cs2cs (from the proj4 install) I get
> > 380607.21Easting,5929401.53Northing --- nothing like the numbers you show
> > above.  So I can't even begin to guess what projection is used (could be
> > just about anything).
> 
> State Plane coordinates, in feet?

As good a guess as any.

> I've had good luck reading those types of files in with OGR.
> Unfortunately if you switch the Shapefile drawing over to OGR you
> end up losing the dbfawk functionality, plus you don't have all the
> hard-coded defaults in there of the non-dbfawk original Shapefile
> code.  This makes the maps ugly, but perhaps still useful for you.
> There's a #define in the code you can use to make this switch, if
> you want to try it.  Weather Alert shapefiles still go through the
> old code in any case, so that you don't lose those.

If you don't have a .prj for ogr to read, then using OGR in xastir won't
help --- you're just as badly off as with map_shp because there's nothing
to tell what projection things are in.

If you *do* have a .prj file in the right format, then xastir's ogr
code can work but...

> Your best bet though would be to use ogr2ogr to convert to something
> that the regular code could handle.  

...ogr2ogr can read the .prj file and you're home free with:
  ogr2ogr -t_srs EPSG:4326 out_directory source.shp

(uses the existing .prj to determine what the source projection is, and
converts it to WGS84 Lat/Lon (EPSG # 4326).

-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://www.qsl.net/~km5vy/
 "When life gives you lemons, find someone with a paper cut."



More information about the Xastir mailing list