Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images: Use coordinate systems that are not pixel-based #5

Open
geoglrb opened this issue May 17, 2017 · 4 comments
Open

Images: Use coordinate systems that are not pixel-based #5

geoglrb opened this issue May 17, 2017 · 4 comments

Comments

@geoglrb
Copy link
Member

geoglrb commented May 17, 2017

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.
@geoglrb
Copy link
Member Author

geoglrb commented May 21, 2017

I'd suggest that we make GeoTIFF an allowable image format. GeoTIFF and PNG would work like this:

  • If the imported file is a GeoTIFF, then use the coordinate system and image bounds specified in the GeoTIFF.
  • When someone imports a PNG, fine enough--for that image, just leave it with a pixel-based coordinate system.

@geoglrb
Copy link
Member Author

geoglrb commented May 21, 2017

Here's a GeoTIFF parser: https://github.com/xlhomme/GeotiffParser.js/tree/master

@geoglrb
Copy link
Member Author

geoglrb commented May 21, 2017

If these were as such, this would dovetail nicely with the suggestions in Issue #13

@geoglrb geoglrb modified the milestone: First GImaginS paper May 24, 2017
@DOSull
Copy link

DOSull commented Jun 9, 2018

My experience playing around with this in the dos-exploring branch, suggests:

  • the 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.
  • the 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.
  • the Edge object class constructor should pull its distance property from its end Nodes' 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants