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

Hello,

I am currently working on an application which would display a map and our position indoors. Not to go in precise details, we would like to display everything in meters from an fixed position (x,y) inside the building, so that we can get rid of latitude and longitude.

To do so, I have my .osm files filled with latitudes and longitudes. I would like to create a new file (.osm or .csv) which would give for each node an (x,y) position.

Am I obliged to use osmconvert or is there a quicker solution with java (like parsing the osm file and creating a new sml file) ? My problem is that I do not know how to only take the information latitude or longitude given the disposition of the osm file....

I hope I've been clear enough ... Can anyone help ?!

asked 24 Sep '14, 14:57

laVial's gravatar image

laVial
1111
accept rate: 0%


Unless you need very high optimisations (in which case you probably don't want to use an unconverted *.osm file anyway), I wouldn't bother modifying the input file, it looks like too many opportunities for confusion.

Convert the coordinates at load time instead, if you really need to (I'm not sure I see the usecase). Use a library like proj4j (you didn't specify what language you were using), choose your projection (equirectangular will probably suit you best in this case), and translate all nodes.

permanent link

answered 24 Sep '14, 17:20

Vincent%20de%20Phily's gravatar image

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

Consult the documentation of osmconvert in the OSM wiki.

It has a feature to export a CSV file e.g. with x and y coordinates of each OSM data element from an OSM xml source file.

And: osmconvert is (next to osmfilter) a very fast tool, compared to osmosis ...

permanent link

answered 24 Sep '14, 17:16

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

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
×35

question asked: 24 Sep '14, 14:57

question was seen: 3,461 times

last updated: 24 Sep '14, 17:20

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