Comments (7)
For conversion between lat/lon and x/y(0,1) you could use something like this:
fun Double.latToY01(): Double {
val sinus = sin(clipLat(this) * PI / MAX_LONGITUDE)
return 0.5 - ln((1 + sinus) / (1 - sinus)) / (4 * PI)
}
fun Double.lonToX01(): Double {
return (clipLon(this) - MIN_LONGITUDE) / (MAX_LONGITUDE - MIN_LONGITUDE)
}
fun Double.y01ToLat(): Double {
return 90 - 360 * atan(exp((this - 0.5) * 2 * PI)) / PI
}
fun Double.x01ToLon(): Double {
return MIN_LONGITUDE + (MAX_LONGITUDE - MIN_LONGITUDE) * this
}
Ref code. I do agree though it would be great to have this inside the library with the checks for exceeding the MIN/MAX values.
from mapcompose.
This library isn't tied to any measurement system. A map could be taken from a scanned paper or may represent the whole world. In the latter case, lat/lon make sense. However lat/lon may be irrelevant in other use cases.
Also, the relative to lat/lon formulas depend on the projection used to make the map.
Please provide more details about your usage of the library.
from mapcompose.
from mapcompose.
@Nohus I am guessing that you just figured out how to put your projection on the Number of Block - Width x Number of Blocks -Height and figured out how to stack your imagery there. I will investigate putting WGS-84 on the map. The renderer of this map does seem really good to try and figure that out.
When I do that I can try and figure out each boxes bound points of lat and long and determine image coverage. Sorry I am talking this out loud so that it might paint a better picture. Then I can associate zoom to the respective 1:Altitude ratio of the imagery.
from mapcompose.
Typically you know the extent in latitude and longitude of what you're rendering. Let's say Ya
and Yb
are respectively the projected coordinate in Y dimension of the top and the bottom. When y
is a relative coordinate, it's projected coordinate in Y dimension is is Ya
+ y
*(Yb
-Ya
). Then, the corresponding latitude is obtained using the relevant formula (which depends on the projection).
from mapcompose.
I am not sure I understand completely but I will try my best to see what I can do. I understand the relative calculation, but I am trying to think of how to get the "blue marble map" to project correctly
from mapcompose.
I think I will have to split bitmaps over a projection.
from mapcompose.
Related Issues (20)
- Question: How to handle marker/cluster removal efficiently HOT 13
- Tiles of size smaller than specified to `MapState` are not garbage-collected HOT 7
- Performance degradation when using null tiles HOT 13
- Zoom not work HOT 5
- Path: Ability to use pattern HOT 4
- Bug: Marker size (width) is limited to screen width HOT 2
- Problem: Click callback uses outdated data HOT 5
- Custom figures and objects HOT 1
- How to set min/max zoom levels? HOT 5
- Add optional animations for clustering
- NoClassDefFoundError on version 2.6.0 HOT 5
- Paths rendering issue HOT 7
- Paths have no way to specify ending "caps" HOT 1
- Implement path lazy loading
- Question: Tiles with padding HOT 10
- Unable to add polygon lines in Mapstate HOT 1
- [Feature request]Allow each layer has different tileSize
- Html support
- Marker composable content update HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapcompose.