[OSRS-PROJ] Puzzled dabbler -- when do I need /nad?

Tom Messenger messengertj at citlink.net
Fri Mar 12 01:47:02 EST 2004

You presume correctly.  shpcs2cs comes from a link on the Shapefile C
Library home page:

Tom Russo has implemented a shpcs2cs program, which reprojects shapefiles
using arguments similar to the PROJ.4 cs2cs program including datum
conversion. Use as an alternate to the contrib/shpproj which doesn't do
datums. It is available at the bottom of Tom's Xastir Shapefile Resources

It's a variant of your cs2cs with shapefile input/output done by the
Shapefile C Library.  (I think Mr. Russo says 90% of the code is cs2cs.)

I used nad2bin from your binary distribution to make conus from conus.llb,
set the environment variable and reran shpcs2cs.  It changed the shapefile I
got out from what I got out before.  No doubt I should dig around a little
in both shapefiles in a binary editor to see if I believe the difference
really reflects the difference between NAD27 and NAD83.  I rather resist
that though -- sure to be tedious and confusing.

Thanks for your help.

----- Original Message ----- 
From: "Frank Warmerdam" <warmerdam at pobox.com>
To: <osrs-proj at remotesensing.org>
Sent: Thursday, March 11, 2004 10:02 PM
Subject: Re: [OSRS-PROJ] Puzzled dabbler -- when do I need /nad?

> Tom Messenger wrote:
> > As a dabbler who is only using the shpcs2cs function to convert a NAD27
> > Lambert Conformal Conic shapefile to NAD83 latitude/longitude, I'm
> > unsure if I need the grid shift files in subdirectory \nad.  My example
> > is a shapefile representing the geological formations on a geologic map
> > of Arizona.
> >
> > My command line is
> >
> > shpcs2cs AZ_GEOL.shp AZ_GEOLll83.shp -v +proj=lcc +datum=NAD27
> > +lon_0=-96 +lat_1=33 +lat_2=45 +lat_0=23 +x_0=5000000 +y_0=0 +to
> > +proj=latlong +datum=NAD83
> >
> > and it seems to make no difference to the output whether conus.lla is in
> > the \bin directory or not.  With the low resolution of this particular
> > file, it is hard to check whether the result is really NAD83 or not.
> > Can you tell me what transformation cs2cs actually applies in this
> > case?  (I have seen suggestions in the documentation that the program
> > doesn't complain if files are missing, it just skips steps that require
> > them.)  Am I missing a step?  I'm not going to be using proj often
> > enough to become an expert.
> Tom,
> I'm not sure where shpcs2cs comes from.  I presume this is a version
> of shpproj reimplemented to use the mechanisms of cs2cs?  I seem to
> recall someone having contributed that but I don't know the details.
> The conus.lla file is raw ascii grid shift file.  It isn't used directly.
> First it has to be processed into a binary grid shift file with the
> program.  I would guess it is being ignored.
> If you just want to convert shapefiles, I would suggest using the
> prepackaged OpenEV_FW 1.6.3 distribution which includes the ogr2ogr
> which can accomplish the same thing.  The distribution also includes the
> binary form of the grid shift files.
> OpenEV_FW 1.6.3 can be found at:
>    ftp://ftp.remotesensing.org/gdal/openev/OpenEV_FW_163.zip
> A command something like this would accomplish approximately what you were
> trying to do:
>    ogr2ogr AZ_GEOLll83.shp AZ_GEOL.shp \
>      -s_srs '+proj=lcc +datum=NAD27 +lon_0=-96 +lat_1=33 +lat_2=45
+lat_0=23 +x_0=5000000 +y_0=0' \
>      -t_srs '+proj=latlong +datum=NAD83'
> Of course it might be sufficient for you to run nad2bin on conus.lla to
> produce conus and then ensure that the PROJ_LIB environment variable
> to the directory with the conus file.
> Good luck,
> -- 
> ---------------------------------------+----------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
> ----------------------------------------
> PROJ.4 Discussion List
> See http://www.remotesensing.org/proj for subscription, unsubscription
> and other information.

PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.

More information about the Proj mailing list