npm install @planet/places
Get a list of places that match the given query string. Returns a list of objects sorted by quality. Each place has an
name property. For states and regions, the
admin property gives the country name.
Get a place given a Wikidata identifier.
Fetch a GeoJSON feature representing the place. Returns a promise that resolves to feature. The
id should come from a place result returned from the
Set the URL root for fetching places. By default,
places.fetch() will fetch features using the URL root
https://places.planet.com/v0/. To work with data hosted at a different location, call
places.setUrl(root) with the URL root of the alternative location.
To download and prepare the data:
To simplify the data and create the lookup:
- Only features that have a common identifier are extracted from the original Natural Earth dataset. See the
bin/explodescript for the code that tries to find a common identifier.
- Not all features are augmented with a Wikidata identifier (the
bin/augmentscript tries to assign these).
- Not all geometries can be simplified below the set threshold (see