Coder Social home page Coder Social logo

Comments (10)

sebdalgarno avatar sebdalgarno commented on August 19, 2024 1

Yes I think that is the best option. We will just have an R function that creates the Rkm column from Distance (in meters)

from fwapg.

smnorris avatar smnorris commented on August 19, 2024 1

I've generalized it a tiny bit more - rather than return distance, the function returns an index - multiply that index by the interval length to get Rkm.

from fwapg.

smnorris avatar smnorris commented on August 19, 2024

Proposed functions:

  1. FWA_LocateAlong(blue_line_key, downstream_route_measure) - return a point geometry, basically just a wrapper around https://postgis.net/docs/ST_LocateAlong.html
  2. FWA_LocateAlongInterval(blue_line_key, interval, downstream_route_measure) - return a table of point geometries located along the stream at set interval, starting at downstream_route_measure (default of 0).

@sebdalgarno, @joethorley - let me know if these names/parameters don't work (and any comments on the FWA_NearestStream -> FWA_IndexPoint name change in #27 are welcome too)

from fwapg.

sebdalgarno avatar sebdalgarno commented on August 19, 2024

I think these names should work. We can always rename them in the fwapgr package, if need be.
In the FWA_LocateAlongInterval function, is it possible for you to return a 'Label' (or 'Distance'?) column along with the geometries in the returned table? i.e. some way for the user to know the order of the points...so at interval of 100m, Label would be 0, 0.1, 0.2, 0.3 etc. with default units in km starting at the most downstream point

from fwapg.

sebdalgarno avatar sebdalgarno commented on August 19, 2024

actually this column could be called Rkm or RiverKm

from fwapg.

sebdalgarno avatar sebdalgarno commented on August 19, 2024

if that seems too specific, perhaps there could be a third function FWA_Rkm that makes use of FWA_LocateAlongInterval and returns the Rkm labels...

from fwapg.

smnorris avatar smnorris commented on August 19, 2024

Sure, a third FWA_Rkm func is no problem.
Maybe easier is that FWA_LocateAlongInterval has a label / distance column (in metres) that you divide by 1000 in an FWA_Rkm R function?

from fwapg.

smnorris avatar smnorris commented on August 19, 2024

fwa_locatealonginterval is live. The default limit is low, so the server doesn't bog down on big features. Explicitly set your limit high if it is a long river. I think I have to adjust the return type in fwa_locatealong, the function is on the server but not showing up in the function list.

https://www.hillcrestgeo.ca/fwapg/functions/fwa_locatealonginterval/items.html?blue_line_key=354153927&limit=500

from fwapg.

smnorris avatar smnorris commented on August 19, 2024

Looks like the above request doesn't return a point at index=0, I'll fix.
index=0 does get returned if the starting point isn't 0 - my check on whether the location actually exists is too strict.

from fwapg.

smnorris avatar smnorris commented on August 19, 2024

Zero indexes are now included at measure=0 and fwa_locatealong() shows up in the list.
I'll close the issue for now but test out the functions and reopen if you find any problems.

from fwapg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.