Hot answers tagged

7

For those who will stumble on this question like me.. It appears that the plugin has been generated (https://github.com/strk/mapnik/tree/2.3.x-pgraster) and has been merged in official Mapnik Repo. The branch is 2.3.x (https://github.com/mapnik/mapnik/tree/2.3.x) Now you can build Mapnik from the branch and use PGRaster plugin to use Raster data from ...


7

It's clear that it's not necessary to shift the projection, but the data. Using GDAL >= 1.10.0 compiled with SQLite and SpatiaLite: ogr2ogr russia_shifted.shp world.shp -dialect sqlite -sql "SELECT ShiftCoords(geometry,360,0) FROM world WHERE CNTRY_NAME='Russia'" where shiftX = 360 (degrees) and shiftY = 0. UPDATE: here's the whole workflow... Clip world....


7

Just edit the renderd.conf and add a section for your second style (make sure the "URI" entry points to a different path than that of your default style). For example, my renderd.conf contains the sections [default] XML=/etc/mapnik-osm-carto-data/osm.xml URI=/osm/ DESCRIPTION=This is the standard osm mapnik style HOST=host.my CORS=* MINZOOM=0 MAXZOOM=20 [...


7

Besides hardware and other software, rendering performance depends on the database, custom indexes, and the SQL in the style rendered. The style makes a huge difference, and badly written layer definitions can result in abysmal performance. If you change the database schema, it requires changing both the custom indexes and layer SQL, so it's not possible to ...


5

The problem was almost certainly that you had a stray bracket: renderd[8967]: An error occurred while loading the map layer 'default': Shape Plugin: shapefile '/usr/local/share/world)boundaries/shoreline_300.shp' does not exist (encountered during parsing of layer 'world' in map '/home/oleg/src/mapnik-style/osm.xml') Note: world ) boundaries Can you close ...


5

How big is your area of interest? For small regions (like a city, metropolitan area, or district), you can download data by BBOX using OSM Overpass API. For bigger areas - up to 24000000 sq km - BBike extract service will provide what you want. Anything bigger requires downloading continental extract/whole database dump, and clipping to BBOX using software ...


5

Here was my problem: No way the SRTM data is that messed up. The SRTM data IS that messed up. The warping above is actually in the DEMs in the SRTM3 dataset (downloaded from http://dds.cr.usgs.gov). After examining DEMs from the improved SRTM4 dataset (available here) I found that most of these "gaps" were filled by interpolation but other issues (...


5

The problem you ran into has nothing to do with carto, it's an issue with your shell command, when you run sudo carto project.mml > OSMBright.xml carto runs as root, but the file write happens as your normal permission level, to do what your looking for you can sudo sh -c "carto project.mml > OSMBright.xml"


5

This page has an awesome tutorial on how to create a complete Tile server using the stack Mod_tile, renderd, mapnik, osm2pgsql, and a PostgreSQL/PostGIS database. If you already have a style created by the Tilemill you can export to the Mapnik format and use it to generate your tiles and render with frameworks like OpenLayers and Leaflet.


4

MapServer does support label LEADER since 6.2. http://mapserver.org/mapfile/leader.html Example:


4

try to add this text-dy: -10; you can look at file admin.mss in openstreetmap-carto project dir and find code #nature-reserve-text[zoom >= 13][way_pixels > 192000] { text-name: "[name]"; text-face-name: @book-fonts; text-fill: green; text-halo-radius: 1.0; text-halo-fill: rgba(255,255,255,0.6); text-placement: line; text-dy: -10; } ...


4

Firstly, that is a LOT of data/tiles you are rendering, so you should expect it to take a long time. You need to reconsider exactly what you are rendering. If you are using OSM_Bright and OSM data for the entire world at all zoom levels then consider more scale dependent rendering so that at the lower zoom levels, you are attempting to render less data. ...


3

As mapperz pointed out, your load is probably small enough that anything you have will do. If you have some flexibility though, try for fast disks (ideally SSD) and more memory. I suggest fast disks and memory because these are likely to be the limiting factors (for the postgres database instance). It is interesting to look how openstreetmap does it: http:/...


3

Yes, you can build Mapnik to enable all postgres queries details to be output. See https://github.com/mapnik/mapnik/wiki/Runtime-Logging for more details. However, it is easiest to just enable logging of postgres itself. One way that I frequently do this is to launch postgres from the command line like: postgres -D /path/to/postgres/directory -c ...


3

Most probably you have a coastline in your download which is not closed. So the software can not decide on which side of the coastline is water, and on which side is land. I don't know exatly how TileMill deals with it, but Mapnik renderer uses a separate shapefile with coastlines to avoide that mess. Maybe you get lucky if you download the data with the ...


3

Instead of creating metatiles I have now tested different tiling scripts that I've found. They are all using the same source image which is a JPG (with a .JGW) in EPSG:3857 projection. Bilinear has been used in scaling and the zoom level was 9. generate_tiles.py (slightly modified): 22 minutes. gdal2tiles.py (patched for 2 cpu cores): 3 minutes. gdal_tiler....


3

In my experience using Ubuntu with GIS products will not be problematic. But you should try to keep to Long Term Support (LTS) versions of Ubuntu. The reasons are among others: Cutting edge versions of Ubuntu tend to have fewer compiled versions of GIS-software (both desktop and server) LTS releases are designed to be stable platforms that you can stick ...


3

It's a bit high time I answered, but here goes: Since the use of Wax is deprecated as you mentioned, here are some Mapbox examples to get you started. Bear in mind that the Leaflet API is embedded into Mapbox.js and can be used hand in hand with Mapbox code. Using http://localhost:8000/{z}/{x}/{y}.png means to store the tiles in your own folder. This is ...


3

First, the OSM "default" style resides here, along with instructions for deploying it. You cannot import data in PostGIS without a style. Osm2pgsql requires a style file to function. There is one in OSM Bright, and there is another in the repository linked above. Yes. npm install carto (you'll need to install npm, obviously, with your package manager) and ...


3

The style is invoked in renderd.conf with something like XML=/home/jburgess/osm/svn.openstreetmap.org/applications/rendering/mapnik/osm-local.xml So you can exchange that call to another xml file, or use two configuration files for renderd. If it is pure mapnik, duplicate generate_tiles.py, and change mapfile = "osm.xml" to another style file. In both ...


3

It sounds like what you are really wanting is to be able to override specific tiles in a map. I have implemented this with TileLayers in Google Maps in the past. Not sure how to do this with OSM, but there should be a tile request hook in your javascript that would allow you to point at a script to check a local cache before forwarding the request out to a ...


3

Depending on your version of mapnik, yes it's possible. Mapnik 2.1 introduced the Python Plugin as a data source. You would need to subclass mapnik.PythonDatasource and implement a features method that based on an incoming mapnik.Query object will return mapnik.PythonDatasource.wkb_features objects. For example: import mapnik import ogr class ...


3

Stepping back, if you have data in PostGIS and you want to render it with Mapnik you really should be using Mapnik's native PostGIS support - aka mapnik.PostGIS datasource in python (https://github.com/mapnik/mapnik/wiki/PostGIS). That will be faster and more efficient than going through OGR. That said, if you have a good reason for connecting to PostGIS ...


3

Line 9 on your osm-bright.osm2pgsql.mml file, you left out a comma when adding the line "type": "shape", You need to have proper JSON format.


3

You could find a good point to start here.


3

This issue happened due to an error in my configuration of renderd in /usr/local/etc/renderd.conf. Parts of the configuration file looked like th following snippet: [renderd] socketname=/var/run/renderd/renderd.sock num_threads=4 tile_dir=/var/lib/mod_tile stats_file=/var/run/renderd/renderd.stats ;[renderd01] ;iphostname=::1 ;ipport=7654 ;num_threads=4 ;...


3

Preparing the vector PBF tiles is the first step. The MapBox Studio Classic is able to generate for you the vector PBF tiles (packed in MBTiles format) from any vector source (ShapeFiles, PostGIS, ...) and is quite easy to use. Under the hood it does the rendering with the mapnik+mapnik-vector-tile as you mentioned wrapped in tilelive (so scripting is ...


3

Take a look at Skeletron, which is a Python tool to merge adjacent lines. (Incidentally, I came here via your request in #osm IRC, but it would be polite for you to wait there a little more than 30 seconds to see if someone has an answer to your question!)


3

You can use mapnik.save_map() import mapnik m = mapnik.Map(1440,800) # ... add styling and layers ... mapnik.save_map(m, "output.xml")


3

What you're encountering is an unfortunate side-effect of a breaking change in 0.4 of tilestrata-mapnik (changelog). When specifying the path to an XML file, use pathname instead of xml. This parameter change was in order to accommodate people specifying XML that's in memory, not on disk. Sorry about that!


Only top voted, non community-wiki answers of a minimum length are eligible