1

I have a lot of people supplying me ESRI ASC gridded data files that were generated using ESRI tools. When they do this, the PRJ files contain the following type of information. If differs depending on the projection of course, e.g. UTM, ALBERS etc..

Does GeoTools have a parser that can create a CoordinateReferenceSystem from this format of projection definition?

Projection    ALBERS
Datum         NAD83
Spheroid      GRS80
Units         METERS
Zunits        NO
Xshift        0.0
Yshift        0.0
Parameters
  29 30  0.0 /* 1st standard parallel
  45 30  0.0 /* 2nd standard parallel
 -96  0  0.0 /* central meridian
  23  0  0.0 /* latitude of projection's origin
0.0 /* false easting (meters)
0.0 /* false northing (meters)
Brian McCormick
  • 449
  • 4
  • 5

1 Answers1

0

Not directly, as that doesn't seem to be a standard (or ESRI variant) WKT projection file. But there is probably enough information in there to create a Coordinate Reference System as described here.

    MathTransformFactory mtFactory = ReferencingFactoryFinder.getMathTransformFactory(null);
    CRSFactory crsFactory = ReferencingFactoryFinder.getCRSFactory(null);

    GeographicCRS geoCRS = org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;
    CartesianCS cartCS = org.geotools.referencing.cs.DefaultCartesianCS.GENERIC_2D;

    ParameterValueGroup parameters = mtFactory.getDefaultParameters("Transverse_Mercator");
    parameters.parameter("central_meridian").setValue(-111.0);
    parameters.parameter("latitude_of_origin").setValue(0.0);
    parameters.parameter("scale_factor").setValue(0.9996);
    parameters.parameter("false_easting").setValue(500000.0);
    parameters.parameter("false_northing").setValue(0.0);
    Conversion conversion = new DefiningConversion("Transverse_Mercator", parameters);

    Map<String, ?> properties = Collections.singletonMap("name", "WGS 84 / UTM Zone 12N");
    ProjectedCRS projCRS = crsFactory.createProjectedCRS(properties, geoCRS, conversion, cartCS);
Ian Turton
  • 10,018
  • 1
  • 28
  • 47
  • Right. I knew I could that but there are so many variants between Albers, UTM, Lambert, the multitude of state plane systems etc. I was hoping, like the parsing of a standard WKT there would be routines that were already there since it seems like a lot of people could use them and not just me. – Brian McCormick May 20 '17 at 13:26
  • TBH I've never seen that format of projection before or even heard of ESRI inventing yet another way of writing that out. Dp you know which tool generated the file – Ian Turton May 20 '17 at 13:39