NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I am writing a script to sync points from a site and amenity=recycling tags in OSM so I need to store OSM id, version and type in local database. What are the best column types? UNSIGNED BIGINT, UNSIGNED INT and SET?

Bonus points for other metadata fields info.

Extra bonus points for PostgreSQL info.

asked 07 Oct '14, 13:38

int_ua's gravatar image

int_ua
27591221
accept rate: 0%

edited 07 Oct '14, 13:43


Unsigned bigint and smallint for the id and version. Note sure what "type" is in your case. If it's types of recycling amenities, you probably want text. If it's about way/node/relation, set looks like what you want, but it might be better to use three different tables instead.

The OSM community usually uses postgres instead of mysql, so you're probably better off with PG (there are many non-osm-related reasons you should do that anyway, but let's keep this to the point). The answers for pg types are pretty much the same as for mysql.

There are a few tools that import osm data into postgres which might interest you.

permanent link

answered 07 Oct '14, 16:14

Vincent%20de%20Phily's gravatar image

Vincent de P... ♦
17.3k18152249
accept rate: 19%

edited 07 Oct '14, 16:15

way/node, yes.

(08 Oct '14, 13:04) int_ua

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×21
×11

question asked: 07 Oct '14, 13:38

question was seen: 3,214 times

last updated: 08 Oct '14, 13:04

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum