Giter Club home page Giter Club logo

Comments (5)

mpu-creare avatar mpu-creare commented on June 16, 2024 1

This would be my preference:

bounds, crs = node.get_bounds(crs=...)
# where crs in ['native', 'default', 'EPSG,...'])
# Default is 'default'
# if 'default' uses `podpac.settings['DEFAULT_CRS']
# if 'native' uses the Datasource or TileCompositor's native coordinates. If node is neither of those, raises an exception. 
# otherwise, return bounds in the requested CRS

from podpac.

jmilloy avatar jmilloy commented on June 16, 2024

@drc-creare the immediate goal of this issue is to support the WCS getCapabilities. I plan to return a dictionary {<dim1>: (<lo>, <hi>), `: (, ). Does that work for you? I know you ultimately want a bbox, but I think you can make that yourself from that dictionary.

What is a good spec for a Node that supports all times (because it is an algorithm, for example)?

Do you need resolution, too, or is the bounds enough?

from podpac.

jmilloy avatar jmilloy commented on June 16, 2024

@drc-creare Also, let me know if you think a method get_bounds is more appropriate.

from podpac.

drc-creare avatar drc-creare commented on June 16, 2024

@jmilloy The dictionary works, its easy to construct a bounding box from there. Reporting min and max is sufficient, but if step (e.g. resolution) can be reported, I believe that could be used as well.

Yeah, all-times is an interesting case. It looks like we report basically minimum and maximum possible value for things like elevation (see xml example below). Maybe datetimes have min/max values supported by the underlying data types. For an algorithm, if min/max can be bounded based on bounds of the inputs, then it would be nice to know that.

Is the difference between get_bounds and find_bounds that the latter would dynamically adapt to changes in the underlying data (e.g. as new data points are added over time the find_bounds would include those)? In that case, it would be better to have find_bounds than get_bounds.

Example of "all-times" currently reported:

<wcs:temporalDomain>
<gml:timePeriod>
<gml:beginPosition>0001-01-01 00:00:00</gml:beginPosition>
<gml:endPosition>9999-12-31 23:59:59.999999</gml:endPosition>
</gml:timePeriod>
</wcs:temporalDomain>

from podpac.

jmilloy avatar jmilloy commented on June 16, 2024

@mpu-creare @drc-creare The bounds are somewhat meaningless without a CRS. Note that find_coordinates returns a list of coordinates which may not all have the same CRS.

I guess the user should specify the desired CRS:

bounds = node.get_bounds(crs='EPSG:2193')

In some cases, e.g. for a Datasource or Compositor, maybe we should default to the native CRS.

# default
bounds = node.get_bounds()

# same as
bounds = node.get_bounds(crs=node.coordinates.crs)

Or we could default to the default CRS in the settings?

# default
bounds = node.get_bounds()

# same as
bounds = node.get_bounds(crs=podpac.settings['DEFAULT_CRS'])

In either case, does it make sense to return the crs alongside the bounds?

# use a default crs, and know what it is
bounds, crs = node.get_bounds()

# the returned crs would be redundant here, but that's okay
bounds, crs = node.get_bounds(crs="EPSG:2193")
assert crs == "EPSG:2193"

Another alternative would be to only implement get_bounds for Datasources and TileCompositors and Interpolators (where there is a single source CRS). This would simplify what CRS to return bounds in, and we would either return it alongside the bounds or in a separate property.

Any other ideas or preferences? This is very easy to implement, just have to nail down the API.

from podpac.

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.