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

I have been following this link to install on centos most of the steps work except for the style style step had issues. My current issue this An error occurred while loading the map layer 'default': Could not create datasource for type: 'postgis' (searched for datasource plugins in '/usr/local/lib/mapnik/input') encountered during parsing of layer 'landuse_gen0' in Layer at line 262 of '/usr/local/share/maps/style/OSMBright/OSMBright.xml'. Below is my renderd.conf

[renderd]
socketname=/var/run/renderd/renderd.sock
plugins_dir=/usr/local/lib/mapnik/input
font_dir=/usr/share/fonts/ 
XML=/usr/local/share/maps/style/OSMBright/OSMBright.xml
HOST=localhost

[mapnik]
socketname=/var/run/renderd/renderd.sock
plugins_dir=/usr/local/lib/mapnik/input
font_dir=/usr/share/fonts/ 
XML=/usr/local/share/maps/style/OSMBright/OSMBright.xml
HOST=localhost
;plugins_dir=/usr/lib/mapnik/input
;font_dir=/usr/share/fonts/truetype
font_dir_recurse=1

[default]
socketname=/var/run/renderd/renderd.sock
plugins_dir=/usr/local/lib/mapnik/input
font_dir=/usr/share/fonts/ 
XML=/usr/local/share/maps/style/OSMBright/OSMBright.xml
HOST=localhost

The issue in my OSMBright.xml is pointing to this lines. <layer name="landuse_gen0" status="on" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over"> <stylename>landuse_gen0</stylename> <datasource> <parameter name="dbname"><![CDATA[gis]]></parameter> <parameter name="extent"><![CDATA[-20037508.34,-20037508.34,20037508.34,20037508.34]]></parameter> <parameter name="geometry_field"><![CDATA[way]]></parameter> <parameter name="id"><![CDATA[landuse_gen0]]></parameter> <parameter name="key_field"><![CDATA[]]></parameter> <parameter name="project"><![CDATA[osm-bright-imposm]]></parameter> <parameter name="srs"><![CDATA[+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over]]></parameter> <parameter name="table"><![CDATA[( SELECT way, way_area AS area, COALESCE(landuse, leisure, "natural", highway, amenity, tourism) AS type FROM planet_osm_polygon WHERE way_area > 100000 ORDER BY way_area DESC ) AS data]]></parameter> <parameter name="type"><![CDATA[postgis]]></parameter> </datasource> </layer>

I have installed all of this yum install postgresql96-libs postgresql96-contrib postgresql96-devel

yum install postgis2_96 postgis2_96-client postgis2_96-utils and rebuild mapnik yet the same issue.

asked 06 Jun '17, 20:34

newbie14's gravatar image

newbie14
319912
accept rate: 0%

edited 07 Jun '17, 03:49

I have tried DROP DATABASE gis; and repeat these steps again sudo -u postgres createuser -s osm sudo -u postgres createuser apache sudo -u postgres createdb -E UTF8 -O osm gis sudo -u postgres psql \c gis CREATE EXTENSION postgis; ALTER TABLE geometry_columns OWNER TO osm; ALTER TABLE spatial_ref_sys OWNER TO osm; \q yet the same results I get issue on the ould not create datasource for type: 'postgis' (searched for datasource plugins in '/usr/local/lib/mapnik/input')

(07 Jun '17, 18:26) newbie14

You've got a series of issues there:

  1. Ignore the iniparser errors
  2. Fix the font directory in the config to where the fonts actually live (and install whatever fonts are needed)
  3. Fix the path to the mapnik.xml file in the config to point to wherever you created it.

You'll want to fix the database access issue that you logged here first though.

permanent link

answered 06 Jun '17, 21:11

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

I have actually encountered a lot of problem like not var/run/renderd directory etc all I have build and settle. I also had issue with font so I just took the dejavu-fonts-ttf-2.33 from the mapnik and dump into /usr/share/fonts. Most issue resolved now I got one issue which I am stucked An error occurred while loading the map layer 'default': Could not create datasource for type: 'postgis' (searched for datasource plugins in '/usr/local/lib/mapnik/input') encountered during parsing of layer 'landuse_gen0' in Layer at line 262 of '/usr/local/share/maps/style/OSMBright/OSMBright.xml'

(07 Jun '17, 03:45) newbie14

Re postgis, I'm guessing that you haven't configured postgis for your database properly. Beyond that it's difficult to say (and I've no ideas what gotchas you'll see with a postgis install with postgres 9.6 on Centos).

(08 Jun '17, 13:20) SomeoneElse ♦

@someoneelse I have tried many method remove the 9.6 and install 9.5 and ensure all the postgis have been installed cause else this command CREATE EXTENSION postgis; should not work right. So I tried all its still facing the same issue. I think looks like centos is not ready for this osm.

(09 Jun '17, 16:42) newbie14

@someoneelse it looks more like a mapnik issue missing the postgis in its input file.

(09 Jun '17, 16:45) newbie14

I think looks like centos is not ready for this osm.

I'm sure that it'd be possible to get it working (and https://github.com/lijenpan/osm/blob/master/osm-centos7.md covers postgis of course) but it was never going to be as straightforward as the alternatives, unfortunately, as mentioned way back on https://forum.openstreetmap.org/viewtopic.php?pid=648795#p648795 .

At some point someone (maybe even me) will have a go at a Cantos "switch2osm" example including the jumping through hoops that you need to do for node and carto with the latest osm-carto style, but it's some way down the list for me alas.

Edit:

@someoneelse it looks more like a mapnik issue missing the postgis in its input file.

Quite possibly, but mapnik is something that I poke only with a very long stick when absolutely necessary :)

(09 Jun '17, 16:48) SomeoneElse ♦

@someoneelse ok I got not choice I will getting ready a new machine with ubuntu16.04 cause I wasted a lot of time on centos now is leading no where. So for ubuntu it must a be minimal installation does it need gui or will do with out it? What else I will need to be prepared for this?

(10 Jun '17, 06:15) newbie14

I'd start with https://switch2osm.org/manually-building-a-tile-server-16-04-2-lts/ (I updated it yesterday to work with newer "carto" versions). No GUI needed, just Ubuntu server 16.04 LTS.

(11 Jun '17, 17:01) SomeoneElse ♦
showing 5 of 7 show 2 more comments

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:

×440

question asked: 06 Jun '17, 20:34

question was seen: 2,046 times

last updated: 11 Jun '17, 17:01

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