https://github.com/mmintel/gatsby-transformer-reverse-geojson
Reverse geocodes frontmatter fields in GeoJSON format
https://github.com/mmintel/gatsby-transformer-reverse-geojson
gatsby-plugin gatsbyjs geocoder nodejs opencage
Last synced: 3 months ago
JSON representation
Reverse geocodes frontmatter fields in GeoJSON format
- Host: GitHub
- URL: https://github.com/mmintel/gatsby-transformer-reverse-geojson
- Owner: mmintel
- Created: 2020-02-09T11:29:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-09T11:34:54.000Z (over 5 years ago)
- Last Synced: 2025-02-04T12:03:17.528Z (4 months ago)
- Topics: gatsby-plugin, gatsbyjs, geocoder, nodejs, opencage
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gatsby-transformer-reverse-geojson
Reverse geocodes GeoJSON data.
---
Let's say you have this data in your frontmatter:
```
location: '{"type":"Point","coordinates":[7.1217982,50.9882845]}'
```
This transformer will find it, pass it to Opencage and create gatsby nodes containing the reverse geocoded response.You can query it like this as a child node:
```
childMarkdownRemark {
frontmatter {
location
}
childLocationGeo {
formatted
}
}
```or like this to retrieve all of them
```
allLocationGeo {
edges {
node {
formatted
}
}
}
```## Install
`yarn add gatsby-transformer-reverse-geojson`## How to use
Sign up for an [Opencage](https://opencagedata.com/) api key.
In your`gatsby-config.js` add:
```
{
resolve: 'gatsby-transformer-reverse-geojson',
options: {
apiKey: 'YOUR OPENCAGE API KEY'
}
}
```## Please note
Currently only supports the `type: "Point"` (default) widget. If you need more just let me know.