Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

martin-cp doc source param #1236

Closed
BigBoulard opened this issue Mar 8, 2024 · 3 comments
Closed

martin-cp doc source param #1236

BigBoulard opened this issue Mar 8, 2024 · 3 comments

Comments

@BigBoulard
Copy link

BigBoulard commented Mar 8, 2024

Hi team,

I think there's something wrong with the martin-cp command description cause there's no my_table in the command line. After reading the other sections of the doc, I understand that source_name can be a comma-separated list of tables from postgres, and probably a comma-separated list of .mbtiles or (strict) .pmtiles files as well.

source: https://maplibre.org/martin/martin-cp.html

I have 4 tables in postgres (created by osm2pgsql):

  • planet_osm_point
  • planet_osm_line
  • planet_osm_polygon
  • planet_osm_roads

martin-cp seems to take a single table as a parameter. Does it mean I need to create a new table that combines data from the 4 existing ones and pass it to martin-cp to generate a valid tileset?

This copies tiles from a PostGIS table my_table into an MBTiles file tileset.mbtiles using normalized schema, with zoom levels from 0 to 10, and bounds of the whole world.

martin-cp  --output-file tileset.mbtiles \
           --mbtiles-type normalized     \
           "--bbox=-180,-90,180,90"      \
           --min-zoom 0                  \
           --max-zoom 10                 \
           --source source_name          \
           postgresql://postgres@localhost:5432/db
@BigBoulard BigBoulard changed the title martin-cp doc martin-cp doc source param Mar 8, 2024
@nyurik
Copy link
Member

nyurik commented Mar 8, 2024

martin-cp can take any source as a parameter, which includes a combined comma-separated source as well. Do note that the default osm2pgsql output may not be what you want - take a look at the planetiler tool to generate your tiles directly from OSM dump in a much better schema and much faster.

@BigBoulard
Copy link
Author

Do note that the default osm2pgsql output may not be what you want - take a look at the planetiler tool to generate your tiles directly from OSM dump in a much better schema and much faster.

Trying to create a public repo to illustrate something I struggle to do, I wondered why martin-cp needs postgres to generate a mbtiles file and if it's something mandatory. Because I understand martin can serve mbtiles files to render a map in a browser or another GIS client without postgres https://maplibre.org/martin/sources-files.html, hence this question. There is some context I'm missing about all these tools and their use cases, sorry if my question sounds stupid. I understand that martin-cp is still under development and cannot be considered 100% ready for mbtiles file generation, correct? But, still for serving tiles with Martin, I used to feed postgres with a map file from <download.geofabrik.de> using osm2pgsql and let Martin serve the tiles from postgres, is it still the advised procedure? Thank you so much.

@nyurik
Copy link
Member

nyurik commented Mar 9, 2024

All depends on your usecase, as always. If you are building "base map" - use something like planetiler to pre-generate it into an mbtiles/pmtiles file. Generating tiles on the fly for the base map could be expensive (slow). Think of it as a tile cache. Martin can serve that file - no postgres needed.

If you are generating custom data on top of a base map, e.g. taxi info like in the demo, martin could get that data from a database, possibly even with custom parameters (like in the demo). If you are serving tiles and need some extras - like fonts or sprites - martin can handle that for you too.

@maplibre maplibre locked and limited conversation to collaborators Mar 9, 2024
@nyurik nyurik converted this issue into discussion #1241 Mar 9, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants