OSM Import

868
5
10-27-2011 06:59 AM
PeterVickerman1
New Contributor
I've tried to import an osm file and the corresponding image as described in the tutorial and have had no luck getting the two to line up.  I attempted to use the python script to get the coordinates but nothing was returned and then used the excel spreadsheet but that still put the image and the linework a few 100 miles apart.  I can't tell what I am doing wrong or why the python script doesn't return anything.
0 Kudos
5 Replies
MatthiasBuehler1
Frequent Contributor II
hi Peter,

I guess you are using the 2010.3 version, right ?

well, the osm is georeferenced, thus it gets placed at the correct location in cartesian coordinates. thus, it is far away from the origin unless you use the center option (only available in 2010.3). the osm bitmap itself does not contain any georeferencing info, thus we calculate it either via the excel sheet or via the python script, which can be tricky sometimes in 2010.3 since even the slightest error causes it to not work.

thus, by far the easiest is to simply import the picture as a map layer ( texture ) and move and scale it into place by eyeballing it.

ok ?
0 Kudos
AndréCardoso
New Contributor III
Hi :)

I've been struggling with OSM too here...:
- I have a OSM file with all the streets I want to import (obviously, it is georeferenced)
- I have a heightmap, png format, not georeferenced...

I want to place the terrain/heightmap starting on one corner of the scnene origin (0, 0). This is easy...

However, I can't see a easy way to import the OSM data and place it correctly on top of the terrain. Not even selecting everything and and using the move tool is an option (huge data set, with a large offset to the origin... takes ages to move it)

I also tried to open the python console, and use ce.move()... but strangelly, it did nothing: no error, but no translation either!

Can you help me here? I just want to put the OSM on the (0, 0) of the scene, basically...
0 Kudos
MatthiasBuehler1
Frequent Contributor II
an other tip :

on top of the viewport, there's a white entry field with a little black triangle.

if e.g. the move tool is activated, you can move things via this input field, e.g. 10 0 0.



btw, Andre, what did you try to move ? hopefully the graph segments ?

Let me know..
0 Kudos
AndréCardoso
New Contributor III
I think I tried to move *everything* (CTRL + A on the viewport): the graph, its generated street shapes, and footprints that also came in the OSM data.

HOWEVER, I tried all of this again, and I think that, regarding the moving using python, it was just my fault :P, I must've done something wrong. When trying again, it worked!... so my bad! , sorry for the 'entropy' here:)

But still, let me explain my current situation:
- I've created a new project, clean, with a new scene with default system coordinate systems
- I've created a new terrain layer, using extracted dimensions in Km - calculated from an online GPS distance calculator to which were given 4 gps points, corresponding to the terrain limits; gave also half its dimensions in each X and Z offset fields, to translate one corner of the terrain to the origin of the CityEngine World;
- I've imported OSM data; selected only graph data; CE asked me for the coordinate system to use; I chose "WGS 1984 UTM Zone 32N", the default option given to me;

I have two problems now:
1 - how to correctly/exactly align graph data with terrain? (I'm currently doing it by eyeballing it)
2 - the data does not quite fit the terrain??! I can check this because I have a satellite texture on the terrain which allows me to overlay the graph with the terrain. The graph segments DON'T FIT the streets on the texture very well. Seems like OSM is not being imported with correct coordinate systems... I reckon this as to do with the coordinate systems not being the most appropriate! Should I choose some other than "WGS 1984 UTM Zone 32N" ???

(I have a previous project, on CE 2010.3, using the same data, where everything is correctly/better aligned)

Any insights on this?
Thanks a lot,
André

an other tip :

on top of the viewport, there's a white entry field with a little black triangle.

if e.g. the move tool is activated, you can move things via this input field, e.g. 10 0 0.



btw, Andre, what did you try to move ? hopefully the graph segments ?

Let me know..
0 Kudos
JosephRodgers
New Contributor
I know this has not been commented on in a while and am struggling to get to grips with Cityengine myself but WGS 84 UTM 32N refers to central europe. I have always used WGS 84 UTM 30N as it covers mainland UK. I guess you would want to use WGS 84 UTM 29N for Portugal may explain the hundreds of miles out?
0 Kudos