Openstreetmap Administrative Polygon Shape Files with Hierarchy
Total Page:16
File Type:pdf, Size:1020Kb
OpenStreetMap Adminstrative Polygon Shape Files with Hierarchy // Version 1.1 OpenStreetMap Administrative Polygon Shape Files with Hierarchy 2019-11-11 Michael Reichert <[email protected]> Table of Contents 1 Preface........................................................................................................................................................1 2 Introduction...............................................................................................................................................2 2.1 Versions.............................................................................................................................................2 2.2 Map datum........................................................................................................................................2 2.! Character encoding.........................................................................................................................2 2.# A%ribute names...............................................................................................................................2 2.& Layers.................................................................................................................................................2 2.) Common attributes.........................................................................................................................2 2.* Points and Areas..............................................................................................................................! 2.+ S illo-er Shape Files.......................................................................................................................! ! Codes and Feature Classes....................................................................................................................# # Ho0 hierarch( is modeled....................................................................................................................# #.1 Structure............................................................................................................................................# #.2 Exam le.............................................................................................................................................) & Possible Variations...................................................................................................................................* Version History and Copyright Version Created At Changes 1.3 231*412411 Initial document 1.1 2315411411 6escribe clipping to coastline and simplification, partial re0rite of the document. Add int9name field, document geomt( e field be%er. "o (right in this document is held b( Geofabrik Gmb/. 1 Preface ;e O enStreetMap (<,M> pro?ect (000.o enstreetmap.org) has collected an enormous amount of free s atial data and the database is gro0ing e-er( day. Many peo le want to use this data for their o0n GI, pro?ects but have been hindered b( the use of a non-standard data format in the O,M pro?ect. :eofabrik has pioneered a map ing from O,M features to a traditional GI, structure with their “O,M Data in Layered GI, Formats” s eci7cation. That s eci7cation co-ers most lo04 le-el as ects of O,M. 1 OpenStreetMap Adminstrative Polygon Shape Files with Hierarchy // Version 1.1 ;is document describes an three add4ons to the “adminareas” layer of the “O,M Data in 'ayered GI, Formats” b( GeofabrikB • $n additional map ing of detailed O,M structures concerning the hierarch( of administrati-e units (from countries o-er counties to munic alities> is added to the layer. The hierarch( is re resented b( additional fields for each feature8 referencing u er4le-el entities b( their O,M I6. See section # for details. • $dministrati-e boundaries in O,M include territorial waters. Ho0e-er8 many use cases reCuire geometries that re resent the actual countr( outlines8 i.e. boundaries should be cli ed to the coast. This o tion does not add any additional fields. • Doundar( pol(gons ha-ing man( vertices are a challenge for some use cases and need a lot of disk s ace. We can sim lif( these boundar( lines. ;e o tions are full( back0ard com atible. You are free to choose onl( one of the three. 2 Introduction 2.1 Versions ;is is no static document. Ne0 versions of this document are likel( to ap ear from time to time. If the de7nition of la(ers or features is changed signi7cantl(8 the layers will get ne0 -ersion identi7ers. 'ayer names will use version numbers with leading '-H and without the embedded '.HB So -ersion 0.1 of this document will use the suI2 “v31A8 version 2.* will use “-2*” (minor -ersions abo-e 9 are not allo0ed>. 2.2 Map datum $ll coordinates are unpro?ected W:,+# (EPS:B#!2)>. 2.3 Character encoding $ll strings are encoded in UK.4+. 2.4 Attribute names $ll attribute names are lo0er case and are less than 11 characters long so that the( are not truncated in shape7les. 2 OpenStreetMap Adminstrative Polygon Shape Files with Hierarchy // Version 1.1 2.5 Layers $dministrati-e pol(gon shape files with hierarch( b( Geofabrik consist of onl( one single layer called adminareas. 2.6 Common attributes Most tablesLshape files b( Geofabrik will have the follo0ing columnsLattributesB Attribute PostGIS Type Descriptiosteps/gis-roads-v06 p!n osm_id V$R"/$R <,M Id taken from the Id of this feature (node9id, wa(9id, or relation9id> in =13> the O,M database. In case se-eral features in the O,M database are joined into one feature, this is one of the Ids. This I6 is not necessaril( uniCue because one O,M ob?ect can result in se-eral geometr( ob?ects. $lso note that when doing sha e file e2 orts, this will be e2 orted as a V$R"/$R t(pe since sha e files donHt su ort long integers. lastchange KIME,K$MP 'ast change of this feature. Comes from the O,M last9changed a%ribute. EIK/<JK Reflects changes in the a%ributes of a featureO changes in the geometr( will KIME Z<G1 not necessaril( change this. code ,MA''IGK # digit code (bet0een 1333 and 9555> defining the feature class. The first one =2 B(tes) or t0o digits define the la(er8 the last t0o or three digits the class inside a la(er. fclass V$R"/$R=#3> "lass name of this feature. This does not add an( information that is not alread( in the “codeA field but it is be%er readable. name V$R"/$R=133> Game of this feature, like a street or place name. If the name in O,M contains ob-iousl( wrong data such as “fixmeA or “noneA, it will be empt(. int9name V$R"/$R=133> 1nglish name of this feature (<,M tag nameBenPQ, fallbackB int9namePQ>. If there is no EnglishLinternational name, this field is empt(. It is not guaranteed that this field contains A,"II characters onl(. geomt(pe V$R"/$R=1> ;is field is a-ailable for back0ard compatibilit( with the standard sha e file. It indicates the O,M ob?ect t( e (GB node, WB wa(, RB relation>. This la(er contains features deri-ed from relations onl(. Therefore, this field is al0a(s set to “RA. ;e code and the combination of layer name and fclass al0a(s contains the same information. 2.7 Spillover Shape Files Ehen a certain layer becomes too large for one shape file (shape files are limited to 2 GD in siRe>8 it will automaticall( s ill o-er into additional shape files. A shape file named “gis9osm9adminareas9-1391.sh ” will have s illo-er shape files names “gis9osm9adminareas9-1392.sh A8 “gis9osm9adminareas9-139!.sh A and so on. 3 Codes and Feature Classes ;is layer is similar the the “boundaries” layer but it contains pol(gons built from boundar( lines. This layer does have a name a%ribute. $dditional a%ributesB 3 OpenStreetMap Adminstrative Polygon Shape Files with Hierarchy // Version 1.1 Attribute PostGIS Type Description OSM Tags ostalcode V$R"/$R=13> Postal code for this administrati-e area. Postal ostal9codePQ codes are onl( a-ailable for a fe0 administrati-e areas, the( are not necessaril( uniCue. ;e follo0ing feature classes e2ist in this layerB code !ayer $c!ass Description OS# Tags 1233 adminareas boundar(Padministrati- e 1231 adminareas admin9le-el1 + admin9le-el=1 1232 adminareas national Gational border + admin9le-el=2 123! adminareas admin9le-el! + admin9le-elP! 123# adminareas admin9le-el# Jsuall( a border of the first le-el belo0 + admin9le-elP# nationalO NJK,42 (:erman(B Land, .ranceB rTgion8 UUB EnglandL ScotlandL Eales...). 123& adminareas admin9le-el& + admin9le-elP& 123) adminareas admin9le-el) Jsuall( a border of the second le-el + admin9le-elP) belo0 nationalO NJK,4! (:erman(B Ureis, FranceB dTpartement, UUB count(...). 123* adminareas admin9le-el* + admin9le-elP* 123+ adminareas admin9le-el+ Jsuall( a cit( or borough boundar(. + admin9le-elP+ 1235 adminareas admin9le-el5 + admin9le-elP5 1213 adminareas admin9le-el13 + admin9le-el=13 1211 adminareas admin9le-el11 + admin9le-el=11 Note that due to editing errors introduced by OpenStreetMap contributors and also due to lack of data in some areas, there is no guarantee that these areas are complete; there may always be missing bits. Contact Geofabrik if you are interested in a redacted data set. ;e e2act meaning of the admin_le-els 1 to 11 varies bet0een countries and is documented in detail on the O enStreetMap WikiB h% s BLL0iki.o enstreetmap.org/0ikiL Kag:boundar(=administrati-e 4 How hierarchy is modeled If reCuested8 administrati-e boundar( shape files contain information about the hierarch(. 4.1 Structure <ur administrati-e shape file contain hierarch( information about the relationshi between two administrati-e units. Each feature has a%ributes pointing to features further