Skip to content

Add cutline to downloadable assets when/if available #1699

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

Merged
merged 12 commits into from
Jul 18, 2025

Conversation

smathermather
Copy link
Contributor

No description provided.

@smathermather
Copy link
Contributor Author

Probably need to add something to test_api_task.py, but not sure.

@smathermather smathermather requested a review from pierotofy July 6, 2025 21:39
@@ -13,6 +13,7 @@
'orthophoto.tif': os.path.join('odm_orthophoto', 'odm_orthophoto.tif'),
'orthophoto.png': os.path.join('odm_orthophoto', 'odm_orthophoto.png'),
'orthophoto.mbtiles': os.path.join('odm_orthophoto', 'odm_orthophoto.mbtiles'),
'cutline.gpkg': os.path.join('odm_orthophoto', 'cutline.gpkg'),
Copy link
Member

Choose a reason for hiding this comment

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

Old migration files should never be updated. 🙅

@@ -9,7 +9,7 @@ import Workers from '../classes/Workers';

export default class ExportAssetPanel extends React.Component {
static defaultProps = {
exportFormats: ["gtiff-rgb", "gtiff", "jpg", "png", "kmz"],
exportFormats: ["gtiff-rgb", "gtiff", "jpg", "png", "kmz","gpkg"],
Copy link
Member

Choose a reason for hiding this comment

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

Mm, I think the intent here was to allow the download of the cutline, but this isn't the place where to add it.

@smathermather
Copy link
Contributor Author

Partial success:
image

But also, clearly something's not right:
Screenshot from 2025-07-06 18-01-54

@smathermather
Copy link
Contributor Author

Going back through pull requests, this is my first substantive (ahem -- but still minor) WebODM modification. Any tips on what I'm getting wrong here most welcome. I was guessing a bit from digging through variables what might work, and while I got downloads working, I've got something wrong as I've broken the map.

@pierotofy
Copy link
Member

Usually opening the Chrome Developers tools (or equivalent for your browser) and checking the Javascript console output will give some clues (although from the changes you made/pushed to GitHub, I'm not sure why it broke).

@smathermather
Copy link
Contributor Author

Sorry, forgot to include:

[Live Reload] enabled main-d41d80f9c05b800ba1de.js:400:30
Download the React DevTools for a better development experience: https://fb.me/react-devtools react-dom.development.js:24994:17
XHRGET
https://crankyserver.com/api/projects/453/tasks/aadc9ab4-0f7a-46a3-8b19-42dfc11ed521/cutline/metadata
[HTTP/1.1 404 Not Found 481ms]

Uncaught (in promise) TypeError: e is undefined
    componentDidMount webpack://webodm/./app/static/app/js/components/Map.jsx?:1032
    promise callback*componentDidMount webpack://webodm/./app/static/app/js/components/Map.jsx?:1029
    React 6
    unstable_runWithPriority webpack://webodm/./node_modules/scheduler/cjs/scheduler.development.js?:653
    React 10
    <anonymous> webpack://webodm/./app/static/app/js/MapView.jsx?:229
    jQuery 2
    <anonymous> webpack://webodm/./app/static/app/js/MapView.jsx?:226
    jQuery 5
    <anonymous> webpack://webodm/./app/static/app/js/MapView.jsx?:225
    jsx https://crankyserver.com/static/app/bundles/MapView-d41d80f9c05b800ba1de.js:19
    __webpack_require__ https://crankyserver.com/static/app/bundles/MapView-d41d80f9c05b800ba1de.js:2977
    <anonymous> https://crankyserver.com/static/app/bundles/MapView-d41d80f9c05b800ba1de.js:3053
    <anonymous> https://crankyserver.com/static/app/bundles/MapView-d41d80f9c05b800ba1de.js:3055
MapView-d41d80f9c05b800ba1de.js line 337 > eval:1032:11

image

@@ -1086,6 +1087,7 @@ def get_map_items(self):
if 'orthophoto.tif' in self.available_assets:
types.append('orthophoto')
types.append('plant')
if 'cutline.gpkg' in self.available_assets: types.append('cutline')
Copy link
Member

@pierotofy pierotofy Jul 8, 2025

Choose a reason for hiding this comment

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

cutline should not be in "types".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. That was a change I made before I had a mental model for the change. Reverted.

@pierotofy
Copy link
Member

pierotofy commented Jul 8, 2025

image

Overall, I think the prerequisite to do this change might be beyond the digging variables approach.

@smathermather
Copy link
Contributor Author

Overall, I think the prerequisite to do this change might be beyond the digging variables approach.

Yup. But, got to start somewhere. Thanks for the help. Now I have a mental model for the parts and pieces of this part of the code base.

We are now functional in my testing:
image

Looks like build is failing due to problems with the build machine, not code. Anything I can do with that?

@smathermather
Copy link
Contributor Author

I think, now that the build is running, but we aren't generating the cutline so it can be tested. Looking into it.

@smathermather
Copy link
Contributor Author

I'll start by looking at how this is done for dems.

@smathermather
Copy link
Contributor Author

I think I need a hint. I assume I need to trigger cutlines in at least one of the tests so that they can be tested, but I have been unable to discern where.

@@ -143,7 +143,8 @@ def test_task(self):
'images': [image1, image2, multispec_image, gcp],
'name': 'test_task',
'processing_node': pnode.id,
'resize_to': img1.size[0] / 2.0
'resize_to': img1.size[0] / 2.0,
'orthophoto-cutline': True
Copy link
Member

@pierotofy pierotofy Jul 17, 2025

Choose a reason for hiding this comment

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

This change doesn't do much (task options are sent in a different manner).

@pierotofy
Copy link
Member

I think you'll need to add an empty file in https://github.com/OpenDroneMap/NodeODM/tree/master/tests/processing_results/odm_orthophoto (cutline.gpkg) to make that test happy (and update the NodeODM submodule) in /nodeodm/external/NodeODM.

@smathermather
Copy link
Contributor Author

smathermather commented Jul 18, 2025

Leaving notes for future Steve, who may not be any better informed than current Steve about updating submodules:

cd nodeodm/external/NodeODM
git checkout bb17348ff7f44ce766498d47511a98825232963c # whatever the current hash from the commit just merged in NodeODM
cd ..
git add NodeODM
commit -m ... # etc.

@pierotofy pierotofy merged commit 1777b2b into OpenDroneMap:master Jul 18, 2025
1 check passed
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.

2 participants