Open geoglrb opened 7 years ago
I'd suggest that we make GeoTIFF an allowable image format. GeoTIFF and PNG would work like this:
Here's a GeoTIFF parser: https://github.com/xlhomme/GeotiffParser.js/tree/master
If these were as such, this would dovetail nicely with the suggestions in Issue #13
My experience playing around with this in the dos-exploring branch, suggests:
Map
object should have a Transform
member that is initialized when the image is loaded. This holds bounding box information for the image pixel space, and for the 'real world' space, and can implement forward(x, y)
and inverse(x, y)
operations to convert from real coords to pixel coords and vice-versa. For now these transformations can be simple linear rescaling, but perhaps eventually a wider range of more 'projective' transformation would be possible.Node
object class constructor will carry a reference to the Map
i.e.,
n = new Node(real_x, real_y, the_map)
possibly the_map
is actually this
since nodes are most often made in a map context
so that its internal coordinates (in image space, I think) can be initialized correctly (using the Map
's Transform
object) from supplied real coordinates.Edge
object class constructor should pull its distance
property from its end Node
s' xpos
and ypos
properties, and its distanceMod
property from any weight data supplied by the user.These suggestions would be a minimal implementation. There are probably more comprehensive changes required.
Some reasons this might be helpful: 1) Allow for resizing of images within platform instead of resizing of windows or resizing of files. 2) Potentially interface better with the different coordinate systems that mainstream spatial data (e.g. a GeoTiff) supports.