openjump-gis / openjump

OpenJUMP, the Open Source GIS with more than one trick in its kangaroo pocket, takes the leap from svn to git. join the effort!
http://openjump.org
GNU General Public License v2.0
28 stars 14 forks source link

Auto complete polygon context #74

Closed mukoki closed 1 year ago

mukoki commented 1 year ago

Auto complete polygon tool use all the features of the editable selected layer as context either features are selected or not.

If the selected layer is not editable a warning "Selected items'' layers must be editable" which is hardly understandable is displayed (usually, if a single layer is editable, OpenJUMP edit this layer, whether selected or not)
If two layers are editable and one selected, the inexpected message "Exacly one layer must be selected". If the category is selected and one layer is editable, a NPE is thrown. If no layer is editable : the message "Exacly one layer must be selected" appears.

I thing 1/ that the condition to create the new polygon should be the same as with other creation tool : if a single layer is editable, the polygon should be created in this layer, if several layers are editable of which one is selected, the later is used, otherwise a message should explain why nothing is created) 2/ that if some features are selected either in the editable, the selected or in any layer, these features should be used as the context geometry. If there is nothing selected, features of the current editable layer should be used as the context (current behaviour)

mukoki commented 1 year ago

ok, check the code and understood why there are times where the tool did not seem to work at all. If there is a fence in the map, the tool works with the polygons intersecting the tools only. If there is no fence, it works with all the layer features. Not a bad idea, but hard to understand for a newbie. I think that replacing the fence by the selected features will be both easier to understand and more useful (more precise than than the fence and capable of using features from several layers).