https://github.com/shimisnow/geojson-generator
This repository shows how to process geographic coordinates and draw them as areas
https://github.com/shimisnow/geojson-generator
docker geojson shell-script typescript
Last synced: about 2 months ago
JSON representation
This repository shows how to process geographic coordinates and draw them as areas
- Host: GitHub
- URL: https://github.com/shimisnow/geojson-generator
- Owner: shimisnow
- Created: 2023-12-10T16:52:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-11T16:59:16.000Z (over 1 year ago)
- Last Synced: 2025-01-24T11:23:49.570Z (3 months ago)
- Topics: docker, geojson, shell-script, typescript
- Language: TypeScript
- Homepage:
- Size: 3.67 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Build
Run the commands to install the dependencies and build the project
```sh
npm install
npm run compile
```## Examples
The file `examples.js` generates one file to each type of polygon area supported by the project
```sh
node ./build/examples.js
```The GeoJSON files can be found at the `output` folder
To see the files in a map at the browser, run the command:
```sh
docker compose up geojson-viewer
```A list of links will be shown at the terminal. Each link opens a page with the polygon over the map
```sh
| Access the files at the address:
| --> http://localhost:8099/#data=data:text/x-url,/geojson-data/geojson-circular.geojson.json
| --> http://localhost:8099/#data=data:text/x-url,/geojson-data/geojson-hexagonal.geojson.json
| --> http://localhost:8099/#data=data:text/x-url,/geojson-data/geojson-pentagonal.geojson.json
| --> http://localhost:8099/#data=data:text/x-url,/geojson-data/geojson-square.geojson.json
| --> http://localhost:8099/#data=data:text/x-url,/geojson-data/geojson-triangular.geojson.json
|
| Live server started
```## Documentation
### Circular area
```ts
const CA = new CircularArea(
{latitude: -22.952125, longitude: -43.210516},
1000
);const geoJSON = CA.getGeoJSON();
```
### Triangular area
```ts
const TA = new TriangularArea(
{latitude: -22.952125, longitude: -43.210516},
1000
);const geoJSON = TA.getGeoJSON();
```
### Square area
```ts
const SA = new SquareArea(
{latitude: -22.952125, longitude: -43.210516},
1000
);const geoJSON = SA.getGeoJSON();
```
### Pentagonal area
```ts
const PA = new PentagonalArea(
{latitude: -22.952125, longitude: -43.210516},
1000
);const geoJSON = PA.getGeoJSON();
```
### Hexagonal area
```ts
const HA = new HexagonalArea(
{latitude: -22.952125, longitude: -43.210516},
1000
);const geoJSON = HA.getGeoJSON();
```