[H-GEN] Extracting info from XML open street map file

mick bareman at tpg.com.au
Tue Jan 26 21:17:55 EST 2016


On Tue, 26 Jan 2016 22:13:50 +1000
Russell Stuart <russell-humbug at stuart.id.au> wrote:

> [ Humbug *General* list - semi-serious discussions about Humbug and     ]
> [ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
> 
> On Tue, 2016-01-26 at 07:41 +0000, mick wrote:
> > > > Generic key/value lines:
> > > > ========================
> > > > 		<tag k="107" v="96"/>
> > > > 		<tag k="1744_field_ref" v="143"/>
> > > > 		<tag k="1744_field_ref" v="94"/>
> > > > 		<tag k="1860name" v="Aberargie Mill (Corn & Flour)"/>
> > > >   
> > read through keys.txt and add line in the osm2pgsql .style file
> > run osm2pgsql with the *.style to create postgis database
> > import database into Qgis for use.
> > 
> > OsmType is the object type (node = point, way=line or polygon.  
> ...
> > osm2pgsql .style:
> > ================
> > # OsmType	Tag			DataType	Flags
> > =============================================================
> > node,way	107			text		delete
> > node,way	1744			text		delete
> > node,way	1860name		text		delete
> >
> > Hope this makes more sense  
> 
> It makes sense in that I gather you add one line to the .style file per
> unique "<tag k='value'", and the Tag column of that line is the 'value'
> truncated at the first underscore if it contains one.  But you don't say
> how you decide what to put the other columns (OsmType, DataType and
> Flags) in that line.
> 

OsmType the values used are either "node", "way" or "node,way" can safely default
======= to "node,way"

Tag is the complete contents "value"
===

DataType Can default to "text"
========

Flags Can default to "delete"
=====

Flags are resolved according to what parts of the data are required to suit the theme of the layer I'm extracting. There is no way to avoid doing that manually but from what I've encountered while trying extract the keys manually about 70% would be deleted whatever layer I'm extracting, 25% could safely default to delete, the rest require thinking about and setting manually. 




More information about the General mailing list