Skip to content
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

Snapping function for features editing #478

Closed
tdipisa opened this issue Feb 1, 2022 · 1 comment
Closed

Snapping function for features editing #478

tdipisa opened this issue Feb 1, 2022 · 1 comment

Comments

@tdipisa
Copy link
Collaborator

tdipisa commented Feb 1, 2022

The geometric input should be able to snap to existing vector objects on the map (e.g. cadastral
parcel boundaries).

Acceptance Criteria:

  • The user sets the snap layer from the UI to a layer to be selected in the TOC
  • The entity is drawn in the selected current layer by snapping to the entities of the snapping layer,
  • It must be possible to activate snapping also for the current layer
  • The snap distance must be configurable
  • The administrator can enable or disable this feature of the editing plugin.

See related on MapStore:
geosolutions-it/MapStore2#7869

@offtherailz
Copy link
Collaborator

offtherailz commented Feb 9, 2022

When editing, if the FeatureEditor has the option {"cfg": {"snapTool": true}} a new button will be present in the toolbar.
image

As the user click on the button, the button will enable, and by default it will snap to the current editing layer.
from the dropdown menu the user can configure:

  • The layer to use for snapping (selecting from a list of supported ones)
  • the following properties:
  • edge | boolean (defaults to true) | Snap to edges.
  • vertex | boolean (defaults to true) | Snap to vertices.
  • pixelTolerance | number (defaults to 10) | Pixel tolerance for considering the pointer close enough to a segment or vertex for snapping

Implementation

  • The tool will be available only for OpenLayers, it will not be shown for leaflet or cesium
  • Snap interaction in OpenLayers provides the following option for passing features to snap:
    • features: passing directly the openlayers features
    • source: passing an OpenLayers Vector source.

The source option fits when the layer uses a OpenLayers Vector source. e.g.:

  • Annotations
  • Vector data imported features from, for intance, shape files
  • WFS layer (that use Vector sources ).

The problem comes when we have WMS layers backed by a WFS layer. I this case we need to download the features locally in a temporary Vector source to use.
In the case we have a big amount of data (complex geometries and/or lot of features) we may have problems in terms download size / performances.
To avoid this we have to check loading strategies of Vector source to use: - See here.
During the development we can decide if makes sense to allow to configure the strategy to use for remote layers.

Moreover, we may decide to set a limit in terms of number of features to download from WFS service, or a combination of strategy + limit.

This snapping option should be an option for the DrawSupport implementation of openlayers. It should be able to access to the layers in the map, identify their type and / or configuration, to idenify the possibility to snap directly or if need to use a support Vector source to store data.

@tdipisa tdipisa added tmp and removed tmp labels Feb 17, 2022
@ElenaGallo ElenaGallo self-assigned this Apr 27, 2022
@tdipisa tdipisa closed this as completed Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants