Skip to content

DrPollo/tiles

Repository files navigation

FirstLife Tileserver

V1.0 of FirstLife tile server

To install tileserver

npm install

To create/regenerate tileserver

gulp build

To test tileserver

node server.js
http://localhost:3095/explore

How to add a new zone

  1. Create a new directory for the new zone in ../tileserver/geojson whit the source data files (eg. geojson from osm)

  2. Add the new path/files to load in the gulpfile.js task 'load_source_geojson' :

    gulp.task('load_source_geojson',function () {
    ...
    ...
    // carico i file osm di Southwark
    try {
        var southwark_dir = geojsonpath + "/southwark_osm_geojson/"
        var southwark_files = fs.readdirSync(southwark_dir);
    } catch (err) {
        console.error('directory read error ', err);
        throw new gutil.PluginError({
            plugin: 'readdireSync',
            message: geojsonpath+" directory read error"
        });
    }
    console.log('files to read: ',southwark_files.length);
    ...
    ...
    ...
    case "Southwark":
    	// ciclo i file di Southwark
    	if(southwark_files.includes(file_name)){
    	    try{
    	        // carico e parsifico il file
    	        var ft_col = fse.readJsonSync(southwark_dir+file_name);
    	        var features = ft_col.features;
    	        var ok = true;
    	    }catch (err){
    	        console.error('error ',err,' loading ',southwark_dir+file_name);
    	    }
    	}
    	break;
    
  3. Add the new files for the generation of the tiles in the config_file.json :

      "Southwark": {
        "tile_minzoom": 13,
        "tile_maxzoom": 20,
        "files": [{
            "name": "southwark_admin.geojson",
            "minzoom": 13,
            "maxzoom": 16,
            "layer": "comune",
            "z_index": 5
          },
          {
            "name": "southwark_buildings.geojson",
            "minzoom": 17,
            "maxzoom": 20,
            "layer": "building",
            "z_index": 10
          },
          ...
    
  4. Regenerate tileserver

    gulp build
    

To test tileserver APIs :

How to verify/correct a new file source for the zone:

NOTE :

  • The accuracy of the zoom levels for tile generation in config_file.json is NOT standard but empirical. When adding a new area, you must visually check the correct setting.
  • Be careful about using exact layer names.

Licensing

Author: Stefania Buccoliero

Author: Alessio Antonini

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published