-
Notifications
You must be signed in to change notification settings - Fork 8
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
bbox and footprint in meters #26
Comments
Example of old and new metadata of the same original image. |
That's an interesting problem because the projection definition is metric, so all those coordinates are the unchanged native ones. Strictly, should we not update the projection definition as well if the bbox and footprint are converted? Or there needs to be something at least noted in the spec that bbox and footprint are always in a geographic projection that won't necessarily match the Or perhaps it should be the responsibility of the consumer (catalog API, OAM browser, etc), to convert into their preferred projection? |
Well I'm not sure we need to define the projection of the bbox and footprint. While we're not making geojson, if we follow the geojson spec, then we should have these in geographic coordinates. But the OIN metadata spec says that the bbox should be in the CRS units. I guess where is the problem coming from for mongo? |
I haven't looked into the Catalog API enough yet to have much idea what's going on, but I'll see what I can find. But I think this raises the possibility that up till now oin-metadata consumers have expected bbox and footprint to be geographic. For instance how do these new metric projections appear in the OAM browser? Are their footprints appearing in the correct place on the globe, etc? |
I'm sorry, I didn't look closely enough at the metadata before. I was so focused on GSD being in meters that I lost track of the fact that the bounding box and footprint changed. It makes sense to have them consistent with the projection that's included (otherwise, why bother including it?), though it does make it more of a pain to work with vs. keeping coordinates in geographic coordinates (but GSD units in meters). |
No worries, we tested this on specific images that had the GSD problem and so these are images that didn't have the GSD problem. Do you think the right approach would be to do geographic coordinates for bbox and then image CRS for footprint? Main reason might be for queries like |
Yes. We may need to clarify the OIN metadata docs though. Footprint isn't actually a footprint (it's the bounding box in WKT--why WKT and not GeoJSON? yes I'm extremely late to the party on this). The new tiling workflow generates
That sounds exactly right. |
I'm getting the impression this is a pretty big issue. As I mentioned earlier, it appears that many, if not all, consumers of the OIN meta data are already coded to assume Ultimately I believe all coordinates in the meta data should be in the same CRS as specified by Of course we are being faced with a rather intricate and involved problem here. The immediate solution is to revert all If I'm understanding right, the Another solution I think is reasonable is to convert all imagery to a standard CRS, the obvious candidate being EPSG4326 and then changing the It's easy to say in hindsight, but such bugs as these are a classic example of why integration tests are useful and why simplifying a system is useful such that said integration tests are as easy to write as possible. A brief comment on the slightly unrelated |
I actually don't remember the exact reasoning there.
Let's silo the footprint convo and bring that into another ticket since I'm not sure the answer at the moment and it seems tangential to the units issue.
I agree with the idea and the fact that the original spec says the same. Unless there is a reason for the current implementation being different from the spec.
Is the quick and best solution to fix it in the metadata generator, or is the better solution to fix the ingestion of projected coordinates into the catalog? Ultimately the catalog needs to have bbox queries in a geographic coordinate format for mapping libraries. If the best solution is to fix the ingestion of the metadata, then let's close this issue out and move the conversation to the oam-catalog. |
Personally I think the better solution is certainly to fix the ingestion of projected coordinates into the catalog. The trouble is, as I mentioned, that the catalog isn't the only place working on the assumption that all coordinates will be ESPG4326, so the task involves a lot of refactoring over more than one repo. So I've pushed a PR reverting So, let's merge, test and deploy the fix. And open 2 new issues;
|
My take on the UX disagrees with the spec (but may agree with how things are used in practice), but here it is anyway:
|
I guess I look at the metadata as being equivalent to a bibliography written in English (4326) referring to books in a variety of languages (alternate projections). When working with the bibliography, it's convenient that everything is in the same language, even if the actual books aren't. |
Seth, I really like that metaphor! In fact, I wonder if that can be put as a quote at the top of the README!? It really helps focus the fundamental purpose I think. And I'm totally on board with your points on the spec from a UX perspective (consumer-centric is so often the best perspective). They give the spec coherency and consistency. Basically it prioritises 4326 as a lingua franca, we can make that clear in the spec with something like, "all coords are 4326 unless stated otherwise". Not that it should effect our decision making, but this approach of course means less refactoring for OIN consuming code like the Catalog API. If we take this approach, it feels like And I know we said we should discuss the footprint stuff elsewhere, but just whilst we're here: what exactly is it!? How is it different from a bounding box? Can a footprint be non-rectangular? Does it literally express the precise extent of a raster minus the alpha band? If so, how accurate should it be? How should it be calculated? |
Here's a sample footprint generated by the tile prep workflow: https://oin-hotosm.s3.amazonaws.com/58655b07f91c99bd00e9c7ab/0/58655decb0eae7f3b143a908_footprint.json It can be non-rectangular and shows the image's footprint after it's been masked out, with nodata and otherwise. This samples at 1% (?) to keep the GeoJSON size down, since the end result is stair-stepped no matter what (because it's polygonizing pixels). |
Exactly what I needed to know, thanks. So it lives up to its name and is certainly different from a bounding box. Ok we can continue to talk about this in a separate thread ... #28 And what should we do about the 4326 discussion? There are actually so many ongoing issues about spec updates. We really need to triage and perhaps consolidate into a single issue, that maybe has the free reign to trigger a major version change? |
An error popped up after processing new imagery on production. Metadata is generated fine (example), but when the catalog indexes the new image, mongodb throws an error:
It seems that for these images the bbox and footprint units are in meters, when mongo expects them to be in geographic coordinates, latitude and longitude.
cc @tombh
The text was updated successfully, but these errors were encountered: