Skip to content

to_pixels issue #1

@balzer82

Description

@balzer82

I have following setup:

import smopy

# bounds via http://boundingbox.klokantech.com/
# copy & paste:
bounds = [14.262150,51.665628,14.502597,51.880444]

maxY = bounds[3]
maxX = bounds[2]
minY = bounds[1]
minX = bounds[0]

mymap = smopy.Map((minY, minX, maxY, maxX), z=10)

X, Y = mymap.to_pixels(51.75,14.325)
ax = mymap.show_mpl(figsize=(23,29.7))

ax.plot(X, Y, 'or', ms=50, mew=2);    

which produces to the following map:

cottbus-hauptbahnhof-1500

Here are two things wrong:

  1. the map is bottom up, maybe because in the def show_mpl the ylim is defined between (self.h, 0) and not from (0, self.h)?
  2. the red dot is not where it is supposed to be. The coordinates are the main station of Cottbus, which is not on this position, even when the map is turned upside-down

Is my code wrong or is the calculation of the lat, lon on the matplotlib image wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions