NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'm in the process of rebuilding the maps and overlays for maps.openstreetmap.ie but running into some issues with existing style sheets. I've already done this once in the past year but had to redo it again recently and running into issues. It's worth noting that most of the styles are still based on the old XML format (that's what I inherited) and don't use the newer CartoCSS.

I've followed the guide on switch2osm with a view deviations (we have more than 10 layers to render so have compile some things from source).

The style file I used for the import is here.

The XML renderd config I'm using the for the name:ga map tiles is here

The command line for the initial import I did is as follows:

osm2pgsql   \
  --database gis \
  --create \
  --slim \
  --multi-geometry \
  --hstore \
  --tag-transform-script /data/src/openstreetmap-carto/openstreetmap-carto.lua \
  --cache 2500 \
  --number-processes 1 \
  --style /usr/local/share/osm2pgsql/default.style.IE \
  /home/roles/planet/data/ireland-and-northern-ireland-2019-11-23T21\:19\:02Z.osm.pbf

The errors I'm getting are as follows:

Nov 30 17:32:02 hostname renderd[9961]: An error occurred while loading the map layer 'osm-ga': Postgis Plugin: ERROR:  COALESCE types text and integer cannot be matched#012LINE 18:   ORDER BY COALESCE(layer,0), way_area DESC#012^#012in executeQuery Full sql was: 'SELECT * FROM (SELECT#012    way,#012    "natural",#012    waterway,#012    landuse,#012    COALESCE(tags->'name:ga', '') as name,#012    way_area/NULLIF(0::real*0::real,0) AS way_pixels,#012    CASE WHEN tags->'intermittent' IN ('yes')#012      OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')#012      THEN 'yes' ELSE 'no' END AS int_intermittent#012  FROM planet_osm_polygon#012  WHERE#012    (waterway IN ('dock', 'riverbank')#012      OR landuse IN ('reservoir', 'basin')#012      OR "natural" IN ('water', 'glacier'))#012    AND building IS NULL#012    AND way_area > 1*0::real*0::real#012  ORDER BY COALESCE(layer,0), way_area DESC#012) AS water_areas LIMIT 0'#012  encountered during parsing of layer 'water-areas' in Layer at line 8462 of '/data/maps/mapnik/osm-ga.xml'

It specifically seems to be barfing on:

ORDER BY COALESCE(layer,0), way_area) AS water_areas

I'm hoping this is something simple and someone with more experience has encountered this before and can point me in the right direction before I go down the "trial and error" rabbit hole... :)

asked 30 Nov '19, 18:47

d%C3%B3nal's gravatar image

dónal
156129
accept rate: 20%


Answering my own question...

This was indeed the issue:

ORDER BY COALESCE(layer,0)

previously it appears the layer column was declared as an int in the osm_line table but nows it's text... Still investigating what caused the change (I may have missed a step somewhere).

I reviewed the XML change and ensured any 0s were enclosed in single quotes.

e.g.

ORDER BY COALESCE(layer,'0')
permanent link

answered 30 Nov '19, 19:39

d%C3%B3nal's gravatar image

dónal
156129
accept rate: 20%

edited 30 Nov '19, 19:41

I've marked your answer as an answer - hope you don't mind!

As an aside - if you did want to deploy a map style "like OpenStreetMap.org standard tiles but with Irish names" it would be relatively straightforward to do that via the lua scripting that osm2pgsql supports. Not that I'm saying that you need to change; but if you did want to, it needn't be that difficult. Let me know if you're thinking about going down that route and would like a nudge in the right direction.

(05 Dec '19, 01:36) SomeoneElse ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×341
×204
×22
×13
×10

question asked: 30 Nov '19, 18:47

question was seen: 2,020 times

last updated: 05 Dec '19, 01:36

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum