Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

= Make setup more clear #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@ If you are not sure what appropriate values are, have a look [here](http://www.m

Besides publishing the GeoJSON tiles, you can also retrieve the protobuf encoded vector tiles by replacing the `geojson` extension with `mvt`, e.g. [http://localhost:8123/layer1/z/x/y.mvt](http://localhost:8123/layer1/z/x/y.mvt).

## Installation
## Getting started

Either run it standalone, or get the source.
1. Install the server `npm i -g geojson-tile-server`

### Standalone
2. Run `geojson-tile-server`

```console
npm i -g geojson-tile-server
```
(By default it serves the './data' folder with the GeoJSON files, and the `./public` folder for static files.)

Optionally, you can specify the PORT (default `8123`), DATA (default `./data`), and PUBLIC_FOLDER (default `./public`) folder in your environment, in which case those values will be used instead.

3. Open http://localhost:8123/ to see which layers are available to you.

### Source
(Final url will be like `http://localhost:8123/your_layer_name/z/x/y.geojson`)

## Contribute / Development

The following commands will download, install & run the source:

```bash
git clone https://github.com/TNOCS/geojson-tile-server.git
Expand All @@ -33,18 +39,6 @@ The source contains a small dataset containing some building contours in Amersfo
- [VT example](http://localhost:8123/Amersfoort.min/15/16876/10800.vt)
- [MVT playground on flems.io](https://flems.io/#0=N4IgzgpgNhDGAuEAmIBcIB0ALeBbKIANCAGYCWMYaA2qAHYCGuEamO+RIsA9nYn6wA8AQgAiAeQDCAFQCaABQCiAAnZQAfAB06gtVrrLluiAyT7Dhwc3gNlsLAwBOkeAF5NIAK7wSAWgAcHsoA9OYWgvBk8DDqAIJISMq28FhkjokADk7wAJ7KA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jFd3-BheixUWXLoNW+E15DDPlvtGVgD5N3tBpJ30Ec8A0bROEgGBnN4Kh0DWfxUE0kBdvoJgWHQWkqGIDCJngVgw8ICPmFYLVY64dWE6T6MdOjIA): You need to insert your own [Mapbox GL access key](https://account.mapbox.com) in order to make this work.

## Usage

To start the development service, run:

```bash
npm start
```

Or if you've installed it globally, run `geojson-tile-server`, which by default serves the './data' folder with the GeoJSON files, and the `./public` folder with static files.

Optionally, you can specify the PORT (default `8123`), DATA (default `./data`), and PUBLIC_FOLDER (default `./public`) folder in your environment, in which case those values will be used instead.

## Note

For another example of a Mapbox-based service, see [here](http://bl.ocks.org/jgravois/51e2b30e3d6cf6c00f06b263a29108a2).