Re: NPS shapefile

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Fri Dec 21 2012 - 15:01:46 MST

Hi Michael,

I'm unaware of a means to perform the deprojection from UTM into geographic coordinates from within NCL. The GDAL utilities gdalwarp/gdal_translate may be able to deproject the whole shapefile, depending upon how they were built for your system:

gdal.org

If you have the .prj file associated with your shapefile, that command would look something like:

gdalwarp -t_srs epsg:4236 park_boundary.shp park_boundary_LL.shp

Depending on what you want to do with the lat/lons, the proj4 library has a utility that can project/reproject a file of X/Y pairs into a different coordinate system:

proj.osgeo.org

On Dec 21, 2012, at 2:32 PM, Michael Notaro <mnotaro@wisc.edu> wrote:

> How do I retrieve the actual latitudes and longitudes on a National Park Service shapefile?
>
> The shapefile contains x and y, which gives the leftbc, rightbc, bottombc, and topbc but not
> the actual latitudes/longitudes.
>
> Below I include a segment from my NCL script, a dump of the shapefile, and internet links
> with sites to download the shapefile and get into on its dimensions/projection (Universal Transverse Mercator).
>
> Thanks,
> Michael
>
>
> ----------------------------------------
>
> Where to download info on the shapefile:
> http://pubs.usgs.gov/of/2005/1225/Shapefiles/park_boundary.shp.xml
>
> Where to download the shapefile:
> http://pubs.usgs.gov/of/2005/1225/Shapefiles/
>
> ----------------------------------------
>
> NCL CODE SEGMENT:
> f=addfile("park_boundary.shp","r")
> segments = f->segments
> geometry = f->geometry
> segsDims = dimsizes(segments)
> geomDims = dimsizes(geometry)
> geom_segIndex = f@geom_segIndex
> geom_numSegs = f@geom_numSegs
> segs_xyzIndex = f@segs_xyzIndex
> segs_numPnts = f@segs_numPnts
> lines = new(segsDims(0),graphic)
> numFeatures = geomDims(0)
> lon = f->x
> lat = f->y
>
> ------------------------------------------------
>
> FILE DUMP:
> Variable: f
> Type: file
> filename: park_boundary
> path: park_boundary.shp
> file global attributes:
> layer_name : park_boundary
> geometry_type : polygon
> geom_segIndex : 0
> geom_numSegs : 1
> segs_xyzIndex : 0
> segs_numPnts : 1
> dimensions:
> geometry = 2
> segments = 2
> num_features = 1 // unlimited
> num_segments = 1
> num_points = 2860
> variables:
> integer geometry ( num_features, geometry )
> integer segments ( num_segments, segments )
> double x ( num_points )
> double y ( num_points )
> integer OBJECTID ( num_features )
> double AREA ( num_features )
> double PERIMETER ( num_features )
> integer PARKBNDARY ( num_features )
> integer PARKBNDA_1 ( num_features )
> string ROCKTYPE ( num_features )
> double Shape_Leng ( num_features )
> double Shape_Area ( num_features )
>
> ------------------------------------------------------
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Dec 21 15:01:56 2012

This archive was generated by hypermail 2.1.8 : Fri Jan 04 2013 - 15:32:29 MST