Class ShapefileCrsValidator

java.lang.Object
edu.cnu.mdi.mapping.shapefile.ShapefileCrsValidator

public final class ShapefileCrsValidator extends Object
Validates that shapefile coordinates can safely be interpreted as WGS84 longitude and latitude in decimal degrees.

MDI intentionally does not provide general coordinate-reference-system transformations. If a companion .prj file is present, this class therefore accepts WGS84 geographic coordinates and unprojected NAD83/GRS80 geographic coordinates with degree angular units. NAD83 coordinates are treated as WGS84 without a datum transformation; their metre-scale difference is negligible for MDI's map-display use cases. Projected, malformed, older North American datums, and unrecognized definitions are rejected before coordinates can be mistaken for longitude and latitude.

A missing .prj remains permitted for compatibility with existing shapefile sets. In that case the caller is explicitly relying on MDI's documented WGS84 longitude/latitude assumption.

  • Method Details

    • validate

      public static void validate(Path shpPath) throws IOException
      Validates the companion projection file for a shapefile, if present.
      Parameters:
      shpPath - path to the .shp file
      Throws:
      IOException - if the projection file cannot be read or does not describe a supported WGS84 or NAD83 geographic CRS in degrees