0

In an .osm file, there are <TAG ... /> elements like

<way visible="true" id="-4409" timestamp="1970-01-01T00:00:00Z" version="1"> <nd ref="-21845"/> <tag k="fcc" v="A40"/> <tag k="len_miles" v="0.037850000000000002"/> <tag k="et_id" v="4407"/>

The "k" and "v" in these refer to key - value pairs. What are the equivalent things called in shapefiles? Are they called (attribute, value) pairs? I see they're visible in the Attribute Table in QGIS and the k's correspond to columns and the v's are what is in the cells of that table.

user1416227
  • 103
  • 3
  • What shapefile converter do you refer to? Shapefiles have a general concept of attaching an datatable that refers the geoobjects 1:1. You can add 2 cols ("k","v") with varchar type that hold the OSM pairs, or you add cols that correspond to the OSM keys you want to replicate and add the value as content. – Mapper Jun 01 '14 at 06:44
  • I am doing my own conversion, in python. I am concerned about the terminology mostly so I can communicate accurately what I have done. – user1416227 Jun 01 '14 at 23:30

2 Answers2

2

In dBase terminology, each row is a "record" and each column is a "field". Different GIS software may refer to these objects differently. Key-Value and Row-Column are sufficiently different concepts that I'd caution against trying to apply a simple equivalence.

Vince
  • 20,017
  • 15
  • 45
  • 64
1

That sounds fine to me. The equivalent of a key pair in a shape file is an attribute value combination. In the attribute table the attribute is the column and the values are shown across the row. Each row is a feature and has an id associated with it, these are system generated and it's best to ignore them.

Each entity in an XML file becomes a feature in the shapefile, each key becomes an attribute for the whole shapefile and each value is populated in the row. Where this situation can break down is if a key-value has a different name or new keys are introduced... this is possible in an XML enclosure but is not possible in a shapefile.

Michael Stimson
  • 25,566
  • 2
  • 35
  • 74