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

hi i am putting osm data into postgres using osmosis the command i use is :

osmosis --read-xml file="/home/ubuntu/osmosis/bin/eu_filterxrx.osm" --write-apidb host="localhost" database="osm_test-1" user="shafi" password="lhoft" validateSchemaVersion="no"

writing it to an apidb. Doing this makes converts my latitude and longitudes to integers for some reason

orignal data looks like this:

osm data viewed in notepad++ as you can see lat and long are both decimals above. but once i put the data into postgres and i view it using pgadmin the lat and lon are no longer deicmals they are now integers making them useless. how do i stop it doing that,

Thanks in Advance

data once it is inside DB

asked 30 Nov '20, 17:03

shafi-as's gravatar image

shafi-as
107712
accept rate: 0%


You have explicitly asked for an "apidb" database. The "apidb" schema is optimised for processing by the "openstreetmap-website" software and nothing else. The openstreetmap-website code expects the latitudes and longitudes to be written exactly like they are here.

If you want to do anything else with the OSM data than using it with the openstreetmap-website code, then do not use the apidb schema. Import the data with osm2pgsql instead.

permanent link

answered 30 Nov '20, 17:35

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

i need to use the apidb schema as i have cloned the osm webpage and im viewing this data in josm on my own private server, osm2pgsql doesnt allow me to do that from what i have heard.

(30 Nov '20, 18:21) shafi-as
1

True, but if you view the data in JOSM then everything is fine, as the openstreetmap-website (or cgimap) code that sits between JOSM and the database will convert these coordinates for you.

(30 Nov '20, 18:24) Frederik Ramm ♦

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:

×710
×252
×165
×100
×34

question asked: 30 Nov '20, 17:03

question was seen: 1,892 times

last updated: 30 Nov '20, 18:24

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