PrjFile

class PrjFile(val text: String)

Projection (.prj) parser. Distinguishes geographic and projected coordinate systems via OGC well-known text. For projected systems we recognize the UTM family — the only projection commonly distributed with raw shapefiles — and expose a Projection that can convert easting/northing pairs into lon/lat. Other projected systems are flagged as projected-but-unsupported; callers can treat coordinates as geographic at their own risk.

Constructors

Link copied to clipboard
constructor(text: String)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed class Projection

Transform a shapefile X/Y pair into geographic longitude/latitude in degrees. The input pair is (easting, northing) for projected files and (longitude, latitude) for geographic files.

Properties

Link copied to clipboard

Coordinate transform implied by this .prj. Always non-null after construction: geographic systems get a Projection.Geographic that just normalizes lon/lat; UTM systems get a Projection.Utm; everything else gets Projection.Unknown that leaves coords untouched.

Link copied to clipboard
Link copied to clipboard

Hemisphere parsed from the WKT, or null if this PRJ isn't UTM.

Link copied to clipboard
val utmZone: Int?

UTM zone parsed from the WKT, or null if this PRJ isn't UTM.