osm -> osm2pgsql -> PostGIS -> TileMill

yonel's Avatar

yonel

06 Sep, 2011 08:21 AM

Hello,
First, thanks a lot for such a great Map tool !
I'm trying to display stuff in tilemill from an import of a .osm in PostGIS .
The part osm -> osm2pgsql works fine, I get the classical gis database created with planet_osm_roads and planet_osm_lines tables.
I checked the data imported in PostGIS with QGis by displaying the planet_osm_roads data and I get them properly displayed so my db content looks ok.
Then, I create a PostGIS layer in TileMill, this is ok as well (with pwd, usr dbname etc...).
I try to get the roads displayed so I set the table name to "planet_osm_roads" in the layer POSTGIS property.
The name of my layer is "thisisatest".
When I try to browse the data from the layer (with the magnify glass), I get some values so I expect the layer is correct. The type of data is also properly displayed (line with the icon *-*)
Then I create a very basic style for this layer :
#thisisatest {
   line-color: #C00;
   line-width: 1;
}
At this stage I would expect something to be displayed but nothing seems to happen :/
Do you have any idea why I don't get the tiles updated ? (and the roads displayed) ?
Thanks a lot for your support.
P.S : I'm using the tilemill binary Version 0.5.0 (2876) on MacOS X (snow leopard).
Best regards,
Lionel.

  1. Support Staff 2 Posted by Will White on 07 Sep, 2011 02:58 AM

    Will White's Avatar

    Hi Lionel,
    Try using planet_osm_lines instead of planet_osm_roads and have a look at this guide that was just posted today. Let me know if that helps!

    Will

  2. 3 Posted by yonel on 07 Sep, 2011 06:57 AM

    yonel's Avatar

    Hi Will,
    Thanks a lot for the link: it showed me my mistake, the projection wasn't properly set (I thought the import was using the WGS84 but I was wrong. with 900913 it's now ok)
    Now with the correct one, it's working (even with the planet_osm_line table) ! I can now improve my map design skills !
    Lionel .

  3. yonel closed this discussion on 07 Sep, 2011 08:00 AM.

  4. Will White re-opened this discussion on 07 Sep, 2011 12:22 PM

  5. Support Staff 4 Posted by Will White on 07 Sep, 2011 12:22 PM

    Will White's Avatar

    Glad it's working now!

    Sent from my iPhone

  6. yonel closed this discussion on 12 Sep, 2011 09:00 AM.

  7. yonel re-opened this discussion on 12 Sep, 2011 09:01 AM

  8. 5 Posted by yonel on 12 Sep, 2011 09:19 AM

    yonel's Avatar

    Hi again,
    I just discovered that there are some beautiful stylesheets osm-bright that are using OSM data imported in PostGIS.
    https://github.com/mapbox/osm-bright/
    Sorry for such a newby question but they refer to "cascadenik" templates, and they seems to differ from templates used in tilemill right ?
    Is there a way to inherit from such osm-bright templates and use them in tilemill ? (I tried to use them directly into a new tilemill project and of course, this does not work).
    Thanks.
    Lionel.

  9. Support Staff 6 Posted by AJ on 13 Sep, 2011 12:30 AM

    AJ's Avatar

    Hi Lionel,

    Cascadenik is in some ways very similar to Carto (the code that TileMill uses) unfortunately a few key features are incompatible. Some fairly involved restructuring of the stylesheet would be required, and I am not aware of any automatic conversion tools.

    We don't have plans for a direct port of the Cascadenik version of OSM Bright to Carto, however a next-gen rewrite with TileMill compatibility is in development.

    Apart from it being incomplete, the main problem with the new version for you right now is that it expects an OSM database generated by ImpOSM instead of osm2pgsql. I do plan to re-add support for osm2pgsql eventually, but it is not my focus right now.

  10. 7 Posted by yonel on 13 Sep, 2011 07:55 PM

    yonel's Avatar

    Thanks for your very detailled answer .
    I think I get a better picture about how all those tools can be used together.
    I didn't know impOSM (I'm only using osm2pgsql for now), I'll have a look at it.
    Lionel.

  11. Will White closed this discussion on 14 Sep, 2011 08:48 PM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

23 May, 2013 09:07 AM
23 May, 2013 08:47 AM
23 May, 2013 07:51 AM
23 May, 2013 07:38 AM
23 May, 2013 06:46 AM

 

23 May, 2013 04:55 AM