geotiler icon indicating copy to clipboard operation
geotiler copied to clipboard

map.extend output differs from the extend parameter in the constructor

Open IchBinGROOT opened this issue 3 years ago • 1 comments

If I create a map object like this:

m = geotiler.Map(extent=(50.78012548763749,6.047284217876666, 50.78286635348752,6.050775730265756),size=(100,100))

and then later call the map.extend parameter, I get (50.779366493225105, 6.046887877171803, 50.78365802764892, 6.051155516750894) instead. That is quite the difference. How does that come?

IchBinGROOT avatar Aug 05 '22 12:08 IchBinGROOT

Based on the extent and size, the zoom of a map is calculated. After setting the zoom, rarely size of map in pixels will match extents of the map. We have two solutions

  • change extents of map to match the requested size in pixels
  • change size and keep the extents

GeoTiler assumes that the size of the map image is more important than the map extents, and performs the first operation.

Alternatively, you can set extents and zoom. The map image size will be set to match the extents.

wrobell avatar Aug 05 '22 14:08 wrobell

I am closing the issue. However, if you have further questions or suggestions, please shoot.

wrobell avatar Aug 09 '22 22:08 wrobell