[Gdal-dev] cs2cs one liner???

Frank Warmerdam warmerdam at pobox.com
Tue Jan 3 17:31:40 EST 2006


On 1/3/06, Charlton Purvis <cplist at earthlink.net> wrote:
> Hi, folks:
>
> The following command works smashingly for me:
>
> cs2cs +init=epsg:2260 +to +proj=latlong
>
> What are my chances of taking that command and morphing it into a javascript
> function that has no real projection hooks other than whatever constants and
> math functions I could throw at it?  I have been poking around the web and
> have found some JS one liners, but they simply don't return the results I
> need for that given epsg.  I can't seem to locate the cs2cs source on my box
> -- doesn't is come w/ gdal? --, but if I were to look under the hood, would
> I find that a canned function for my particular source proj and dest proj
> would do the trick?

Charlton,

The cs2cs source is part of the PROJ.4 package.

The EPSG:2260 projection is transverse mercator:

 +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.999900
   +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83
   +to_meter=0.3048006096012192

You should be able to extract JavaScript code from the
"Community MapBuilder" project for the Transverse Mercator
projection.

  http://mapbuilder.sourceforge.net/

Mike Adair is the guru on the projections support in MapBuilder.

You could also try to build TM support in JavaScript yourself, but
I think it will be hard to do it based on the TM support in PROJ.4
which is somewhat "opaque" to casual browsing.

Best regards,
--
---------------------------------------+--------------------------------------
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




More information about the Gdal-dev mailing list