domlysz / BlenderGIS

Blender addons to make the bridge between Blender and geographic data
GNU General Public License v3.0
7.65k stars 1.35k forks source link

Basemap is 1.477x to big? #20

Closed mirlip closed 8 years ago

mirlip commented 8 years ago

Hi Domlysz, First of all, your addon is really impressive and useful! I tried to get the basemap align with the 3D DTM from maperitive. But somehow, there is a light scale difference. The 3D model from maperitive aligns perfectly with .osm datas downloaded from the overpass API of openstreetmap. What I've tried so far to solve the problem:

domlysz commented 8 years ago

Hi,

Do you import OSM data with BlenderGEO ?

mirlip commented 8 years ago

I tried both with BlenderGeo and with the official BF plugin (from addon_contrib). The DTM from maperitive is imported with the default collada importer.

domlysz commented 8 years ago

I think is just a CRS issue. BlenderGeo use it's own CRS (transverse mercator centered to scene origin). Basemap CRS depends on the source, for Google, Bing or OSM it's a Web Mercator projection. Web Mercator causes lot of distortion : the further away from the equator, the more the map will be scale up.

For now there is no compatibility between BlenderGIS and BlenderGeo, I'm currently working on a whole refactoring on how BlenderGIS handle georef infos and I hope to be able to fix this compatibility issue.

Maybee a workaround if GDAL is working

mirlip commented 8 years ago

Tried it but Blender crashes, will try again after https://github.com/domlysz/BlenderGIS/issues/22 is resolved

mirlip commented 8 years ago

ok, now I can use it. But it then doesn't download the maps and any pan or zoom action brings me very near from 0,0,0 and I can't zoom out anymore.

EDIT: console output is: Can't download tile x0 y0 http://ak.dynamic.t0.tiles.virtualearth.net/comp/ch/?it=A ERROR 1: latitude or longitude exceeded limits The longitude given by BlenderGEO's OSM importer is 7.7516423

domlysz commented 8 years ago

try to run first basemaps with CRS set to "as tile matrix", then zoom a little, level 5 for example and then press spacebar and now switch the CRS to custom

mirlip commented 8 years ago

Yes it works when done through spacebar after "as tile matrix" :)

domlysz commented 8 years ago

10

mirlip commented 8 years ago

In the latest version, after importing a dxf and recalculating the origin, if I start the basemap, it makes the bug mentioned above again: no image displayed, zoom locked. Problem is the sollution above doesn't work anymore. There is no "as tile matrix" anymore. And when I press spacebar, I don't have a custom option anymore. Where those options renamed?

domlysz commented 8 years ago

These old options was just a way to define the scene CRS, now use the new dedicated layout.

selection_015

The problem is that when you start basemap for the first time there isn't any zoom level reference, so it set the zoom level at zero and draw a map of the whole world but not all projection can draw a map of the whole world. When you import a dxf you also set the scene crs and if gdal can't build a world map using this crs then all become broken.

I have already planned to add an option to directly zoom to existing objects when starting basemaps. A workaround when all seems broken, press G then just increase the zoom level and press ok

mirlip commented 8 years ago

After importing this dxf: https://github.com/domlysz/BlenderGIS/files/313506/test1.zip (I modified my dxf importer do.py to have correct lat and long), I started basemap with default parameters: problem basemap after dxf import It gives this view, near from cube actually: view after basemap start and then I pressed G and modified the zoom from 0 to 10, but it didn't work either. So I set on 20, it downloaded tiles, zoom was working again, but it was all grey view after zoom 20

domlysz commented 8 years ago

The problem come from the source OSM WMS, there was a bug now it's fixed

domlysz commented 8 years ago

just added a new option for automatically center to existing objects https://github.com/domlysz/BlenderGIS/commit/8ad41946e340346722d30fb075a8f74b3ebcab0a

mirlip commented 8 years ago

awesome, it works really good now now and in a very user friendly way :)