Skip to content
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

Use openstreetmap-carto-de with Kosmtik #48

Closed
astridx opened this issue Dec 5, 2019 · 3 comments
Closed

Use openstreetmap-carto-de with Kosmtik #48

astridx opened this issue Dec 5, 2019 · 3 comments

Comments

@astridx
Copy link

astridx commented Dec 5, 2019

I installed Kosmtik based on this tutorial. Everything works together with openstreetmap-carto. My goal is actually to use openstreetmap-carto-de. That's why I replaced openstreetmap-carto with this repo.

Expected behavior

I can use Kosmtik and see the de styles.

Actual behavior

I get an error.

OpenStreetMap Carto — Kosmtik(1)

Postgis Plugin: ERROR: column "localized_name_second" does not exist LINE 5: way, localized_name_second AS name, ^ in executeQuery Full sql was: 'SELECT * FROM (SELECT way, name, religion, way_pixels, is_building, surface, COALESCE(aeroway, amenity, wetland, power, landuse, leisure, man_made, "natural", shop, tourism, highway, railway) AS feature FROM (SELECT way, localized_name_second AS name, surface, ('aeroway_' || (CASE WHEN aeroway IN ('apron', 'aerodrome') THEN aeroway ELSE NULL END)) AS aeroway, ('amenity_' || (CASE WHEN amenity IN ('bicycle_parking', 'motorcycle_parking', 'university', 'college', 'school', 'taxi', 'hospital', 'kindergarten', 'grave_yard', 'prison', 'place_of_worship', 'clinic', 'ferry_terminal', 'marketplace', 'community_centre', 'social_facility', 'arts_centre', 'parking_space', 'bus_station', 'fire_station', 'police') OR amenity IN ('parking') AND (tags->'parking' NOT IN ('underground') OR (tags->'parking') IS NULL) THEN amenity ELSE NULL END)) AS amenity, ('landuse_' || (CASE WHEN landuse IN ('quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture', 'recreation_ground', 'village_green', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'plant_nursery', 'religious') THEN landuse ELSE NULL END)) AS landuse, ('shop_' || (CASE WHEN shop IN ('mall') AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) THEN shop ELSE NULL END)) AS shop, ('leisure_' || (CASE WHEN leisure IN ('swimming_pool', 'playground', 'park', 'recreation_ground', 'garden', 'golf_course', 'miniature_golf', 'sports_centre', 'stadium', 'pitch', 'ice_rink', 'track', 'dog_park', 'fitness_station') THEN leisure ELSE NULL END)) AS leisure, ('man_made_' || (CASE WHEN man_made IN ('works', 'wastewater_plant', 'water_works') THEN man_made ELSE NULL END)) AS man_made, ('natural_' || (CASE WHEN "natural" IN ('beach', 'shoal', 'heath', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') THEN "natural" ELSE NULL END)) AS "natural", ('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" = 'mud' THEN "natural" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland, ('power_' || (CASE WHEN power IN ('station', 'sub_station', 'substation', 'generator') THEN power ELSE NULL END)) AS power, ('tourism_' || (CASE WHEN tourism IN ('camp_site', 'caravan_site', 'picnic_site') THEN tourism ELSE NULL END)) AS tourism, ('highway_' || (CASE WHEN highway IN ('services', 'rest_area') THEN highway ELSE NULL END)) AS highway, ('railway_' || (CASE WHEN railway = 'station' THEN railway ELSE NULL END)) AS railway, CASE WHEN religion IN ('christian', 'jewish', 'muslim') THEN religion ELSE 'INT-generic'::text END AS religion, way_area/NULLIF(POW(3.402823466385289e+38*0.001*0.28,2),0) AS way_pixels, CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building, way_area FROM planet_osm_polygon WHERE (landuse IS NOT NULL OR leisure IS NOT NULL OR aeroway IN ('apron', 'aerodrome') OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'taxi', 'university', 'college', 'school', 'hospital', 'kindergarten', 'grave_yard', 'place_of_worship', 'prison', 'clinic', 'ferry_terminal', 'marketplace', 'community_centre', 'social_facility', 'arts_centre', 'parking_space', 'bus_station', 'fire_station', 'police') OR man_made IN ('works', 'wastewater_plant','water_works') OR "natural" IN ('beach', 'shoal', 'heath', 'mud', 'wetland', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') OR power IN ('station', 'sub_station', 'substation', 'generator') OR shop IN ('mall') OR tourism IN ('camp_site', 'caravan_site', 'picnic_site') OR highway IN ('services', 'rest_area') OR railway = 'station') AND way_area > 1*0.000000000000000::real*0.000000000000000::real ) AS landcover ORDER BY way_area DESC, feature ) AS features LIMIT 0' encountered during parsing of layer 'landcover' in Laye

My first attempt was to read the files mentioned here into my database. But I have no database called osm. My database is called gis and also fits in my opinion not to the SQL files.

postgres@astrid-TravelMate-5760G:~$ psql -d gis -f /home/astrid/src/openstreetmap-carto/contrib/use-upstream-database/view-line.sql 
psql:/home/astrid/src/openstreetmap-carto/contrib/use-upstream-database/view-line.sql:1: NOTICE:  view "planet_osm_line_de" does not exist, skipping
DROP VIEW
psql:/home/astrid/src/openstreetmap-carto/contrib/use-upstream-database/view-line.sql:56: ERROR:  function osm_tag2num(text) does not exist
LINE 44: osm_tag2num(tags->'width') as "num_width",
         ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
psql:/home/astrid/src/openstreetmap-carto/contrib/use-upstream-database/view-line.sql:58: ERROR:  relation "planet_osm_line_de" does not exist

What am I doing wrong?

@astridx
Copy link
Author

astridx commented Dec 6, 2019

To avoid duplicate answers: Because I think I am doing something wrong and there is no issue in this repo, I have asked the question in the German forum as well:
https://forum.openstreetmap.org/viewtopic.php?pid=771063#p771063

@giggls
Copy link
Owner

giggls commented Dec 6, 2019

Support for upstream database layout is in contrib for a reason. I do not use this myself and I would not recommend using it either.

Looks like you did not apply osm_tag2num.sql.

German style database layout is working fine for rendering upstream style so no need to use their database layout if you want to render both.

Regards

Sven

@astridx
Copy link
Author

astridx commented Dec 6, 2019

Many thanks Sven.
I could not test it yet. But now I see what I have to change.
Regards
Astrid

@astridx astridx closed this as completed Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants