stamen / modestmaps-py Goto Github PK
View Code? Open in Web Editor NEWModest Maps python port
Home Page: http://modestmaps.com
Modest Maps python port
Home Page: http://modestmaps.com
Key to look up in m2i for zoom/extent: watercolor_h8vqbF00cW0
Traceback (most recent call last):
File "queue_popper_multi.py", line 71, in main
ms.process_map(db_item,msg)
map = self.create_map(db_item,provider,mime_type,dim)
roughZoom = ModestMaps.mapByExtent(provider, se, nw, dim)
Processing... watercolor_h8vqbF00cW0
File "/app/mapsettings.py", line 232, in create_map
File "/app/ModestMaps/__init__.py", line 119, in mapByExtent
mapCoord, mapOffset = calculateMapExtent(provider, dimensions.x, dimensions.y, locationA, locationB)
File "/app/mapsettings.py", line 273, in process_map
File "/app/ModestMaps/__init__.py", line 179, in calculateMapExtent
hZoomDiff = math.log(hFactor) / math.log(2)
None
ValueError: math domain error
In Geo.py Transformation.untransform, on the input, it is expected (at least how ModestMaps is used by TileStache), that the input point coordinates are representing row and column of requested tile.
According to http://blog.kartena.se/local-projections-in-a-world-of-spherical-mercator/, cx and cy parameters are supposed to be Origin of the tile set, which is given in map units (meters in my case).
Therefore, the transform/untransform function can not work well, if cx and cy parameters are given in map units, because it's calculating with input rows/columns.
Either the code is wrong, or it's usage in TileStache or my understanding of Transformation (based on the blog mentioned earlier)
class Transformation:
...
# point uses coordinates representing columns/rows of given tile
# cx and cy are given in map units (meters) of the tile set origin - or maybe not?
def untransform(self, point):
return Point((point.x*self.by - point.y*self.bx - self.cx*self.by + self.cy*self.bx) / (self.ax*self.by - self.ay*self.bx),
(point.x*self.ay - point.y*self.ax - self.cx*self.ay + self.cy*self.ax) / (self.bx*self.ay - self.by*self.ax))
Is there any interest in porting to Python3?
I have some scripts I'd like to use in Python 3, and I'd like to port ModestMaps to Python3. But I'd like to merge upstream, I don't see a reason to create two separate forks.
Thanks!
If a request fails, MM will retry to the request at a lower zoom. However, if the lower zoom fails, it will continue to do so well into negative values for zooms.
Full license text statement is missing in this project. BSD license is mentioned
only in the setup.py file. This is challenging because there are many different
specific licenses in the BSD family.
Could you please commit a particular BSD license text?
modestmaps-py/ModestMaps/__init__.py
Line 275 in 7045be9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.