comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » shapefile not in lat/lon
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: shapefile not in lat/lon [message #86697 is a reply to message #86696] Thu, 28 November 2013 08:22 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> I have a set of shapefiles defining some regions but the content is not in lat/lon coordinates. I guess I should use the projection defined in the prj file but I don't exactly know how to do it.
> I am hoping for some help here.
>
> This is the content of the prj file:
> PROJCS["NAD_1983_MTM_8",GEOGCS["GCS_North_American_1983",DATUM[ "D_North_American_1983", SPHEROID["GRS_1980",6378137.0,298.257222101]], PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION[ "Transverse_Mercator"], PARAMETER["False_Easting",304800.0],PARAMETER["False_Northing ",0.0], PARAMETER["Central_Meridian",-73.5],PARAMETER["Scale_Factor ",0.9999], PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]
>
> Using this information how could I get the lat/lon values of the area defined as:
>
> xx=[314000.00,314000.00,315000.00,315000.00,314000.00]
> yy=[4987000.0,4988000.0,4988000.0,4987000.0,4987000.0]

I would set it up like this:

map = cgMap('UTM', Ellipsoid='GRS 1980', CENTER_LONGITUDE=-73.5, $
CENTER_LATITUDE=0, FALSE_EASTING=304800.0)

lonlat = map -> Inverse(xx, yy)
lon = Reform(lonlat[0,*])
lat = Reform(lonlat[1,*])

If you use the Shapefile tools in the Coyote Library it won't matter
much whether your shapefile uses lat/lon values or projected meter
values, as this one does.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Simpler Raster Output
Next Topic: Errorbar plot with max-min boundaries and bar plot with !P.Multi

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:21:28 PDT 2025

Total time taken to generate the page: 1.36023 seconds