Package Exports
- geo-converter-web
- geo-converter-web/server.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (geo-converter-web) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Geo Converter Web
Geo Converter Web is an Express-based server application that converts uploaded GeoJSON files into various GIS formats (e.g., PBF and KML).
Features
GeoJSON to PBF
Converts GeoJSON data to PBF format using geobuf and pbf.GeoJSON to KML
Converts GeoJSON data to KML format using tokml.Automatically generates the output filename based on the uploaded file's name, appending the appropriate file extension for download.
Installation
Make sure you have Node.js installed.
In the project root directory, install the dependencies by running:
npm installStarting the Server To start the server, run:
npm startBy default, the server listens on http://localhost:3065. You can change the port by setting the PORT environment variable. For example:
PORT=3055 npm startAPI Usage
POST /upload
Description: Upload a GeoJSON file and select the target conversion format. The server returns the converted file. Parameters:
- file: The GeoJSON file to be uploaded.
- format: The target conversion format. Supported values:
- pbf — Converts GeoJSON to PBF format.
- kml — Converts GeoJSON to KML format.
Upon a successful conversion, the response will include a header with the download filename (composed of the original file name and the corresponding extension), and the browser will automatically initiate the download.
License
MIT