Skip to content

NaturalEarthFeature is hard-coded to PlateCarree() #2289

@dopplershift

Description

@dopplershift

Currently the Feature class takes a crs argument at __init__ time; NaturalEarthFeature hard-codes this as PlateCarree(). This is generally fine, as it matches the Natural Earth data. It would be more flexible, though to pull this from the dataset if available, since shapefiles can optionally have a .prj file that contains the CRS in WKT format. We'd need to read that manually for pyshp, but Fiona makes this available as the .crs attribute on the base collection. I've confirmed that the Natural Earth data do include such .prj files.

This is relevant because downstream in MetPy we subclass Feature to provide US counties and states, (now) from the U.S. Census Bureau. These data are lat/lons defined on NAD83 (which uses GRS80) rather than WGS84. Not a huge difference, but always best to use what's in the data when available. The current API of Feature doesn't have a good way to set the correct feature at data load time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions