[OSM-talk] How to convert OSM into GML - examples needed

Artem Pavlenko artem at pavlenko.uklinux.net
Tue Feb 6 09:37:32 GMT 2007


Casey,
I'm assuming you're on a Linux box  and you have postgresql/postgis installed 
(see http://www.postgresql.org http://www.postgis.org for howto) 

1.  Get the source 
svn co http://svn.openstreetmap.org/utils/osm2pgsql

2. cd ./osm2pgsql 
    make
 ( You might have to modify Makefile to fit your settings)
3.   ./osm2pgsql planet.osm  > planet.sql
You can then load planet.sql into postgresql :

psql -Uusername dbname  < planet.sql

4. I dont use GRASS myself but I'm pretty sure it would let you connect to 
postgis db and load osm data. You can also use ogr2ogr utility to convert 
postgis table into something else e.g shapefiles . Just google for gdal/ogr

Cheers
Artem

On Tuesday 06 February 2007 09:13, yuri bay wrote:
> Artem,
>
> Many thanks for your reply.  I am very interested to learn more, would you
> mind letting me know more detail about the step involves, for instance,
> where do I go to load OSM into postgresql/postgis, I mean where do I put
> the file osm2pgsql.c and what do I do with it?  And then how / where do I
> read it into GRASS.  Sorry but I am newbie in this and your help is much
> appreciated!
>
> Best Regards
> Casey
>
> >From: Artem Pavlenko <artem at pavlenko.uklinux.net>
> >To: talk at openstreetmap.org
> >CC: "yuri bay" <ksh_wong at msn.com>
> >Subject: Re: [OSM-talk] How to convert OSM into GML - examples needed
> >Date: Mon, 5 Feb 2007 18:23:18 +0000
> >
> >You can load planet.osm into postgresql/postgis with osm2pgsql.c
> >Then read direclty into Grass or export to GML/KML/Shapefiles whatever
> >using
> >PostGIS native functionality or ogr2ogr
> >
> >Cheers
> >Artem
> >
> >On Monday 05 February 2007 17:37, yuri bay wrote:
> > > Hi,
> > >
> > > Does anyone know where can I find examples on how (i.e. the steps
> >
> >involve
> >
> > > in) to convert OSM into GML?  Is this the best way to import OSM into
> > > GRASS? I am using WinGRASS on win2k.  I have the OSM dataset
> >
> >(planet.osm)
> >
> > > but not sure what to do with it.  How can I start to convert it into
> >
> >GML?
> >
> > > Do I need any other software, script editor or programming language
> > > such
> >
> >as
> >
> > > C ? Your help is much appreciated.
> > >
> > > Regards
> > > Casey Wong
> > >
> > > _________________________________________________________________
> > > MSN Hotmail is evolving  check out the new Windows Live Mail
> > > http://ideas.live.com
>
> _________________________________________________________________
> Click Here To Find Your Perfect Match This Valentines!
> http://msnuk.match.com/




More information about the talk mailing list