I finally finished converting the OSM pbf-file to GeoServer layers.
This is what I did.
Downloaded the development version of GDAL. It used to be v2.0, but I think
it is now renamed to v1.10
Alter osmconf.ini (it is in your gdal-data folder).
This is my osmconf.ini:
************************************************************
#
# Configuration file for OSM import
#
# put here the name of keys for ways that are assumed to be polygons if
they are closed
# see http://wiki.openstreetmap.org/wiki/Map_Features
closed_ways_are_polygons=aeroway,amenity,boundary,building,craft,geological,historic,landuse,leisure,military,natural,office,place,shop,sport,tourism
# comment to avoid laundering of keys ( ':' turned into '_' )
attribute_name_laundering=yes
# uncomment to report all nodes, including the ones without any
(significant) tag
#report_all_nodes=yes
# uncomment to report all ways, including the ones without any
(significant) tag
#report_all_ways=yes
[points]
# common attributes
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
# keys to report as OGR fields
attributes=name,barrier,highway,ref,address,is_in,place,man_made
# keys that, alone, are not significant enough to report a node as a OGR
point
unsignificant=created_by,converted_by,source,time,ele
# keys that should NOT be reported in the "other_tags" field
ignore=created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
# uncomment to avoid creation of "other_tags" field
#other_tags=no
[lines]
# common attributes
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
# keys to report as OGR fields
attributes=name,aerialway,highway,bridge,waterway,railway,amenity,barrier,tunnel,ref,man_made
# keys that should NOT be reported in the "other_tags" field
ignore=created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
# uncomment to avoid creation of "other_tags" field
#other_tags=no
[multipolygons]
# common attributes
# note: for multipolygons, osm_id=yes instanciates a osm_id field for the
id of relations
# and a osm_way_id field for the id of closed ways. Both fields are
exclusively set.
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
# keys to report as OGR fields
attributes=name,type,highway,leisure,tourism,landuse,amenity,military,natural,power,aeroway,waterway,man_made,building
# Additionale:
admin_level,barrier,boundary,craft,geological,historic,land_area,office,place,shop,sport
# keys that should NOT be reported in the "other_tags" field
ignore=area,created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
# uncomment to avoid creation of "other_tags" field
#other_tags=no
[multilinestrings]
# common attributes
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
# keys to report as OGR fields
attributes=name,aerialway,highway,bridge,waterway,railway,amenity,barrier,tunnel,ref,man_made
# keys that should NOT be reported in the "other_tags" field
ignore=area,created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
# uncomment to avoid creation of "other_tags" field
#other_tags=no
[other_relations]
# common attributes
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
# keys to report as OGR fields
attributes=name,type
# keys that should NOT be reported in the "other_tags" field
ignore=area,created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
# uncomment to avoid creation of "other_tags" field
#other_tags=no
************************************************************
Now use
ogr2ogr -f SQLite -t_srs "EPSG:28992" -dsco spatialite=yes OSM-RD.sqlite
netherlands.osm.pbf -gt 20000 -progress --config OGR_SQLITE_SYNCHRONOUS OFF
--config OSM_COMPRESS_NODES YES
To convert it to a SpatiaLite database. Of course you can convert it to
PostGIS as well.
Now you can create a layer in GeoServer and use the FlorentDotMe SLD files.
I hope it will help somebody.
Thanks,
Paul
2012/11/15 Paul Meems <bontepaar...@gmail.com>
> I managed to get the OSM-lines in GeoServer using the FlorentDotMe SLD
> files.
> I'm now working on the multilines, polygons and point.
> When I'm done I'll report my steps here.
>
> Thanks for all your help.
>
> --
> Paul
>
>
>
> 2012/11/13 Ákos Maróy <a...@maroy.hu>
>
>> On 13/11/12 09:10, Paul Meems wrote:
>> > As Jukka says I'm experimenting with the new OSM driver of GDAL.
>> > I noticed it uses an ini-file to map OSM tags to property names.
>> > http://www.gdal.org/ogr/drv_osm.html
>> >
>> > It seems the properties the SDL is expecting are not all in the ini
>> file.
>> > I will investigate further and let you know my progress (will take a
>> > day or two due to other tasks).
>> the SDL files I worked with assumed an OSM import done with osm2pgsql.
>> they work with such an import 'out of the box'
>>
>>
>> ------------------------------------------------------------------------------
>> Monitor your physical, virtual and cloud infrastructure from a single
>> web console. Get in-depth insight into apps, servers, databases, vmware,
>> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
>> Pricing starts from $795 for 25 servers or applications!
>> http://p.sf.net/sfu/zoho_dev2dev_nov
>> _______________________________________________
>> Geoserver-users mailing list
>> Geoserver-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>
>
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users