Open Source Map Builder Platform
Node Map Server is a map server template that could help you to build robust and customize map service quickly with Ginkgoch Map Library which is written in Node.js with full functional features for crafting mapping software.
This is a project template with RESTful APIs as:
- Load a data as a source on a map
- Read all features from a specific GIS data
- Read all features as a table from a specific GIS data
- Spatial query on a data source including intersection, etc.
- Customize the themes of a source
- Basic for area, line, POI and labels
- Advanced themes for value based styling
- Map object serialize/de-serialize into a JSON string for storage
- A XYZ server is built-in with your own data source and customized themes.
- More… (a complete API document is WIP)
# clone the repo
We provide the docker images on docker hub for OPs team. Developers can also use it to quickly run this service quickly.
- Docker compose
Docker compose is the easiest way to launch this server as well as a UI interface.
curl -o docker-compose.yml https://gist.github.com/ginkgoch/5b3bc8c9e081a9389d78daa2ba4622b0/raw/fc6a5985ea83b127f093d91b8ab4df8cebc14ebf/map-server-docker-compose.yml && docker-compose up
Once it launches, type
http://localhost:8080 in browser to try this demo.
docker run --name map-server -p 3000:3000 -d ginkgoch/map-server
docker run --name map-server -p 3000:3000 -v "/Users/ginkgoch/Downloads/Africa_SHP/:/root/map-server/data/" -d ginkgoch/map-server
When you ask this question, I assume that you already have the experience to build mapping software on browser with
Google Map or
Leaflet etc. This might satisfy your requirement already. But when you have your own GIS data locally (e.g. SHP file, Postgre or even CSV) that contains more precise vectors, or more properties on the records, or want to do spatial analysis on a region (e.g. find some records with some special condition in a random drawn area), it might be a headache to implement with pure client map library. Because the 3rd party client map library only provides restricted predefined query functions, styles etc. functions. In this case, setup a custom map server is a good choice and become a solution to extend the functionalities for your existing mapping software. With your own server, you can still work with the 3rd party client map library for better UX.
In the GIS region, we know there are many famous client MAP libraries like
It is well-known that NodeJS runs in
single thread and
event-loop. I used to use many other GIS component with
JAVA, it has a bad experience to build high performance service. We need to consider the mutex lock on resource reading/appending in multi-thread.
With NodeJS’ single thread mode, you don’t need to consider the thread safe issue; instead, we can focus more on the concrete business of your application.
Technically, NodeJS runs with V8 engine with single thread and I/O non-blocking mode, it seems has worse performance than the other techs, such as JAVA. But in the real world with high CPU performance, the gap becomes less and less.
It really depends on the scenario of your application. For example:
- For CPU-intensive calculating, like huge amount number calculation, zero I/O processing, definitely,
C#will be a best choice.
- For IO-intensive process, like reading/writing files, NodeJS will be 3.4X better performance. (https://github.com/johnrjenson/JavaVsNode)
I don’t think the application is a pure I/O or CPU intensive application, but for the balanced workload application, I would say the performance will be about the same.
One more thing I think the worst thing for node.js is the memory restriction (e.g. 1G in 64-bit system). We need to either reduce the memory usage or manually expand the memory.
Ginkgoch provides a Node.js map library for building cross platform mapping software. (PS. it is now supported website, web services, desktop; and mobile is in my backlog).