From gormer at gmail.com Tue Jan 11 07:20:49 2011 From: gormer at gmail.com (Gorm Eriksen) Date: Tue, 11 Jan 2011 13:20:49 +0100 Subject: [Osmlib-user] Creating polygons from boundaries Message-ID: Hi, I have an question regarding creating polygons from OSM boundary data that we need for a Norwegian version of fixmystreet. The data consist of a relation of type 'boundary' that contains a number of member ways The ways themselves are closed. I have tried to change the type of the relation to 'polygon' to prevent the exception raised on the boundary type, but the data file produced is empty when I work with polygons (polylines works fine). I have put a copy of the test OSM file here: http://dl.dropbox.com/u/4954103/nordland.osm The oxr file I have used looks like this: setup :Shp do polygon :area do string :id, 16 string :name, 32 end end relations do :area << { :id => ref, :name => name } end Any idea why this creates an empty area.shp file? Am I missing something or do I need a more clever oxr file? thanks for any help, - Gorm E From jochen at remote.org Thu Jan 13 04:36:43 2011 From: jochen at remote.org (Jochen Topf) Date: Thu, 13 Jan 2011 22:36:43 +1300 Subject: [Osmlib-user] Creating polygons from boundaries In-Reply-To: References: Message-ID: <20110113093643.GA5501@atlantis> osmlib does not handle boundary or multipolygon relations. Have a look at Osmium. It might do what you need: http://blog.jochentopf.com/2011-01-05-osmium.html Jochen On Tue, Jan 11, 2011 at 01:20:49PM +0100, Gorm Eriksen wrote: > Date: Tue, 11 Jan 2011 13:20:49 +0100 > From: Gorm Eriksen > To: osmlib-user at rubyforge.org > Subject: [Osmlib-user] Creating polygons from boundaries > > Hi, I have an question regarding creating polygons from OSM boundary > data that we need for a Norwegian version of fixmystreet. > > The data consist of a relation of type 'boundary' that contains a > number of member ways The ways themselves are closed. I have tried to > change the type of the relation to 'polygon' to prevent the exception > raised on the boundary type, but the data file produced is empty when > I work with polygons (polylines works fine). > > I have put a copy of the test OSM file here: > http://dl.dropbox.com/u/4954103/nordland.osm > > The oxr file I have used looks like this: > > setup :Shp do > polygon :area do > string :id, 16 > string :name, 32 > end > end > > relations do > :area << { :id => ref, :name => name } > end > > Any idea why this creates an empty area.shp file? Am I missing > something or do I need a more clever oxr file? > > thanks for any help, > > - Gorm E > _______________________________________________ > Osmlib-user mailing list > Osmlib-user at rubyforge.org > http://rubyforge.org/mailman/listinfo/osmlib-user > -- Jochen Topf jochen at remote.org http://www.remote.org/jochen/ +49-721-388298