-
Notifications
You must be signed in to change notification settings - Fork 12
Completeness #334
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
Completeness #334
Conversation
Project creation form
add quadkey to aggregated results
add basic user stats per project #335
@Matthias-Schaub do you think that you have time during the next week to review to PR. It's getting bigger and bigger and I hope this is not too confusing, but I have the feeling that we are almost there. So your comments will be valuable for us to get this merged into dev next week. :) |
1: BuildAreaProject, | ||
2: FootprintProject, | ||
3: ChangeDetectionProject, | ||
3: BuildAreaProject, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BuildAreaProject is listed 3 times in the dict. Probably a mistyping or is it not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no this isn't a mistype, maybe it would be better if @Hagellach37 answers this modification. Basically because Completeness
and ChangeDetection
both have almost the same structure. Both projects require two urls.
super().__init__(project_draft) | ||
|
||
# set group size | ||
self.project_type = project_draft["projectType"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why make the project type depended on the project draft? Project type of this class (BuildAreaProject) should always be 1.
It will work like this, but cleaner and less error prone would be to use a constant.
self.tileServer = self.get_tile_server(project_draft["tileServer"]) | ||
|
||
# get TileServerB for change detection and completeness type | ||
if self.project_type in [3, 4]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the base class/ parent class BaseProject
(base/base_project.py
) not in the child class BuildAreaProject
, because it apllies to a subset of child classes (with project type 3 or 4) not only to BuildAreaProject (type 1).
Or one would put this code into the associated child classes directly.
To be clear: Every project type should be represented by a single class. All project type classes are child classes of a base class where methods and variables are defined, which are shared/common across all project type classes.
) | ||
|
||
apiKeyRequired = "AopsdXjtTu-IwNoCTiZBtgRJ1g7yPkzAi65nXplc-eLJwZHYlAIf2yuSY_Kjg3Wn" | ||
apiKey = "AopsdXjtTu-IwNoCTiZBtgRJ1g7yPkzAi65nXplc-eLJwZHYlAIf2yuSY_Kjg3Wn" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API Keys should not be hardcoded. Since ths code is allready pushed to GitHub the API key is now public.
API Keys should be handled locally in evironment variales (Much like we allready do with the image api keys).
Do we need to change this API key because it is now public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between apiKeyRequired vs. apiKey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose there is no difference between apiKeyRequired and apiKey.
|
||
from mapswipe_workers.definitions import logger | ||
|
||
url = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we define constants like url in definitions.py -> See for example IMAGE_URLS in definitions.py
Is this URL related? Could be that it does make sense to only define it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL can be imported from definitions.py, that's correct. I will modify that!
BuildAreaProject.zoomLevel = int(18) | ||
BuildAreaProject.tileServer = tile_server_dict | ||
|
||
project_area = "/home/tahira/Public/LOKI/Attica/attica_maybe2.geojson" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path will only work on your computer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true! will change that
return True | ||
|
||
|
||
a = tasks_to_geoJson(tasks, "attica_tasks_maybe2.geojson") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this script willl be executed directly it is a good practice to put the code which will be executed first (which are not defined in functions) inside if __name__ == "__main__":
Statement.
See for further information: https://stackoverflow.com/questions/419163/what-does-if-name-main-do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok will change that!
@@ -0,0 +1,109 @@ | |||
from osgeo import ogr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the usecase for this module?
It is not been called from any other module. If it is only executed manually then it should be in mapswipe_workers/scripts/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ogr is used in tasks_to_geoJson()
to create geojson file for the tasks
…o scripts directory
This reverts commit 25ff666.
work in progress
assure that:
further things addressed here: