WMS server using node-mapnik

Related tags

Maps landspeed.js
Overview

landspeed.js

A simple WMS server written in node.js

Only supports WMS 1.1 GetMap requests (bbox, width, height, and srs).

Build Status Build Status

Requirements

Install

To install do:

git clone https://github.com/mapbox/landspeed.js.git
cd landspeed.js
npm install

Run

Usage:

./server.js <stylesheet.xml> <port> <concurrency>

Demo

OS X:

open demo/leaflet.html && ./server.js demo/world_latlon.xml

Linux:

xdg-open demo/leaflet.html && ./server.js demo/world_latlon.xml
Comments
  • srs representations and a small optimization

    srs representations and a small optimization

    For the style in this we moved to using the +init syntax to ensure that srs strings match exactly what is passed in from the url request.

    But, if we did the translation between +init=epsg:3857 and the exact mercator proj4 literal (that we choose to use in the style) in the server this would avoid proj4 (inside of mapnik's proj_transform) having to hit its /usr/share/proj/epsg file to get the proj4 definition. This lookup only should happen a couple of times max per request, so it may not be a measurable i/o burden, but could still be avoided as a small optimization.

    opened by springmeyer 4
  • node assertion - possible race condition

    node assertion - possible race condition

    After implementing polyline clipping, we've jumped another 10-15 r/s (on top of ~20 r/s jump from deferred label rendering).

    I assume that such high throughput is now triggering some race condition. Ultimately mapnik crashes, but it is in a different place each time so I think the problem is the initial node assertion, which is seen each time this happens (around ~150 r/s):

    
    node: ../src/node_object_wrap.h:105: static void node::ObjectWrap::WeakCallback(v8::Persistent<v8::Value>, void*): Assertion `value == obj->handle_' failed.
    *** glibc detected *** node: free(): invalid next size (fast): 0x00002aaab02728b0 ***
    ======= Backtrace: =========
    /lib64/libc.so.6[0x2acf0ba7d45f]
    /lib64/libc.so.6(cfree+0x4b)[0x2acf0ba7d8bb]
    /opt/mapnik/lib/libmapnik2.so.2.0(_ZN6mapnik12agg_rendererINS_8image_32EE7processERKNS_18polygon_symbolizerERKNS_7featureINS_8geometryINS_6vertexIdLi2EEENS_13vertex_vectorEEEN5boost10shared_ptrINS_6rasterEEEEERKNS_14proj_transformE+0xfc5)[0x2acf319307b5]
    
    opened by springmeyer 3
  • respond with 404/500 if map.load() fails

    respond with 404/500 if map.load() fails

    otherwise failures will look like really fast tile reponses when testing. This is imperitive because we're now seeing layer constructors throw when max_size is reached in the postgres pool

    opened by springmeyer 3
  • todo - diff from live server

    todo - diff from live server

    Just to document for now (no action needed):

    • request for seed went over size
    • gdal crashed with async map loading
    • 16 thread pool is what I've been using
    
    diff --git a/renderer.js b/renderer.js
    index 73c8b02..279be48 100644
    --- a/renderer.js
    +++ b/renderer.js
    @@ -5,7 +5,7 @@ var util = require('util');
     var Pool = require('./pool');
    
     // Increase number of threads to 1.5x the number of logical CPUs.
    -var threads = require('os').cpus().length + 4;
    +var threads = 16;//require('os').cpus().length + 4;
     console.warn('Using %d threads', threads);
     require('eio').setMinParallel(threads);
    
    @@ -19,7 +19,7 @@ module.exports = function(args) {
         var maps = new Pool(function() {
             var map = new mapnik.Map(256, 256);
             map.bufferSize = args.bufferSize;
    -        map.load(args.stylesheet, {
    +        /*map.load(args.stylesheet, {
                 strict: false,
                 base: path.dirname(args.stylesheet)
             }, function(err, map) {
    @@ -29,14 +29,20 @@ module.exports = function(args) {
                 util.print('\rCreating map objects (' + created + '/' + args.concurrency + ')...');
                 maps.release(map);
             });
    +        */
    +        map.loadSync(args.stylesheet);
    +        map.zoomAll();
    +        created++;
    +        util.print('\rCreating map objects (' + created + '/' + args.concurrency + ')...');
    +        maps.release(map);
         }, args.concurrency);
    
         return function(query, callback) {
             query.width = +query.width || 256;
             query.height = +query.height || 256;
    -        if (query.width < 1 || query.width > 2048 || query.height < 1 || query.height > 2048) {
    +        /*if (query.width < 1 || query.width > 2048 || query.height < 1 || query.height > 2048) {
                 return callback(new Error('Invalid size: ' + query.width + '×' + query.height));
    -        }
    +        }*/
    
             var bbox = query.bbox ? query.bbox.split(',') : [];
             if (bbox.length !== 4) return callback(new Error('Invalid bbox: ' + util.inspect(bbox)));
    
    opened by springmeyer 1
  • shapefiles

    shapefiles

    The mapserver mapfile I think uses some shapefiles in wgs84. Early on we discussed with the mapserver team about ensuring these would be in mercator for the main test, and then their will likely be a fully reprojected test (where map request will be in wgs84).

    So, just flagging an issue that we may need to change the style first thing next week when I can get more info on this.

    shapefiles should be from: http://mapserver-utils.googlecode.com/svn/branches/imposm-branch/data/

    opened by springmeyer 1
  • optimal deployment

    optimal deployment

    Nginx http round robin should be fastest in front of N node processes. Could also give cluster a look. Need to document as part of the project the optimal setup.

    opened by springmeyer 0
  • EPSG projection issue should be documented

    EPSG projection issue should be documented

    The test inmediately crashes with an EPSG projection error.

    Error: Projection error during map.zoom_all: failed to initialize projection with: '+init=epsg:4326'
    

    This is because (at least on Windows 10) mapnik cannot find the PROJ4 EPSG projections.

    In order to fix this, I downloaded proj446_win32_bin from the PROJ4 website, unpacked the zip file and copied the nad folder to my PC (actually, only the epsg file seems to be required). Furthermore, I had to `SET PROJ_LIB=C:\mapnik-v2.2.0\share\nad' before it worked.

    It would be appreciated if you could add these instructions to the documentation.

    opened by erikvullings 0
Owner
Dane Springmeyer
Dane Springmeyer
Serverless raster and vector map tile generation using Mapnik and AWS Lambda

tilegarden ??️ ?? Contents About Usage Deployment to AWS Additional Configuration Options Required AWS Permissions Features Configuration Selection an

Azavea 89 Dec 22, 2022
Lightweight Node.js isochrone map server

Galton Lightweight Node.js isochrone server. Build isochrones using OSRM, Turf and concaveman. Francis Galton is the author of the first known isochro

Urbica 266 Dec 17, 2022
A pluggable Node.js map tile server.

TileStrata TileStrata is a pluggable "slippy map" tile server that emphasizes code-as-configuration. The primary goal is painless extendability. It's

Natural Atlas 409 Dec 30, 2022
Utility to warm up your tile server cache

TileMantle A tool to warm up your tile server cache. Give it a URL template, geometry, and list of zoom levels and it will request tiles incrementally

Natural Atlas 34 Sep 12, 2022
geotiff.js is a small library to parse TIFF files for visualization or analysis. It is written in pure JavaScript, and is usable in both the browser and node.js applications.

geotiff.js Read (geospatial) metadata and raw array data from a wide variety of different (Geo)TIFF files types. Features Currently available function

geotiff.js 649 Dec 21, 2022
Node.js REST API for PostGres Spatial Entities. AKA: SpatialServer

PGRestAPI (a.k.a. Chubbs Spatial Server) Overview Node.js REST API for PostgreSQL Spatial Tables. An introduction to PGRestAPI can be found here A few

SpatialDev 429 Dec 9, 2022
A very fast geospatial point clustering library for browsers and Node.

supercluster A very fast JavaScript library for geospatial point clustering for browsers and Node. <script src="https://unpkg.com/[email protected]/d

Mapbox 1.6k Jan 7, 2023
Asynchronous, non-blocking SQLite3 bindings for Node.js

Asynchronous, non-blocking SQLite3 bindings for Node.js. Supported platforms The sqlite3 module works with: Node.js v11.x, v12.x, v13.x and v14.x. Ele

Mapbox 5.6k Jan 4, 2023
A Node.js map tile library for PostGIS and torque.js, with CartoCSS styling

Windshaft A Node.js map tile library for PostGIS and torque.js, with CartoCSS styling. Can render arbitrary SQL queries Generates image and UTFGrid in

CARTO 306 Dec 22, 2022
A web based data mining tool for OpenStreetMap using the Overpass API.

overpass turbo https://overpass-turbo.eu/ – stable version https://tyrasd.github.io/overpass-turbo/ – latest version This is a GUI for testing and dev

Martin Raifer 607 Dec 29, 2022
3D web map rendering engine written in TypeScript using three.js

3D web map rendering engine written in TypeScript using three.js

HERE Technologies 1.2k Dec 30, 2022
MERN stack travel app using mapbox API, Travel and drop pin , share reviews and rate the location

MERN-Travel-Map Travel Map Pin A single page application built with MERN Stack from scratch (MongoDB + Mongoose, Express, React & NodeJs) Table of Con

Bùi Quốc Trọng 11 Dec 29, 2022
This is the leaflet plugin for GeoServer. Using this plugin user can have access to wms and wfs request easily.

Documentation leaflet-geoserver-request This is the plugin for Geoserver various kind of requests. Using this plugin, we can make WMS, WFS, getLegendG

Tek Kshetri 127 Dec 15, 2022
Serverless raster and vector map tile generation using Mapnik and AWS Lambda

tilegarden ??️ ?? Contents About Usage Deployment to AWS Additional Configuration Options Required AWS Permissions Features Configuration Selection an

Azavea 89 Dec 22, 2022
Monolithic repo for api server, image server, web server

Onsecondary Market Deployed at https://market.onsecondary.com Monolithic repo for api server, image server, web server TODO -use a script to cull expi

Admazzola 2 Jan 11, 2022
Async node.js implementation of the UDP Minecraft Server Query Protocol and TCP Minecraft Server List Ping Protocol

?? Mc Server Status Async node.js implementation of the UDP Minecraft Server Query Protocol and TCP Minecraft Server List Ping Protocol. Also availabl

Daniel 5 Nov 10, 2022
Deploying Fake Back-End Server & DataBase Using JSON-SERVER, GitHub, and Heroku

Deploying Fake Back-End Server & DataBase Using JSON-SERVER, GitHub, and Heroku. In this article, we will create and host a fake server that we can de

Israel David 0 Sep 5, 2022
A back-end server aplication created using node.js, express and mongodb.

Course Material and FAQ for my Complete Node.js, Express and MongoDB Bootcamp This repo contains starter files and the finished project files for all

Pablo César Jiménez villeda 1 Jan 4, 2022
Sse-example - SSE (server-sent events) example using Node.js

sse-example SSE (server-sent events) example using Node.js SSE is a easy way to commutate with the client side in a single direction. it has loss cost

Jack 2 Mar 11, 2022
Keep track of book descriptions on the server-side using MongoDB, Express, and Node.js.

Backend Application A database model/backend for a user directory using Javascript MongoDB, Express, and Node.js. In summary, a backend CRUD model to

Rodrigo Bravo 3 Apr 10, 2022