[R-sig-Geo] projection metadata

Michael Sumner mdsumner at utas.edu.au
Thu Apr 13 09:19:29 CEST 2006


Hello, I'm looking for advice on parsing XML metadata and mapping 
projection tags to PROJ.4 strings.

Manifold GIS provides auxiliary .xml files with every export of 
drawings, images, surfaces or labels and
this is as robust as GeoTIFF headers and can be used to override the 
limitations of shapefiles, png images
etc. that don't store projection metadata completely if at all.

I have a function that writes the xml for a Manifold surface when I 
export an R xyz image to raw binary, it's totally ad hoc
and just explicitly writes out the text lines - but it works well for 
transferring my (usually latlon) data
back and forth.

I'd like to generalize this by mapping the XML tags to PROJ.4 arguments. 

I've made some limited explorations using the XML package to parse the 
xml and modify tags, but
I'm trying to capture two data models (the xml and PROJ.4) at once and 
it's beyond me.

A shorter version of my query might be: is there a DTD or schema for 
PROJ.4 arguments, and can anyone point
me to examples of mapping other schemes to PROJ.4?  ( I imagine that the 
GDAL code for GeoTIFF headers is
likely good place.Any pointers would be appreciated. )  It will be 
simple enough to create or obtain a
DTD for the Manifold XML.

Cheers, Mike.

Here's an example of an XML file:

<?xml version="1.0" encoding="UTF-8"?>
<preset>
    <name>Lambert Azimuthal Equal Area</name>
    <datum>World Geodetic 1984 (WGS84)</datum>
    <system>Lambert Azimuthal Equal Area</system>
    <unit>Meter</unit>
    <majorAxis>6.378137000000000000000000e+006</majorAxis>
    <eccentricity>8.181919084262148600000000e-002</eccentricity>
    <centerX>0.000000000000000000000000e+000</centerX>
    <centerY>0.000000000000000000000000e+000</centerY>
    <centerZ>0.000000000000000000000000e+000</centerZ>
    <rotationX>0.000000000000000000000000e+000</rotationX>
    <rotationY>0.000000000000000000000000e+000</rotationY>
    <rotationZ>0.000000000000000000000000e+000</rotationZ>
    <scaleX>1.000000000000000000000000e+000</scaleX>
    <localScaleX>1.000000000000000000000000e+000</localScaleX>
    <scaleY>1.000000000000000000000000e+000</scaleY>
    <localScaleY>1.000000000000000000000000e+000</localScaleY>
    <falseEasting>0.000000000000000000000000e+000</falseEasting>
    <localOffsetX>0.000000000000000000000000e+000</localOffsetX>
    <falseNorthing>0.000000000000000000000000e+000</falseNorthing>
    <localOffsetY>0.000000000000000000000000e+000</localOffsetY>
    <centerLat>-4.200000000000000000000000e+001</centerLat>
    <centerLon>1.500000000000000000000000e+002</centerLon>
</preset>




More information about the R-sig-Geo mailing list