This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Osmosis lon/lat value changes

0

Hi,

I have 'successfully' extracted the data from my planet.osm into my DB using Osmosis but have noticed that the lon/lat values have been altered. For example: -1.297504, 50.964552 has now become -15112163, 513073058.

Am I just being stupid or does this seem a little wrong? Any help would be greatly appreciated.

Many Thanks.

asked 09 Apr '12, 23:24

stevethepenguin's gravatar image

stevethepenguin
1112
accept rate: 0%


2 Answers:

0

Hi,
this definitely does not look right. Can you provide more information about your database projection and the command with parameters you used to import? How did you get those coordinate values? Did you use ST_AsText() on the geometry column?

answered 10 Apr '12, 07:29

frabron's gravatar image

frabron
3611411
accept rate: 16%

Hi,

I'm using a mySQL DB as my host doesn't provide PostgreSQL. The coordinates I have provided are for my local pub and have been obtained from the XAPI web service (and double checked with Google Maps). I used the following command/parameters for the import:

(10 Apr '12, 09:55) stevethepenguin

osmosis --read-xml file=hampshire.osm --node-key-value keyValueList="railway.station,railway.subway_entrance,amenity.parking, amenity.bar,amenity.pub,amenity.fast_food,amenity.restaurant,amenity.atm,amenity.bank" --write-apidb authFile=auth.config

The above code runs through without any errors and all information is inserted into the DB but the coordinates are heavily altered.

Thanks.

(10 Apr '12, 09:55) stevethepenguin

0

I don't know MySQL very well, but of what type is your geometry column? I believe there is a conversion error while inserting the coordinates from osmosis into the database ...

answered 10 Apr '12, 11:08

frabron's gravatar image

frabron
3611411
accept rate: 16%

The mySQL DB doesn't use a single geometry column - it use two separate columns (one for lon, one for lat) with the double data type.

(10 Apr '12, 11:26) stevethepenguin

Source code available on GitHub .