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

Postgis Plugin: ERROR: COALESCE types text and integer cannot be matched #256

Closed
mihainiculita opened this issue Aug 5, 2017 · 4 comments

Comments

@mihainiculita
Copy link

mihainiculita commented Aug 5, 2017

Hello,

I am trying to work with kosmtik (at the base of the page you can see the details of the kosmtik package installed globally with npm on Ubuntu 16.04) on the openstreetmap-carto project.
When I run the server with project.mml I get in kosmtik web page this error:

Postgis Plugin: ERROR: COALESCE types text and integer cannot be matched LINE 15: ORDER BY COALESCE(layer,0), way_area DESC ^ in executeQuery Full sql was: 'SELECT * FROM (SELECT way, name, way_pixels, religion, COALESCE(wetland, landuse, "natural") AS feature FROM (SELECT way, COALESCE(name, '') AS name, religion, ('landuse_' || (CASE WHEN landuse IN ('forest', 'military') THEN landuse ELSE NULL END)) AS landuse, ('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock') THEN "natural" ELSE NULL END)) AS "natural", ('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" IN ('mud') THEN "natural" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland, way_area/NULLIF(0::real*0::real,0) AS way_pixels FROM planet_osm_polygon WHERE (landuse IN ('forest', 'military') OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock')) AND way_area > 0.01*0::real*0::real AND building IS NULL ORDER BY COALESCE(layer,0), way_area DESC ) AS features ) AS landcover_low_zoom LIMIT 0' encountered during parsing of layer 'landcover-low-zoom' in Layer

If I run the query in the Postgis database on the planet_osm_polygon table I get:

ERROR: column "pixel_width" does not exist
LINE 9: way_area/NULLIF(!pixel_width!::real*!pixel_hei...

So, what is happening? Why does this variable do not get passed to?

Thank you in advance!

kosmtik package.json

{
"_args": [
[
"kosmtik",
""
]
],
"_from": "kosmtik@latest",
"_id": "kosmtik@0.0.15",
"_inCache": true,
"_installable": true,
"_location": "/kosmtik",
"_nodeVersion": "6.9.5",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/kosmtik-0.0.15.tgz_1486849513324_0.8062275552656502"
},
"_npmUser": {
"email": "nebulon42@yandex.com",
"name": "nebulon42"
},
"_npmVersion": "3.10.10",
"_phantomChildren": {},
"_requested": {
"name": "kosmtik",
"raw": "kosmtik",
"rawSpec": "",
"scope": null,
"spec": "latest",
"type": "tag"
},
"_requiredBy": [
"#USER"
],
"_resolved": "https://registry.npmjs.org/kosmtik/-/kosmtik-0.0.15.tgz",
"_shasum": "1a092e04bcb79d4a25114b74a009c32f63d6ddc3",
"_shrinkwrap": null,
"_spec": "kosmtik",
"_where": "",
"author": {
"name": "Yohan Boniface"
},
"bin": {
"kosmtik": "./index.js"
},
"bugs": {
"url": "https://github.com/kosmtik/kosmtik/issues"
},
"dependencies": {
"carto": "^0.17.2",
"js-yaml": "^3.4.2",
"json-localizer": "0.0.3",
"leaflet": "^1.0.2",
"leaflet-formbuilder": "^0.2.0",
"leaflet-hash": "^0.2.1",
"mapnik": "3.5.14",
"mapnik-pool": "^0.1.3",
"nomnom": "^1.8.1",
"npm": "^4.0.5",
"request": "^2.64.0",
"semver": "^5.0.3"
},
"description": "Make maps with OpenStreetMap and Mapnik",
"devDependencies": {
"mocha": "^3.2.0"
},
"directories": {},
"dist": {
"shasum": "1a092e04bcb79d4a25114b74a009c32f63d6ddc3",
"tarball": "https://registry.npmjs.org/kosmtik/-/kosmtik-0.0.15.tgz"
},
"engines": {
"npm": ">=1.5.0"
},
"gitHead": "348512f3757b1516dbe777b4fedd3f4189c5b884",
"homepage": "https://github.com/kosmtik/kosmtik#readme",
"keywords": [
"design",
"map",
"openstreetmap"
],
"license": "WTFPL",
"main": "index.js",
"maintainers": [
{
"name": "nebulon42",
"email": "nebulon42@yandex.com"
},
{
"name": "ybon",
"email": "yb@enix.org"
}
],
"name": "kosmtik",
"optionalDependencies": {},
"preferGlobal": true,
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/kosmtik/kosmtik.git"
},
"scripts": {
"test": "node node_modules/.bin/mocha"
},
"version": "0.0.15"
}

@pnorman
Copy link
Contributor

pnorman commented Aug 5, 2017

This is not a Kosmtik error, but one reported by Mapnik. The query issued returned that error.

In this particular case, it looks like you didn't follow the OpenStreetMap Carto instructions for loading data.

@pnorman pnorman closed this as completed Aug 5, 2017
@mihainiculita
Copy link
Author

Yes indeed. I imported again with osm2pgsql specifying the style file. Now it works! Thank you!

@Schiewatir
Copy link

Hi, could you write your syntax to run osm2pgsql here, because I have the same error but I cannot solve it. In advance many appreciate.

@etrock
Copy link

etrock commented May 25, 2018

@arash-ariana
for me this :

osm2pgsql --slim -d gis -C 3600 --hstore -S openstreetmap-carto/openstreetmap-carto.style --tag-transform-script openstreetmap-carto/openstreetmap-carto.lua your.osm.pbf

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

4 participants