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

Display Segment wise length for line measure, area in different units - sqm, sqy, acres,hectares #192

Closed
saivaradula opened this issue Apr 12, 2017 · 7 comments
Assignees
Milestone

Comments

@saivaradula
Copy link

Hi Jackie,
We would like to modify measure in Task pane to display

  1. Segment wise length for line measure
  2. Area in different units - sq meters, sq yards, acres, hectares for polygon

Kindly expose the api to access and modify measure.

Reference: The attached image which explains our requirement.

Thanks,

  • Sai

measure-segment length display-area in sqm sqy acres hect

@jumpinjackie jumpinjackie self-assigned this Apr 12, 2017
@jumpinjackie jumpinjackie added this to the 0.9 milestone Apr 12, 2017
@jumpinjackie
Copy link
Owner

I'm happy to port across the segment length display on the panel, but not the live display for the actual geometry as that is OpenLayers 2.x code that I am not certain we have the ability to replicate with current OpenLayers

@saivaradula
Copy link
Author

Jackie:

Please port segment length display on the panel and with a different color for each segment in the geometry.

Thanks,

  • Sai

@jumpinjackie jumpinjackie modified the milestones: 0.9, 0.10 May 16, 2017
@JBurkinshaw
Copy link

Hi Jackie,

Functionality similar to that outlined by Sai would also be very useful in an application we are developing to replace our Fusion based application:

  • Allow different units of measurement, ideally through the <Units> element in the measure widget configuration.
  • Segment length display.

Has any progress been made on either of these? Is there anything we can do to assist with their implementation?

Thanks,
Joe

@jumpinjackie
Copy link
Owner

@JBurkinshaw <Units> element support will eventually be covered through work on #239 but that is kind of blocked by the segment display, which I have not made any progress on. If you have an idea how the segment display could be implemented, I'm happy to accept a pull request.

@JBurkinshaw
Copy link

@jumpinjackie I appreciate the quick response. Is it possible to treat the <Units> element support and the segment display separately?

I have been thinking about the segment display for line geometry. The idea I had would involve the following:

  • Iterate through the line's coordinates somewhere in measure-context.ts' onDrawStart() function.
  • Calculate the distance between each coordinate by iterating through the line's coordinates with something like WGS84_SPHERE.haversineDistance(line.getCoordinates()[i], line.getCoordinates()[i+1]).
  • Add all of these distances to an object and add the object to the Redux store.
  • The distances can then be passed into the MeasureComponent as a property and rendered accordingly.

Does that approach make sense to you?

@jumpinjackie
Copy link
Owner

@JBurkinshaw Your approach sounds solid. My only point of contention would be around pushing measurement segment state to the redux store vs state local to the Measure component.

Which really boils down to: Would there be possibly anything else in the entire application that would care about the fact that [measurement is currently taking place and here's the measured segments]? I don't really see that right now, so I think pushing this state to a redux store is overkill and measurement segments as component-local state instead for the immediate short term.

The other thing to be aware of is that your approach needs to also work in a multi-map manner. When we switch maps, we also need to be able to switch active measurements, overlays, etc related to those maps as well. MeasureContext has helped insulate the Measure component from this, so your approach should build on what MeasureContext provides.

@jumpinjackie
Copy link
Owner

Measure now shows segments, but only in geodesic mode and only for the current measurement.

measure-segments

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

3 participants