GeoJSON#
MapJS uses a GeoJSON formatted file for both nest polygons and scan areas. While both of these features are optional the placeholder json files must exist.
Nests#
This is generated via the external PMSFnestScript project and support is
given via the PMSF Discord. Once the script is ran move the nest.json
file to /path/to/MapJS/static/custom/nests.json
.
Scan Area#
This areas.json
file is used to show city/region boundaries on the map. You can
generate it yourself via multiple free online websites, a few are listed below:
- geojson.io
- geoman.io
- RDM Tools (self hosted)
Convert INI to GeoJSON#
To easily convert INI sytle geofence format files to GeoJSON format you can use the
following method. This is mainly used for the areas.json
file to show scan areas.
- Create
geofences
directory in root of project (with src folder) - Copy your
.txt
INI format geofence files to thegeofences
folder - Run
npm run convert -- ./geofences/
which will convert your INI geofences to oneareas.json
GeoJSON format file in the root of the project - Copy
areas.json
to/path/to/MapJS/static/custom/areas.json
to show the scan areas on the map
Convert Porcale geofence to GeoJSON#
To easily convert from PoracleJS geofence formated file into GeoJSON run the method.
This is mainly used for the areas.json
file to show scan areas.
- Copy your
geofence.json
file from Poracle to the root of the project folder (with src folder) - Run
npm run convert-poracle -- geofence.json
which will convert the file to anareas.json
GeoJSON format file in the root of the project folder - Copy
areas.json
to/path/to/MapJS/static/custom/areas.json
to show the scan areas on the map