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

Snap to ends of lines if node Id properties are present #666

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

geographika
Copy link
Collaborator

@geographika geographika commented Oct 6, 2023

Currently, if a user doesn't have a vector node layer switched on, and they snap to the end of a line, an edge Id is returned.
This will require a line to be split if the drawn lines are required for routing - even though the new line snaps to a node.

This pull request allows node Ids to be picked up from the line if a drawn line snaps to the end.
A new config property has been added to the tool to set which properties of a line feature contain the node Ids:

  edgeLayerConfig: {
      startNodeProperty: 'NodeIdFrom',
      endNodeProperty: 'NodeIdTo'
  },

If this is set then node Ids from the line will take priority over the line id.

The node Ids will have to be added as properties to the line vector layer. This can be set in the serverOptions for a WFS layer in the JSON layer config file:

  {
      "layerKey": "NETWORKEDGES_WFS",
      "layerType": "wfs",
      "idProperty": "ObjectId",
 ...
      ],
      "serverOptions": {
        "propertyname": "ObjectId,IsConnected,NodeIdFrom,NodeIdTo"
      },
CpsiMapview.mp4

@geographika geographika merged commit 74dba72 into compassinformatics:master Oct 10, 2023
2 checks 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.

None yet

1 participant