blob: 8be8c996b665e9e9c332be1c09b2720269440cde [file] [log] [blame]
{"/_app":{"title":" App","data":{"":""}},"/community/mailing-lists":{"title":"Mailing Lists","data":{"":"The following mailing lists are available for users of Apache Baremaps:\ndev@baremaps.apache.org is for people who want to contribute code to Baremaps."}},"/community/project-members":{"title":"Project Members","data":{"":"This page lists all the members of the project."}},"/documentation/developer-manual":{"title":"Developer Manual","data":{"":"The Developer Manual aims at helping developers to execute the code, understand the structure and contribute to the project.Go into the relevant sections to find out more about Apache Baremaps.\nProject structure\nHow to build with Maven\nSet up in IntelliJ IDEA\nGeocoder\nIP to location\nStylesheet"}},"/documentation/developer-manual/basemap":{"title":"Basemap","data":{"":"Baremaps comes with a\ndefault tileset and stylesheet\nthat can be used to generate vector tiles. The stylesheet is based on the\nOpenStreetMap Carto\nstyle.\nIt is an ongoing effort to create an attribution-free map style.\nYour contributions are welcome.","build-the-basemap#Build the basemap":"In order to build the basemap locally, move to the /basemap directory and run the following workflow:\nbaremaps workflow execute --file=workflow.js\n\nNote: If you are using Docker, you need to increase the storage allocated to Docker to at least 20GB.\nDepending on your machine and internet connection, the process can take up to 30 minutes."}},"/documentation/developer-manual/geocoder":{"title":"Geocoder","data":{"":"TODO"}},"/documentation/developer-manual/how-to-build-with-maven":{"title":"How to Build with Maven","data":{"":"This guide describes the basics of compiling Baremaps from source. In order to run Apache Baremaps, you first need to install Java 17 or a later version.\nSDKMAN provides a convenient Command Line Interface (CLI) to install and upgrade Java. We also suggest you use the most recent version of Maven\nto compile (at least 3.x.x).","linux-or-osx#Linux or OSX":"To start you can run the command ./mvnw clean package -DskipTests from the root folder of the Baremaps project. Upon successful\ncompilation you should see something similar to the following output in your terminal.\n[INFO] Building tar: /path-to-project/baremaps-cli/target/apache-baremaps-<version>-SNAPSHOT-incubating-bin.tar.gz\n[INFO] ------------------------------------------------------------------------\n[INFO] Reactor Summary for baremaps <version>-SNAPSHOT:\n[INFO]\n[INFO] baremaps ........................................... SUCCESS [ 4.172 s]\n[INFO] baremaps-core ...................................... SUCCESS [ 59.018 s]\n[INFO] baremaps-benchmark ................................. SUCCESS [ 1.775 s]\n[INFO] baremaps-ogcapi .................................... SUCCESS [ 9.796 s]\n[INFO] baremaps-server .................................... SUCCESS [ 0.787 s]\n[INFO] baremaps-cli ....................................... SUCCESS [ 20.687 s]\n[INFO] ------------------------------------------------------------------------\nIt is important to note the first line in the output above that notes where the location of the baremaps-cli binary file resides.\nReferencing the location of the baremaps-cli binary file, you can run the following to untar\nand place Baremaps into your PATH.\ntar -xvf ./baremaps-cli/target/apache-baremaps-<version>-SNAPSHOT-incubating-bin.tar.gz -C target/\nexport PATH=$PATH:`pwd`/target/apache-baremaps-<version>-SNAPSHOT-incubating-bin/bin\n\nNote: Make sure to replace the version number in the above commands with the version number of the release you are using.\nExecuting the baremaps command should now result in an output similar to the following:\nUsage: baremaps [-V] [COMMAND]\nA toolkit for producing vector tiles.\n-V, --version Print version info.\nCommands:\nworkflow Manage a workflow.\ndatabase Database commands.\nmap Map commands.\ngeocoder Geocoder commands (experimental).\niploc IP to location commands (experimental).\nogcapi OGC API server (experimental).\nFrom here, head into Installing PostGIS if you plan to work with vector tiles.If you want to work on Geocoding or\nIP to location, head directly into the related examples.","windows#Windows":"If you are using Windows, you will need to use mvnw.cmd instead of ./mvnw and use set instead of export to set the environment variable.","important#Important":"If your build is taking a long time, it might be due to the presence of large data/map files. To identify then delete them run:\ngit clean -dnx\ncd examples/\ngit clean -dfx"}},"/documentation/developer-manual/ip-to-location":{"title":"IP to location","data":{"":"Using data publicly available from the 5 Regional Internet Registries (RIRs)\nwe are able to generate a stream of objects detailing Internet resource allocations. We call these NIC Objects\n(Network Information Centre Objects).Here is the list of the 5 RIRs.\nARIN\nLACNIC\nAFRINIC\nRIPE NCC\nAPNIC\n\nUsing the list of NIC objects, we extract those that concern IPv4 address ranges (INETNUM)\n, then using the Baremaps Geocoder API, we iterate through the extracted NIC objects to geo-locate each one of them.The resulting geo-localised IPv4 address ranges are stored in a SQLite database which can be easily queried to geo-locate a specific IP.A NIC object contains a list of attributes but these attributes are not consistent between each NIC object.\nWe try to use these 4 attributes to query the Geocoder service :\naddress contains the address of the NIC Object\ndescr sometimes contains the address of the NIC Object\ncountry contains the country code in ISO format (ISO 3166) - RIPE list of country codes\ngeoloc contains the latitude and longitude which can be used directly\n\nSome NIC Objects contain a reference to an organisation, and the organisation's NIC Object itself contains the\ngeo-localisation information. However, we don't make use of that for now.The structure of the RIPE database\nshould be applicable to all the RIRs.","generating-the-ip-to-location-database#Generating the IP to location database":"A workflow is a directed acyclic graph of steps executed by Baremaps. To download and import the sample OSM data in Postgres, execute the following workflow.\nbaremaps workflow execute --file examples/ip-to-location/workflow.js\nDepending on the size of the OpenStreetMap file, the execution of this command may take some time.\nEventually, the output produced by the command should look as follows.\n[INFO ] 2022-12-08 12:56:05.417 [main] Execute - Executing the workflow examples/ip-to-location/workflow.js\n[INFO ] 2022-12-08 12:56:06.031 [pool-2-thread-1] DownloadUrl - Downloading https://ftp.ripe.net/ripe/dbase/ripe.db.gz to downloads/ripe.db.gz\n[INFO ] 2022-12-08 12:56:06.031 [pool-2-thread-2] DownloadUrl - Downloading https://download.geonames.org/export/dump/allCountries.zip to downloads/geonames-allcountries.zip\n...\n...\n...\n[INFO ] 2022-07-26 09:48:21.368 [main] Workflow - Finished executing workflow examples/ip-to-location/workflow.js\n\niploc serve --database iploc.db --port 3000","code-usage#Code usage":"In order to generate the SQLite database that contains the geo-localised IP address ranges you must follow a few steps.\nFirst you need to load/build a Geocoder which will be used to query the addresses contained in the NIC objects.\n\n\nGeocoder geocoder = new GeonamesGeocoder(indexPath, dataUri);\ngeocoder.build();\n\nThen you need to generate a Stream of NIC Objects. You can use the Nic Fetcher to automatically download all of the NIC Objects from the 5 RIRs.\n\n\nStream<Path> nicPathsStream = new NicFetcher().fetch();\nStream<NicObject> nicObjectStream =\nnicPathsStream.flatMap(nicPath -> {\ntry {\nreturn NicParser.parse(new BufferedInputStream(Files.newInputStream(nicPath)));\n} catch (IOException e) {\ne.printStackTrace();\n}\nreturn Stream.empty();\n});\n\nYou need to create the IpLoc service, giving the target SQLite database url and the geocoder in the second parameter\n\n\nSqliteUtils.executeResource(databaseUrl, \"iploc_init.sql\"); // Init the SQLite database\nIpLoc ipLoc = new IpLoc(databaseUrl, geocoder);\n\nFinally insert the stream of NIC objects in the database with the IpLoc service\n\n\nipLoc.insertNicObjects(nicObjects.stream());","notes#Notes":"There are many improvements that need to be worked on to improve the Iploc module, refer to the Github issues with the\ntag iploc if you want to contribute.","references#References":"https://www.iana.org/numbers\nhttps://www.irr.net/docs/list.html"}},"/documentation/developer-manual/layer-simplification":{"title":"Layer Simplification","data":{"":"In order to optimize the size of tiles at each zoom level, simplifications are made onto the vector layers. It is usually setup in two files:\nprepare.sql contains the SQL queries to simplify the data\nsimplify.sql contains the SQL queries for creating the materialized views for each zoom level","example-landuse#Example: Landuse":"st_buffer is used to simplify the geometries. The different buffer sizes are defined in the prepare.sql file.The following example shows the queries to simplify the landuse layer for the zoom level 7:","1-create-the-positive-buffer#1. Create the positive buffer":"CREATE MATERIALIZED VIEW osm_landuse_l_filtered AS\nSELECT\nid,\ntags -> 'landuse' as landuse,\nst_buffer(st_simplifypreservetopology(geom, 78270 / power(2, 6)), 78270 / power(2, 7), 'join=mitre') AS geom\nFROM osm_landuse\nWHERE st_area(st_envelope(geom)) > 5 * power(78270 / power(2, 7), 2);\nThere are two main parameters to adjust:\nst_simplifypreservetopology tolerance.\nThe tolerance is ajusted to one zoom level below the target zoom level. This is to avoid having too many geometries at the target zoom level and allows to better merge them together.\n\nst_area condition.\nThe condition is used to filter out geometries that are too small. Lowering the value will increase the number of geometries and more will be merged together. Increasing the value will decrease the number of geometries and make the layer less \"dense\".","2-group-the-geometries#2. Group the geometries":"CREATE MATERIALIZED VIEW osm_landuse_l_grouped AS\nSELECT\nlanduse,\ncluster,\nst_collect(geom) AS geom\nFROM osm_landuse_l_clustered\nGROUP BY landuse, cluster;\nThe geometries are grouped by landuse and cluster.","3-create-the-negative-buffer#3. Create the negative buffer":"CREATE MATERIALIZED VIEW osm_landuse_l_buffered AS\nSELECT\nlanduse,\nst_buffer(geom, 0.5 * -78270 / power(2, 7), 'join=mitre') AS geom\nFROM osm_landuse_l_grouped;\nHere the buffer is created with a negative value to merge the geometries together.\nst_buffer buffer size.\nThe negative value is used to merge the geometries together. A smaller factor will merge more geometries together and vice versa. However, the greater the difference between the positive and negative buffer, the more likely it is to have artifacts.","4-explode-the-geometries#4. Explode the geometries":"CREATE MATERIALIZED VIEW osm_landuse_l_exploded AS\nSELECT\nlanduse,\n(st_dump(geom)).geom AS geom\nFROM osm_landuse_l_buffered;\nThe geometries are exploded to be able to merge them with the positive buffer.","5-build-the-final-layer#5. Build the final layer":"CREATE MATERIALIZED VIEW osm_landuse_l AS\nSELECT\nrow_number() OVER () AS id,\njsonb_build_object('landuse', landuse) AS tags,\ngeom AS geom\nFROM osm_landuse_l_buffered;\nThe final layer is created by reconstructing the geometries and adding the landuse tag.","6-use-the-layer#6. Use the layer":"We now use the osm_landuse_l layer for the zoom level 7 in simplify.sql. Note that we apply further simplifications to the layer to reduce the size of the tiles.\nCREATE MATERIALIZED VIEW osm_landuse_z7 AS\nSELECT\nid,\ntags,\nst_simplifypreservetopology(geom, 78270 / power(2, 7)) AS geom\nFROM osm_landuse_l\nWHERE st_area(st_envelope(geom)) > 150 * power(78270 / power(2, 7), 2);\n\nst_area condition.\nThe condition is used again to filter out geometries that are too small from the merged geometries (osm_landuse_l). The factor can be adjusted to increase or decrease the filtering."}},"/documentation/developer-manual/project-structure":{"title":"Project structure","data":{"":"The code is structured in a way that makes it easy to understand and to contribute to the project.","modules#Modules":"TODO","baremaps-core#Baremaps-core":"TODO"}},"/documentation/developer-manual/setup-in-intellij":{"title":"Set up in IntelliJ IDEA","data":{"":"To open the project with IntelliJ, go under file -> open -> ... and select the pom.xml file in the root of the project.We added a few configurations to run the code quickly. You can find them in the Run/Debug Configurations dropdown in the top right corner of the IDE.These run configurations are either prefixed with an example name (e.g. openstreetmap-) corresponding to a directory in the examples folder or with basemap- and daylight- for the basemap and daylight folders.\nThe suffix usually indicate the command used to run the configuration.For instance, to jump into the development of the basemap, you start a postgis container, run the basemap-workflow configuration to prepare the database, and run the basemap-dev configuration to serve the basemap.\nThe baremaps-dev configuration will watch for changes in the style and the tileset and automatically reload the browser when changes are detected."}},"/documentation/examples":{"title":"Examples","data":{"":"The examples will showcase the different uses of the Apache Baremaps toolkits. To run the examples you need to clone or download the main\nrepository in order to have access to the files that have been prepared for the examples.\ngit clone git@github.com:apache/incubator-baremaps.git\nYou should have completed the Installation Guide before running the examples.For the creation of custom vector tiles you can follow these guides:\nThe OpenStreetMap example is a good introduction to Baremaps, it shows how to produce high resolution vector tiles.\nThe NaturalEarth example shows how to produce low resolution vector tiles.\nThe Contour example shows how to produce contour lines from a digital elevation model.\nThe Extrusion example shows how to import OSM data into postgis and use the MVT specification to extrude the vectors into 3d.\n\nFor the creation of an IP to location service follow this guide:\nThe IP to location example shows how to create and serve an IP to location service in a simple web application.\n\nIf you want to work on Geocoding there is this example:\nThe Geocoding example shows how to create and serve a geocoding service in a simple web application.\n\nDevelopers who want to execute the code, should refer to the developer manual:\nThe Developer Manual aims at helping developers to execute the code, understand the structure and contribute to the project."}},"/documentation/examples/contour-lines-in-vector-tiles":{"title":"Contour Lines in Vector Tiles","data":{"":"Contour lines are a key element in topographic maps, as they allow us to\nvisualize the elevation of an area. In this tutorial, we will show you how\nto create contour lines from a digital elevation model (DEM) and display\nthem using vector tiles.","prerequisites#Prerequisites":"To follow this tutorial, you will need to have gdal installed on your\nsystem. If you don't have it already, you can install it by running the\nfollowing command:\nsudo apt-get install gdal-bin","downloading-the-dem-data#Downloading the DEM Data":"The first step is to download the DEM data. For this tutorial, we will be\nusing the ASTER dataset.You can download it from the\nNASA Earthdata\nwebsite. You can either select the \"granules\" or click on the Download All\nbutton to download the entire dataset.\nNote: You will need to create a free account on NASA Earthdata to download the data.\n\n\nAlternative DatasetsIf you want to use a different DEM dataset, below is a list of some other\noptions:\nSRTM\nCOPERNICUS-DEM (note:\ncontains quite some artifacts)","reprojecting-the-geotiff#Reprojecting the GeoTiff":"The geotiff file provided in this tutorial is already in the desired\nprojection (WebMercator), but in case you want to use a different geotiff\nfile, you can use the gdalwarp command to reproject it. Here's an example of\nhow to do it:\ngdalwarp -rc \\\n-s_srs epsg:4326 -t_srs epsg:3857 \\\n-dstnodata 0 -of GTiff -co tiled=yes \\\nliecthenstein-aster-dem-v2.tif \\\nliecthenstein-aster-dem-v2-3857.tif","generating-the-contour-lines#Generating the Contour Lines":"Now that we have the GeoTiff in the desired projection,\nwe can use the gdal_contour command to generate the contour lines.\nThe -a argument specifies the column that contains the elevation data,\nthe -i argument specifies the interval at which contours\nshould be generated (in this case, we are using 10 meters),\nand the -nln argument names the table that will contain the data.\ngdal_contour \\\n-a elevation -nln aster_dem -i 10 \\\n-f PostgreSQL \\\nliecthenstein-aster-dem-v2-3857.tif \"PG:host=localhost user=baremaps password=baremaps dbname=baremaps\"","improving-performance-with-indexes#Improving Performance with Indexes":"To improve the performance of the contour lines,\nwe can add some indexes to the database.\nHere's an example of how to create a SPGIST index:\nDROP INDEX IF EXISTS aster_dem_gix;\nCREATE INDEX IF NOT EXISTS aster_dem_gix ON aster_dem USING SPGIST(wkb_geometry);","displaying-the-contour-lines#Displaying the Contour Lines":"Finally, we can use Baremaps to display the contour lines in a web browser.\nTo do this, run the following command:\nbaremaps map dev \\\n--tileset 'tileset.json' \\\n--style 'style.json'\nThis will start the tile server and automatically reload the configuration\nfiles when you make changes. You can then preview the map in your\nweb browser.","optional-smoothing-the-contour-lines#Optional: Smoothing the Contour Lines":"If you want to improve the rendering of the contour lines, you can use\na smoothing function like ST_ChaikinSmoothing. This function takes\na geometry as input and returns a smoothed version of that geometry.\nHere's an example of how you could use it:\nUPDATE aster_dem\nSET wkb_geometry = ST_ChaikinSmoothing(wkb_geometry, 0.1)\nKeep in mind that this step is optional and might not be necessary depending\non the quality of your input data. You can experiment with different\nsmoothing parameters to find the best balance between smoothness and\npreservation of original features.That's it! You now know how to generate and display contour lines from\na digital elevation model using vector tiles. Happy mapping!"}},"/documentation/examples/extrusion":{"title":"Extrusion of vector tiles from OSM data","data":{"":"This example builds upon the OpenStreetMap example and shows how 3d\nbuildings can be extruded with Maplibre. First, start by downloading the OSM data for London in the current directory.To import London data in the database.\ncd examples/extrusion\nbaremaps workflow execute --file workflow.json\nIn the tileset.json\nfile, notice the SQL query associated with the building layer. Here, the number of levels stored in OSM is multiplied by\n3, which roughly corresponds to the height of a level in meters.\nSELECT id,\ntags || jsonb_build_object('building:height', (CASE\nWHEN tags ->> 'building:levels' ~ '^[0-9\\\\.]+$'\nTHEN tags ->> 'building:levels'\nELSE '1' END)::real * 3),\ngeom\nFROM osm_ways\nWHERE tags ? 'building'\nThis property is then used in\nthe style.json file to\nextrude the buildings.\n{\n...\n\"layers\": [\n{\n\"id\": \"building\",\n\"type\": \"fill-extrusion\",\n\"source\": \"baremaps\",\n\"source-layer\": \"building\",\n\"paint\": {\n\"fill-extrusion-color\": \"rgb(152, 174, 221)\",\n\"fill-extrusion-height\": [\n\"get\",\n\"building:height\"\n],\n\"fill-extrusion-base\": 0,\n\"fill-extrusion-opacity\": 0.9\n}\n}\n],\n...\n}\nTo preview this example, start the tile viewer. Here, the cache directive is\na caffeine specification\nfor a 100MB tile cache.\nbaremaps map dev \\\n--tileset 'tileset.json' \\\n--style 'style.json'\nWell done, a map of London with extruded buildings should now appear in your browser!","conclusion#Conclusion":"In this tutorial, we learnt how to import OSM data in PostGIS with a workflow and then use the MVT specification to extrude the vector tiles into a 3d object."}},"/documentation/examples/geoadmin":{"title":"Geoadmin Noise Exposure in Vector Tiles","data":{"":"The Federal Office for the Environment (FOEN) provides a GeoTiff describing the traffic noise levels in Switzerland.\nDownload an uncompress the archive that contains the GeoTiff.If needed, you can now reproject the geotiff in the desired projection before importing it in the database.\nStart by reprojecting the geotiff (EPSG:2056) from LV95 to WebMercator (EPSG:3857)\ngdalwarp -rc \\\n-s_srs epsg:2056 -t_srs epsg:3857 \\\n-dstnodata 0 -of GTiff -co tiled=yes \\\nStrassenLaerm_Tag_LV95.tif \\\nStrassenLaerm_Tag_LV95-3857.tif\nYou can now import any GeoTiff DEM as contours in postgis.\nHere, the -nln argument name the table that contains the data,\nthe -a argument name the column that contains the elevation,\nthe -i argument specifies the interval in meters at which contours are generated.\ngdal_polygonize.py \\\nStrassenLaerm_Tag_LV95-3857.tif \\\n-f PostgreSQL \\\n\"PG:host=localhost user=baremaps password=baremaps dbname=baremaps\" \\\ngeoadmin_traffic_noise_day\nThe following index can now be created to improve performances.\nWhen available, a smoothing function such as ST_ChaikinSmoothing can be used to improve rendering.\nDROP INDEX IF EXISTS geoadmin_traffic_noise_day_gix;\nCREATE INDEX CONCURRENTLY IF NOT EXISTS geoadmin_traffic_noise_day_gix ON geoadmin_traffic_noise_day USING SPGIST(wkb_geometry);\nTo preview and edit the map in the browser, run the tile server with the following command:\nbaremaps map dev \\\n--database 'jdbc:postgresql://localhost:5432/baremaps?user=baremaps&password=baremaps' \\\n--config 'tileset.json' \\\n--style 'style.json'"}},"/documentation/examples/geocoding":{"title":"Create a geocoding web service","data":{"":"In this tutorial, we demonstrate how to create a geocoding index and then serve it in a simple web application.","dataset#Dataset":"The data we will be using comes from Geonames.","generate-the-index#Generate the index":"The following workflow will download the Geonames data, decompress it, and finally build the index.\ncd examples/geocoding\nbaremaps workflow execute --file workflow.js","serve-the-data#Serve the data":"The following command will serve the Geonames index over HTTP in a simple web application.\nbaremaps geocoder serve --index geocoder-index --port 9000\nGo to http://localhost:9000/ to see it in action.","conclusion#Conclusion":"In this tutorial, we learnt how to create a Geocoding index and serve it in a simple web application.\nThis will be very useful in a map application to find places quickly by writing an address in a prompt."}},"/documentation/examples/import-naturalearth-into-postgis":{"title":"Import Natural Earth data into PostGIS","data":{"":"In this tutorial, we'll learn how to use Baremaps to import Natural Earth data in a PostGIS database.Notice that the following steps assume that the Apache Baremaps CLI and PostGIS are installed.","dataset#Dataset":"Natural Earth is a public domain map dataset available at 1:10m, 1:50m, and 1:110 million scales.The following workflow will download the Natural Earth data, decompress it, and finally import it in the database.\ncd examples/naturalearth\nbaremaps workflow execute --file workflow.json","conclusion#Conclusion":"In this tutorial, we learnt how to import Natural Earth data in PostGIS.Now that you have inserted the data into the PostGIS database, you can use follow the Serve Vector Tiles from PostGIS example to serve\nyour PostGIS data directly as Vector Tiles in a web application with live reload capabilities."}},"/documentation/examples/import-osm-into-postgis":{"title":"Import OSM data into PostGIS","data":{"":"In this tutorial, we'll learn how to use Baremaps to import contour lines data in a PostGIS database.Notice that the following steps assume that the Apache Baremaps CLI and PostGIS are installed.Also, if you are in a hurry, consider skipping the \"Under the Hood\" sections.","dataset#Dataset":"OpenStreetMap (OSM) is a free and editable map of the world.\nIt is maintained by a community of passionate volunteers in a way which is similar to Wikipedia.\nEvery week, OpenStreetMap publishes a full dump of its data in two flavours: a large XML file of about 90GB and a more compact binary file of about 50GB in the Protocol Buffer Format (PBF).\nAs processing such large files can take several hours, Geofabrik regularly publishes smaller extracts of OSM for specific regions.\nIn this example we will use a tiny extract of OSM for Liechtenstein, which is suitable for fast experiments.","importing-openstreetmap-data#Importing OpenStreetMap Data":"A workflow is a directed acyclic graph of steps executed by Baremaps.\nTo download and import the sample OSM data in Postgres, execute the following workflow.\ncd examples/openstreetmap\nbaremaps workflow execute --file workflow.json\nDepending on the size of the OpenStreetMap file, the execution of this command may take some time.\nEventually, the output produced by the command should look as follows.\n[INFO ] 2022-07-26 09:47:40.906 [main] Workflow - Executing workflow workflow.json\n[INFO ] 2022-07-26 09:47:41.208 [pool-2-thread-1] DownloadUrl - Downloading https://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf to liechtenstein-latest.osm.pbf\n[INFO ] 2022-07-26 09:48:14.496 [pool-2-thread-1] DownloadUrl - Finished downloading https://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf to liechtenstein-latest.osm.pbf\n[INFO ] 2022-07-26 09:48:14.497 [pool-2-thread-2] ImportOpenStreetMap - Importing liechtenstein-latest.osm.pbf into jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps\n[INFO ] 2022-07-26 09:48:14.504 [pool-2-thread-2] HikariDataSource - HikariPool-1 - Starting...\n[INFO ] 2022-07-26 09:48:14.669 [pool-2-thread-2] HikariPool - HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@13d835e3\n[INFO ] 2022-07-26 09:48:14.671 [pool-2-thread-2] HikariDataSource - HikariPool-1 - Start completed.\n[INFO ] 2022-07-26 09:48:19.172 [pool-2-thread-2] ImportOpenStreetMap - Finished importing liechtenstein-latest.osm.pbf into jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps\n[INFO ] 2022-07-26 09:48:19.172 [pool-2-thread-2] HikariDataSource - HikariPool-1 - Shutdown initiated...\n[INFO ] 2022-07-26 09:48:19.177 [pool-2-thread-2] HikariDataSource - HikariPool-1 - Shutdown completed.\n[INFO ] 2022-07-26 09:48:19.178 [pool-2-thread-3] ExecuteSqlFile - Executing indexes.sql into jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps\n[INFO ] 2022-07-26 09:48:19.179 [pool-2-thread-3] HikariDataSource - HikariPool-2 - Starting...\n[INFO ] 2022-07-26 09:48:19.213 [pool-2-thread-3] HikariPool - HikariPool-2 - Added connection org.postgresql.jdbc.PgConnection@25c4ab89\n[INFO ] 2022-07-26 09:48:19.213 [pool-2-thread-3] HikariDataSource - HikariPool-2 - Start completed.\n[INFO ] 2022-07-26 09:48:21.365 [pool-2-thread-3] ExecuteSqlFile - Finished executing indexes.sql into jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps\n[INFO ] 2022-07-26 09:48:21.365 [pool-2-thread-3] HikariDataSource - HikariPool-2 - Shutdown initiated...\n[INFO ] 2022-07-26 09:48:21.367 [pool-2-thread-3] HikariDataSource - HikariPool-2 - Shutdown completed.\n[INFO ] 2022-07-26 09:48:21.368 [main] Workflow - Finished executing workflow workflow.json","under-the-hood-optional#Under the Hood (Optional)":"What can we learn from this output?\nFirst, we notice that Baremaps uses a connection pool to parallelize the import procedure.\nThen it imports the OSM data, populating the tables previously created.\nIn our case, the input is a file provided by Geofabrik.OSM's conceptual model builds upon the notions of nodes, ways and relations.\nIn this normalized data model, a line (or way) is formed by a sequence of points (nodes) referenced by their id.\nIn order to save denormalized geometries in PostGIS (e.g. linestring, polygon, multi-polygon, etc.), Baremaps creates a cache for nodes, ways and relations.\nLMDB is used under the hood to achieve great performance.After the creation of the cache, Baremaps can populate the database with geometries.\nThe geometries are stored in three tables named after the OSM conceptual model: osm_nodes, osm_ways, and osm_relations.\nIn order to improve performances at query time, Baremaps also creates indexes for the tags and the geometries.\nThe following Figure displays the schema of the PostGIS database created by Baremaps.","conclusion#Conclusion":"In this tutorial, we learnt how to import OpenStreetMap data in PostGIS.Now that you have inserted the OSM data into the PostGIS database, you can use follow the Serve Vector Tiles from PostGIS example to serve\nyour PostGIS data directly as Vector Tiles in a web application with live reload capabilities."}},"/documentation/examples/ip-to-location":{"title":"Create an IP to location web service","data":{"":"In this tutorial, we demonstrate how to create an IP to location index and then serve it in a simple web application.","dataset#Dataset":"The data used to create an IP to location index is publicly available from the Internet routing registries (IRRs) which includes the Regional Internet Registries (RIRs)The data are formatted following RPSL specifications and contain records that link IP address ranges to organisations along with some metadata.","generate-the-index#Generate the index":"cd examples/ip-to-location\nbaremaps workflow execute --file workflow.js\nThe workflow executed in the above command does the following:\nDownload and decompress the data from the IRRs\nDownload and create a Geocoding index (see the Geocoding example)\nIterate over every entry in the registries to extract the IP address ranges and the associated metadata to query the Geocoding index and extract a latitude and a longitude.","serve-the-data#Serve the data":"baremaps iploc serve --database iploc.db --port 9000\nA simple web application serves the Geonames index. Go to http://localhost:9000/ to see it in action.","conclusion#Conclusion":"In this tutorial, we learnt how to create an IP to location index and serve it in a simple web application.\nIP to location has many uses, one of which is to locate users that connect to a website to generate statistics."}},"/documentation/getting-started":{"title":"Getting Started","data":{"":"This section will get you started with the setup of Apache Baremaps to execute the examples. If you plan on running the\ncode directly, or using Apache Baremaps as a library, you should refer to the Developer Manual.After installing the necessary components, the Examples explain how to use Apache Baremaps to create a vector tileset from an OpenStreetMap extract, create an IP to location web service, and much more.Now head into Installing the CLI to see how to set up the Apache Baremaps command line interface on your\nown machine to execute the examples."}},"/documentation/getting-started/installing-postgis":{"title":"Installing PostGIS","data":{"":"This step is not required if you plan to execute the Geocoding or IP to location examples.For the insertion and generation of Vector tiles, you need to set up a PostGIS database.\nThis database will host all the data required to generate the vector tiles.The following docker image will allow you to jump start this installation:\ndocker run \\\n--name baremaps \\\n--publish 5432:5432 \\\n-e POSTGRES_DB=baremaps \\\n-e POSTGRES_USER=baremaps \\\n-e POSTGRES_PASSWORD=baremaps \\\n-d postgis/postgis:latest\nYou can then stop and start the container with the following commands:\ndocker stop baremaps\ndocker start baremaps\nFrom there you can go to the Examples section. The Import OSM data into PostGIS example is the first step to produce custom high resolution vector tiles."}},"/documentation/getting-started/installing-the-cli":{"title":"Installing the CLI","data":{"":"In order to run Apache Baremaps, you first need to install Java 17 or a later version.\nSDKMAN provides a convenient Command Line Interface (CLI) to install and upgrade Java.To install Apache Baremaps, download and decompress the latest binary distribution.\nThen, add the /bin directory of the decompressed distribution to your PATH environment variable:\ntar -xzf baremaps-<version>-incubating-bin.tar.gz\nexport PATH=$PATH:`pwd`/baremaps/bin\nCalling the baremaps command should now result in an output similar to the following:\nUsage: baremaps [-V] [COMMAND]\nA toolkit for producing vector tiles.\n-V, --version Print version info.\nCommands:\nworkflow Manage a workflow.\ndatabase Database commands.\nmap Map commands.\ngeocoder Geocoder commands (experimental).\niploc IP to location commands (experimental).\nogcapi OGC API server (experimental).\nFrom here, heads to Installing PostGIS if you plan to work with vector tiles.If you want to work on Geocoding or IP to location, head directly into the related examples."}},"/documentation":{"title":"Introduction","data":{"":"Apache Baremaps is an open source toolkit and a set of infrastructure components for creating, publishing, and operating online maps. It provides a data pipeline enabling developers to build maps with different data sources. It offers live reload capabilities that allow cartographers to customize the content and the style of a map. It includes an attribution-free map schema and style that stimulates derived work. Finally, it provides services commonly used in online maps, such as location search and IP to location.Apache Baremaps is inspired by Osmosis, but it comes with additional features, such as the ability to:\nProcess data in parallel with the Stream API introduced in Java 8\nImport data faster with the COPY API of Postgresql\nCreate postgis geometries on the fly with JTS\nCreate and serve customized Vector Tiles\n\nOn the longer run, the project aims to work with a variety of data sources in order to create highly specialized and customized maps."}},"/download/release-0.7.1":{"title":"Apache Baremaps 0.7.1 (incubating)","data":{"":"The Apache Baremaps community is pleased to announce the release of Apache Baremaps 0.7.1 (incubating).\nApache Baremaps is a toolkit and a set of infrastructure components for creating, publishing, and operating online maps.This is our first release since joining the Apache Software Foundation and an important milestone in the project's history.\nThank you to everyone who contributed to this release and thank you to the mentors for their guidance and support.We are looking to grow the community and welcome new contributors.\nIf you are interested in contributing to the project, please contact us on the mailing list or on GitHub.\nWe will be happy to help you get started.","release-notes#Release notes":"The release notes are available here:https://github.com/apache/incubator-baremaps/releases/tag/v0.7.1","signing-keys#Signing keys":"The PGP keys used to sign this release are available here:https://downloads.apache.org/incubator/baremaps/KEYS","source-distribution#Source distribution":"The source distribution is available here:https://www.apache.org/dyn/closer.lua/incubator/baremaps/0.7.1/baremaps-0.7.1-incubating-src.tar.gzThe SHA checksum for the source distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.1/baremaps-0.7.1-incubating-src.tar.gz.sha512The PGP signature for the source distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.1/baremaps-0.7.1-incubating-src.tar.gz.asc","binary-distribution#Binary distribution":"The binary distribution is available here:https://www.apache.org/dyn/closer.lua/incubator/baremaps/0.7.1/baremaps-0.7.1-incubating-bin.tar.gzThe SHA checksum for the binary distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.1/baremaps-0.7.1-incubating-bin.tar.gz.sha512The PGP signature for the binary distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.1/baremaps-0.7.1-incubating-bin.tar.gz.asc","verifying-releases#Verifying releases":"It is essential that you verify the integrity of the downloaded files using the PGP or SHA signatures.\nPlease read Verifying Apache HTTP Server Releases for more information on why you should verify our releases."}},"/download/release-0.7.2":{"title":"Apache Baremaps 0.7.2 (incubating)","data":{"":"The Apache Baremaps community is pleased to announce the release of Apache Baremaps 0.7.2 (incubating).\nApache Baremaps is a toolkit and a set of infrastructure components for creating, publishing, and operating online maps.Thank you to everyone who contributed to this release and thank you to the mentors for their guidance and support.We are looking to grow the community and welcome new contributors.\nIf you are interested in contributing to the project, please contact us on the mailing list or on GitHub.\nWe will be happy to help you get started.","release-notes#Release notes":"The release notes are available here:https://github.com/apache/incubator-baremaps/releases/tag/v0.7.2","signing-keys#Signing keys":"The PGP keys used to sign this release are available here:https://downloads.apache.org/incubator/baremaps/KEYS","source-distribution#Source distribution":"The source distribution is available here:https://www.apache.org/dyn/closer.lua/incubator/baremaps/0.7.2/apache-baremaps-0.7.2-incubating-src.tar.gzThe SHA checksum for the source distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.2/apache-baremaps-0.7.2-incubating-src.tar.gz.sha512The PGP signature for the source distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.2/apache-baremaps-0.7.2-incubating-src.tar.gz.asc","binary-distribution#Binary distribution":"The binary distribution is available here:https://www.apache.org/dyn/closer.lua/incubator/baremaps/0.7.2/apache-baremaps-0.7.2-incubating-bin.tar.gzThe SHA checksum for the binary distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.2/apache-baremaps-0.7.2-incubating-bin.tar.gz.sha512The PGP signature for the binary distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.2/apache-baremaps-0.7.2-incubating-bin.tar.gz.asc","verifying-releases#Verifying releases":"It is essential that you verify the integrity of the downloaded files using the PGP or SHA signatures.\nPlease read Verifying Apache HTTP Server Releases for more information on why you should verify our releases."}},"/download/release-0.7.3":{"title":"Apache Baremaps 0.7.3 (incubating)","data":{"":"The Apache Baremaps community is pleased to announce the release of Apache Baremaps 0.7.3 (incubating).\nApache Baremaps is a toolkit and a set of infrastructure components for creating, publishing, and operating online maps.Thank you to everyone who contributed to this release and thank you to the mentors for their guidance and support.We are looking to grow the community and welcome new contributors.\nIf you are interested in contributing to the project, please contact us on the mailing list or on GitHub.\nWe will be happy to help you get started.","release-notes#Release notes":"The release notes are available here:https://github.com/apache/incubator-baremaps/releases/tag/v0.7.3","signing-keys#Signing keys":"The PGP keys used to sign this release are available here:https://downloads.apache.org/incubator/baremaps/KEYS","source-distribution#Source distribution":"The source distribution is available here:https://www.apache.org/dyn/closer.lua/incubator/baremaps/0.7.3/apache-baremaps-0.7.3-incubating-src.tar.gzThe SHA checksum for the source distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.3/apache-baremaps-0.7.3-incubating-src.tar.gz.sha512The PGP signature for the source distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.3/apache-baremaps-0.7.3-incubating-src.tar.gz.asc","binary-distribution#Binary distribution":"The binary distribution is available here:https://www.apache.org/dyn/closer.lua/incubator/baremaps/0.7.3/apache-baremaps-0.7.3-incubating-bin.tar.gzThe SHA checksum for the binary distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.3/apache-baremaps-0.7.3-incubating-bin.tar.gz.sha512The PGP signature for the binary distribution is available here:https://downloads.apache.org/incubator/baremaps/0.7.3/apache-baremaps-0.7.3-incubating-bin.tar.gz.asc","verifying-releases#Verifying releases":"It is essential that you verify the integrity of the downloaded files using the PGP or SHA signatures.\nPlease read Verifying Apache HTTP Server Releases for more information on why you should verify our releases."}},"/experiments/basemap-raster-hillshade":{"title":"Basemap Raster Hillshade","data":{"":"The following example injects a terrain source and a hillshade layer into the basemap style."}},"/experiments/raster-dem":{"title":"Raster DEM","data":{"":"The following raster DEM dataset is from AWS Terrain Tiles."}},"/experiments/raster-hillshade":{"title":"Raster Hillshade","data":{"":"This example shows the use of the hillshade layer type in maplibre-gl to render a hillshade layer on top of a raster DEM layer."}},"/":{"title":"Apache Baremaps","data":{"":"Apache Baremaps\n\nMapping Infrastructure Made Easy\n\nApache Baremaps is a toolkit and a set of infrastructure components\nfor creating, publishing, and operating\nonline maps.\n\n\nGet started →\n\n\n\n\n\n\n\n\nVector Tiles\n\n\nBaremaps allows you to easily serve and publish custom vector tiles\nfrom PostGIS. Whether you need to create maps for web or mobile\napplications, Baremaps makes it simple and efficient. Additionally,\nwe are continuously working on developing a high-quality base map.\n\n\n\n\nExplore the map ↗\n\nClick to view the map\n\n\n\n\n\n\n\n\n\nData Pipeline\n\n\nWith Baremaps, you can easily create custom data pipelines to\nconsolidate your spatial datasets in PostGIS. Baremaps supports\nseveral popular formats such as OsmPbf, ShapeFile, GeoPackage, and\nFlatGeoBuf, allowing you to seamlessly integrate with your existing\nworkflows.\n\n\n\n\n\n\n\n\n\n\nThemes\n\n\nBaremaps provides a set of themes that can be used to style your\nmaps. The themes are customizable and can be easily integrated into\nyour existing applications. With hot reloading, you can quickly\niterate on your design and see the results in real-time.\n\n\n\n\nGeocoder\n\n\nBaremaps provides a geocoder that allows you to search for places\nand addresses. The geocoder is based on the GeoNames database and\ncan be easily integrated into your existing applications. We are\nworking on adding more features and improving the quality of the\nresults.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nContributing\n\n\nWhether you're an experienced or just getting started, there are\nmany ways to get involved. We are experimenting with a range of new\ncomponents, including IP to location, 3D Tiles Next, and geocoding,\nand would love your help. Let's create something amazing together!"}},"/map":{"title":"Apache Baremaps","data":{"":""}},"/documentation/examples/gdal-macos":{"title":"Building gdal-java on Mac OS X","data":{"":"The following procedure has been adapted form the GDAL CI.\nset -e\n\nxcode-select --installs\n\nbrew install cmake\nbrew install proj\nbrew install boost\nbrew install swig\nbrew install sqlite\nbrew install thrift\nbrew install --cask miniconda\n\ngit clone git@github.com:OSGeo/gdal.git\ngit checkout v3.6.4\n\nconda update -n base -c defaults conda\nconda install -y compilers automake pkgconfig cmake\nconda config --set channel_priority strict\nconda install --yes --quiet proj=7.1.1=h45baca5_3 python=3.8 swig -y\nconda install --yes --quiet libgdal=3.1.4=hd7bf8dc_0 --only-deps -y\n\nCONDA_PREFIX=/usr/local/miniconda/envs/test\nfind ${CONDA_PREFIX}/lib -name '*.la' -delete\n\nmkdir build\ncd build\n\ncmake .. \\\n-DCMAKE_INSTALL_PREFIX=$HOME/install-gdal \\\n-DCMAKE_PREFIX_PATH=${CONDA_PREFIX} \\\n-DGDAL_USE_GEOTIFF_INTERNAL=ON \\\n-DGDAL_USE_PNG_INTERNAL=ON \\\n-DGDAL_USE_POSTGRESQL=OFF \\\n-DGDAL_USE_WEBP=OFF \\\n-DGDAL_USE_ARROW=OFF \\\n-DGDAL_USE_PARQUET=OFF \\\n-DBUILD_CSHARP_BINDINGS=OFF\ncmake --build .\ncmake --build . --target install\nAfter this, the library can be found in ~/install-gdal/share/java/libgdalalljni.dylib.When starting a java application, the library can be loaded with the following command:\njava -Djava.library.path=~/install-gdal/share/java -jar myapp.jar","fix-cmake-file#Fix cmake file":"diff --git a/cmake/modules/packages/FindSPATIALITE.cmake b/cmake/modules/packages/FindSPATIALITE.cmake\nindex 80052a4d48..6e5744187e 100644\n--- a/cmake/modules/packages/FindSPATIALITE.cmake\n+++ b/cmake/modules/packages/FindSPATIALITE.cmake\n@@ -55,8 +55,8 @@ mark_as_advanced(SPATIALITE_LIBRARY SPATIALITE_INCLUDE_DIR)\nif(SPATIALITE_LIBRARY AND SPATIALITE_INCLUDE_DIR\nAND NOT SPATIALITE_VERSION_STRING)\nfile(STRINGS \"${SPATIALITE_INCLUDE_DIR}/spatialite.h\" _spatialite_h_ver\n- REGEX \"^[ \\t]version[ \\t]([0-9]+\\\\.[0-9]+),.*\")\n- string(REGEX REPLACE \"[ \\t]version[ \\t]([0-9]+\\\\.[0-9]+),.*\" \"\\\\1\" _spatialite_h_ver ${_spatialite_h_ver})\n+ REGEX \"^[ \\t]version[ \\t]([0-9]+\\\\.[0-9]+\\\\.[0-9]+),.*\")\n+ string(REGEX REPLACE \"[ \\t]version[ \\t]([0-9]+\\\\.[0-9]+\\\\.[0-9]+),.*\" \"\\\\1\" _spatialite_h_ver ${_spatialite_h_ver})\nset(SPATIALITE_VERSION_STRING \"${_spatialite_h_ver}\")\nendif()","sources#Sources":"https://github.com/adoptium/temurin-build/issues/1671https://stackoverflow.com/questions/52911791/hardened-runtime-for-java-and-mojavehttps://stackoverflow.com/questions/52905940/how-to-codesign-and-enable-the-hardened-runtime-for-a-3rd-party-cli-on-xcode"}},"/documentation/examples/serve-and-export-vector-tiles":{"title":"Serve Vector Tiles from PostGIS","data":{"":"In this tutorial, we'll learn how to create vector tiles from the data imported into PostGIS.If you have not yet inserted data into your PostGIS database, please follow one of these three guides:\nImport OSM data into PostGIS\nImport Natural Earth data into PostGIS\nImport Contour lines from the ASTER dataset into PostGIS\n\nIf you are in a hurry, consider skipping the \"Under the Hood\" sections.","creating-vector-tiles#Creating Vector Tiles":"In order to create vector tiles, Apache Baremaps requires JSON configuration files. The two configuration files used are:\ntileset.json - Defines all the information needed to retrieve the correct vector tile layers at different zoom levels.\nstyle.json - Defines the style of the different layers.\n\nFor convenience, we have prepared a tileset.json and a style.json that correspond to each of the examples.Each of these files are available in the main repository of Apache Baremaps inside the examples' folder.\nFor OpenStreetMap data\nFor contour lines data\nFor Natural Earth data\n\nFirst cd into one of the example directories that corresponds to the data you inserted inside your PostGIS database.\nThen let's preview and edit the map with the sample configuration files by executing the following command in a terminal.\nbaremaps map dev \\\n--tileset 'tileset.json' \\\n--style 'style.json'\nWell done, a local development server should have started.\nYou can now visualize the vector tiles in your browser (http://localhost:9000/)!\nNotice that the changes in the configuration files are automatically reloaded by the browser.","under-the-hood-optional#Under the Hood (Optional)":"Baremaps extensively rely on the fantastic ST_AsMVT functions released by the PostGIS team to produce Mapbox Vector Tiles.\nHowever, in the following excerpt of the json configuration file, none of these concepts appear in the SQL queries.\n{\n...\n\"vector_layers\": [\n{\n\"id\": \"aeroway\",\n\"queries\": [\n{\n\"minzoom\": 12,\n\"maxzoom\": 20,\n\"sql\": \"SELECT id, tags, geom FROM osm_nodes WHERE tags ? 'aeroway'\"\n},\n...\n]\n},\n],\n...\n}\nWhy don't we see these function calls in the configuration?\nBaremaps wants you to focus on the content of the tiles, and relieves you from the burden of writing complex SQL queries.\nIn fact, at runtime, Baremaps merges all the queries of the configuration file into a single optimized query that produces vector tiles.In production, vector tiles are rarely served dynamically. Why is that so?\nFirst, a large blob store is much cheaper than a relational database to operate.\nSecond, content delivery networks (CDNs) greatly improve web performances by caching static content close to the end user.\nBaremaps has been conceived with these lasting trends in mind.\nThe following command produces a local directory containing precomputed static tiles.\nThese tiles can be served with Apache, Nginx, or Caddy, but also copied in a blob store behind a content delivery network, such as Cloudflare, Stackpath, or Fastly.\nbaremaps map export \\\n--tileset 'tileset.json' \\\n--repository 'tiles/'","conclusion#Conclusion":"In this tutorial, we learnt how to create vector tiles from PostGIS data with the help of Apache Baremaps.\nPrior to the release of Apache Baremaps, we believe that creating a pipeline for publishing vector tiles from OpenStreetMap data was a rather time-consuming task.\nAs shown in this demonstration, Apache Baremaps tries to bring back the fun to creating a web mapping pipeline!"}}}