Actually, that was the solution I was thinking as well but DEMtoimageImageGenerator requires dem resolution I am afraid. I read the code and the default value is 0.001 (90 meters, set for SRTM). I need a solution that either does not require resolution or I need a way to get the resolution from the data.
All the best Emre On Tuesday, March 25, 2014 4:35:58 PM UTC+2, Jordi Inglada wrote: > > emre <[email protected] <javascript:>> > wrote: > > > > Hi there, > > I am searching for a function to access exact DEM grid locations that > are closest to a given location. For > > example, lets say I am using SRTM data (which is not certain. I need to > use different resolution DEM files) and I > > need to find the height of four DEM locations that are closest to a > given point. > > > > The problem is, I cant get the resolution (x or y sampling distance) of > the dem from demhandler. If I could, it > > would be possible to compute these four locations. My question is, is it > possible to get the resolution of the dem > > from demhandler or do you know a way to compute these four grid > locations directly. > > > > Using the DEM as an image (see > http://www.orfeo-toolbox.org/doxygen-current/classotb_1_1DEMToImageGenerator.html), > > you can use the conversions from PhysicalPoint to Index provided by the > otb::Image class: > > template<typename TCoordRep , typename TIndexRep > > void > TransformContinuousIndexToPhysicalPoint (const ContinuousIndex< TIndexRep, > VImageDimension > &index, Point< TCoordRep, VImageDimension > &point) const > > template<typename TCoordRep > > void TransformIndexToPhysicalPoint (const IndexType &index, Point< > TCoordRep, VImageDimension > &point) const > > template<typename TCoordRep > > void TransformLocalVectorToPhysicalVector (const FixedArray< > TCoordRep, VImageDimension > &inputGradient, FixedArray< TCoordRep, > VImageDimension > &outputGradient) const > > template<typename TCoordRep , typename TIndexRep > > bool TransformPhysicalPointToContinuousIndex (const Point< > TCoordRep, VImageDimension > &point, ContinuousIndex< TIndexRep, > VImageDimension > &index) const > Get the continuous index from a physical point. More... > > template<typename TCoordRep > > bool TransformPhysicalPointToIndex (const Point< TCoordRep, > VImageDimension > &point, IndexType &index) const > > Jordi > > > All the best > > Emre > > > > -- > > -- > > Check the OTB FAQ at > > http://www.orfeo-toolbox.org/FAQ.html > > > > You received this message because you are subscribed to the Google > > Groups "otb-users" group. > > To post to this group, send email to otb-users-/ > [email protected] <javascript:> > > To unsubscribe from this group, send email to > > otb-users+unsubscribe-/[email protected]<javascript:> > > For more options, visit this group at > > http://groups.google.com/group/otb-users?hl=en > > --- > > You received this message because you are subscribed to the Google > Groups "otb-users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to otb-users+unsubscribe-/ > > [email protected] <javascript:>. > > For more options, visit https://groups.google.com/d/optout. > -- -- Check the OTB FAQ at http://www.orfeo-toolbox.org/FAQ.html You received this message because you are subscribed to the Google Groups "otb-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/otb-users?hl=en --- You received this message because you are subscribed to the Google Groups "otb-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
