-
Notifications
You must be signed in to change notification settings - Fork 0
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
Kaavakohteiden ja kaavan muokkaaminen #112
The head ref may contain hidden characters: "110-kaavaan-lis\u00E4ttyjen-kaavakohteiden-muokkaaminen"
Kaavakohteiden ja kaavan muokkaaminen #112
Conversation
- add a custom QgsMapTool for selecting a plan feature to modify - construct PlanFeatureForm from an existing feature - update feature attributes, including regulation group associations - fix duplicate PlanManager creation in plugin.py
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.
- Kaavan ulkorajan tietoihin pitäisi myös päästä käsiksi. En tosin tiedä pitäisikö sille olla oma nappi vai pitäisikö sen antaa ulkoraja tuloslistaan vain, jos on klikannut reunaviivaa, muuten se ulkoraja on aina siinä menussa. Varsinkin kun ehdotin, että lomakkeen voisi avata suoraan jos vaan yksi kohde tuloksissa.
- Spatiaalista indeksiä ei mun mielestä tässä tarvittaisi.
point = self.toMapCoordinates(event.pos()) | ||
nearby_features = self.query_nearby_features(point) | ||
|
||
if nearby_features: |
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.
Jos tuloksia on vain yksi, niin voisi suoraan avata lomakkeen. Jos tuloksia monta, niin silloin menu.
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.
Joo harkitsin tuota, mutta nyt kohde värjätään vasta kun menun elementtejä osoittaa hiirellä. Pitäisiköhän tehdä niin, että työkalun ollessa aktiivinen päällimäinen kohde värjätään silloinkin kun menu ei auki ja hiirtä vain liikutellaan, vai onko riittävän selkeää minkä kohteen lomake avataan ilmankin tuota, jos alle osuu vain yksi kohde?
- add toolbar action for editing plan attributes - modify plan model to allow Nones for all attributes - add set_value methods for CodeComboBoxes
cb07da6
to
01fa4f2
Compare
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.
Hyvältä näyttää. Pari optimointi-kommenttia.
@classmethod | ||
def get_associations_for_feature(cls, feature_id: str, layer_name: str) -> list[QgsFeature]: | ||
attribute = cls.layer_name_to_attribute_map.get(layer_name) | ||
return [feature for feature in cls.get_features() if feature[attribute] == feature_id] |
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.
Olisi parempi hakea tietokannasta ainoastaan tarpeelliset kohteet. Nyt tää looppaa kaikki layerin kohteet läpi, mikä saattaa olla hidasta.
AbstractLayer:lle voisi toteuttaa esim metodin:
@classmethod
def get_features_by_attribute_value(cls, attribute: str, value: str) -> Generator[QgsFeature]:
request = QgsFeatureRequest().setFilterExpression(f"\"{attribute}\"='{value}'")
yield from cls.get_from_project().getFeatures(request)
def get_group_ids_for_feature(cls, feature_id: str, layer_name: str) -> list[str]: | ||
attribute = cls.layer_name_to_attribute_map.get(layer_name) | ||
return [ | ||
feature["plan_regulation_group_id"] for feature in cls.get_features() if feature[attribute] == feature_id |
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.
Sama juttu kuin yllä.
Tai oikeastaan, kun ollaan kiinnostuneita ainoastaan yhdestä arvosta, niin requestiin olisi hyvä lisätä
request.setSubsetOfAttributes(['plan_regulation_group_id'], layer.fields())
, jotta tietokannan ja qgisin välillä liikkuisi mahdollisimman vähän dataa.
ff3f468
to
60aba95
Compare
No description provided.