这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@dorukozturk
Copy link
Contributor

@dorukozturk dorukozturk commented Jul 20, 2017

When getting a subset using an annotation, if the source tiff is not in WGS we were getting an empty array. This adds a utility function to transform coordinates of the annotation to the source image's coordinates. Fixes #129

@dorukozturk dorukozturk force-pushed the fix-annotation-projections branch 3 times, most recently from 44d525a to 4a6effa Compare July 20, 2017 19:17
connection_file = os.path.basename(connection_file_path)
return connection_file.split('-', 1)[1].split('.')[0]

def transform_coordinates(source_srs, target_srs, x, y):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorukozturk we probably want to add a array based as well as that would be more efficient, passing one coordinate at a time would be slow if we want to have it as general util.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also does it makes sense to have it (x, y, target_srs) and source_srs arg if not provided can be assumed to wgs84?

Copy link
Contributor Author

@dorukozturk dorukozturk Jul 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first that is what I did. Then I realized it would be a better utility function with the ability to use it the other way around (converting to wgs84). It takes an array of coordinates now.


def index(self, *args, **kwargs):
target_srs = self.dataset.crs
# Annotations are always in WGS84
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotations are in wgs84 for now but that may change in the future (distant future)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. That is why I added a comment. It could change in the future. As long as we know the annotation projection we can use the utility function for transforming coordinates

@dorukozturk dorukozturk force-pushed the fix-annotation-projections branch 3 times, most recently from 3f012c0 to dc7ded2 Compare July 21, 2017 12:39
Copy link
Contributor

@kotfic kotfic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -

FYI it seems like the docker build is crashing, I will look into it and handle in a different PR

@dorukozturk dorukozturk merged commit 8f006a8 into master Jul 21, 2017
@dorukozturk dorukozturk deleted the fix-annotation-projections branch July 21, 2017 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants