makepath / mapshader Goto Github PK
View Code? Open in Web Editor NEWSimple Python GIS Web Services
License: MIT License
Simple Python GIS Web Services
License: MIT License
Once we fully understand intake: https://intake.readthedocs.io/en/latest/
Let's make a list of issues on how we can align APIs
If we have more questions, we can reach out to:
@martindurant
mockups needed:
server index page
shows list of available services, their names, descriptions and links service pagesservice page
: shows details of service with interactive map displaying the layerservice page
: shows code snippet for using in Leafletmapshader/templates
directorybuild_previewer
functionxarray-spatial proximity
as valid graph operationxarray-spatial reclassify
as valid graph operationflask app needs a site index page fixed
This would be an additional service type, or optional extension to the WMS Service to include additional optional parameters specified by ncWMS documentation:
https://reading-escience-centre.gitbooks.io/ncwms-user-guide/content/04-usage.html#wms
@rsignell-usgs I know we are interested in the color range parameters, but this issue here can serve to help specify exactly whats needed some migration to mapshader is straightforward
class GlobalGeodetic(object):
"""
TMS Global Geodetic Profile
---------------------------
Functions necessary for generation of global tiles in Plate Carre projection,
EPSG:4326, "unprojected profile".
Such tiles are compatible with Google Earth (as any other EPSG:4326 rasters)
and you can overlay the tiles on top of OpenLayers base map.
Pixel and tile coordinates are in TMS notation (origin [0,0] in bottom-left).
What coordinate conversions do we need for TMS Global Geodetic tiles?
Global Geodetic tiles are using geodetic coordinates (latitude,longitude)
directly as planar coordinates XY (it is also called Unprojected or Plate
Carre). We need only scaling to pixel pyramid and cutting to tiles.
Pyramid has on top level two tiles, so it is not square but rectangle.
Area [-180,-90,180,90] is scaled to 512x256 pixels.
TMS has coordinate origin (for pixels and tiles) in bottom-left corner.
Rasters are in EPSG:4326 and therefore are compatible with Google Earth.
LatLon <-> Pixels <-> Tiles
WGS84 coordinates Pixels in pyramid Tiles in pyramid
lat/lon XY pixels Z zoom XYZ from TMS
EPSG:4326
.----. ----
/ \ <-> /--------/ <-> TMS
\ / /--------------/
----- /--------------------/
WMS, KML Web Clients, Google Earth TileMapService
"""
def __init__(self, tileSize = 256):
self.tileSize = tileSize
def LatLonToPixels(self, lat, lon, zoom):
"Converts lat/lon to pixel coordinates in given zoom of the EPSG:4326 pyramid"
res = 180 / 256.0 / 2**zoom
px = (180 + lat) / res
py = (90 + lon) / res
return px, py
def PixelsToTile(self, px, py):
"Returns coordinates of the tile covering region in pixel coordinates"
tx = int( math.ceil( px / float(self.tileSize) ) - 1 )
ty = int( math.ceil( py / float(self.tileSize) ) - 1 )
return tx, ty
def Resolution(self, zoom ):
"Resolution (arc/pixel) for given zoom level (measured at Equator)"
return 180 / 256.0 / 2**zoom
#return 180 / float( 1 << (8+zoom) )
def TileBounds(tx, ty, zoom):
"Returns bounds of the given tile"
res = 180 / 256.0 / 2**zoom
return (
tx*256*res - 180,
ty*256*res - 90,
(tx+1)*256*res - 180,
(ty+1)*256*res - 90
)
(from: https://github.com/brendancol/RacialDotMap/blob/master/globalmaptiles.py)
=========================== short test summary info ============================
FAILED mapshader/tests/test_core.py::test_default_to_image[elevation_source]
FAILED mapshader/tests/test_core.py::test_default_to_tile[elevation_source]
FAILED mapshader/tests/test_core.py::test_to_raster[elevation_source]
FAILED mapshader/tests/test_core.py::test_tile_render_edge_effects
============ 4 failed, 29 passed, 4 skipped, 38 warnings in 37.98s =============
Cross origin requests to JSON endpoints should be allowed
pytest mapshader/tests/test_mercator.py -sv -k <optional_grep>
pytest-benchmark
)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.