Skip to content

Add .prj file to new_known_crs doc #216

Open
@nk9

Description

@nk9

The docs for new() and new_known_crs() describe several different string formats accepted for creating a new projection pipeline. These are the options listed in new_known_crs():

  • an "AUTHORITY:CODE", like "EPSG:25832".
  • a PROJ string, like "+proj=longlat +datum=WGS84". When using that syntax, the unit is expected to be degrees.
  • the name of a CRS as found in the PROJ database, e.g "WGS84", "NAD27", etc.
  • more generally, any string accepted by new()

new() actually lists fewer options, and nothing beyond the bulleted list above.

I had a set of Shapefile files that I wanted to grab the projection from, but all I had was the .prj file. I didn't see that format listed in the docs, but I had nothing to lose so I tried just passing that to new_known_crs() and… it worked! For clarity, here's what my .prj looks like:

GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]

I think this is a pretty common thing that people would want to do. Just checking that this behavior is expected, and if you'd accept a PR to add this to the docs as another bullet point in new_known_crs().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions