GeoMedia Discussions

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 30
Registered: ‎11-02-2017
Accepted Solution

Retrieving average altitude of an area

Hello,

 

What is the best way to determine the average altitude/depth with a cell?

 

I can do it for a single point using SmartLocateService.Locate() and then examining the retrieved objects. However, this only works if the depth information exists at the exact point of query. But how do I do this for an area search?

 

For example, if I have a world map, how can I tell if any land falls anywhere within a cell? Not just at the center point of the cell?

 

Many thanks for your help!

 

Adrian

Regular Contributor
Posts: 215
Registered: ‎05-25-2016

Re: Retrieving average altitude of an area

Hi Adrian!

 

Question after question ... Life is never boring. Cat Wink

 

The first input parameter of the Locate method can be any geometry type. Not only a point geometry can be used.

 

Btw: In the past, I sometimes had problems using a point geometry. Usually I use a small square (1x1 mm) instead of a point geometry. This is more stable in my experience. (And in most cases, you don't really need exactly a point.)

 

Is that what you are looking for?

 

hesrah

Contributor
Posts: 30
Registered: ‎11-02-2017

Re: Retrieving average altitude of an area

Hi Hesrah,

 

Thank you for your help. Yes, I think this is exactly what I am looking for. I will investigate and experiment some more.

 

Lots of questions still to come I am sure Smiley Wink I was speaking to the Vice President of Strategic Sales about 30 minutes ago and said what an excellent job you guys do with helping to answer questions! It is very much appreciated!

 

Cheers


Adrian

Regular Contributor
Posts: 215
Registered: ‎05-25-2016

Re: Retrieving average altitude of an area

Hi Adrian

 

Thx4HxPts Smiley Happy

 

I'm not HxGN stuff. Could you talk to my vice president too, I'll send you her number. Soon there will be wage negotiations again. Cat LOL

 

Cheers

hesrah

Contributor
Posts: 30
Registered: ‎11-02-2017

Re: Retrieving average altitude of an area

[ Edited ]

Hi Hesrah,

 

Smiley LOL Always willing to put in a good word for good work Smiley Wink

 

Would you be able to provide any code for using a rectangeGeometry with the locate service. I tried this but it doesn't work......

 

    Private Sub IdentifySelectedObject(pt As PBasic.point)

      Dim locatedObjects As New PView.LocatedObjectsCollection

      locatedObjects.Clear()

      'Start locating by point.
      Dim pointGeom As New PBasic.RectangleGeometry
      pointGeom.Origin.X = pt.X
      pointGeom.Origin.Y = pt.Y
      pointGeom.Origin.Z = pt.Z

      _locationService.FenceMode = 1    '2 doesn't work either
      pointGeom.Width = 100
      pointGeom.Height = 100
      _locationService.Locate(pointGeom, Map.Dispatch, locatedObjects)

      If locatedObjects.Count >= 1 Then
        ' Item found
      End If

End Sub

The exact same code with a PointGeometry works fine.

 

Is there somewhere where I see coding examples? The Object Reference guide says that RectangleGeometry would work but then after hours of experimentation I find it doesn't or there is crucial information missing....

 

Many thanks for your help!

 

Adrian

Highlighted
Regular Contributor
Posts: 215
Registered: ‎05-25-2016

Re: Retrieving average altitude of an area

In the object reference is an example.

 

Do you set the PixelTolerance property? 

Contributor
Posts: 30
Registered: ‎11-02-2017

Re: Retrieving average altitude of an area

Hi Hesrah,

 

I see the example but it does not work for a rectangleGeometry for me.

 

Using the PixelTolerance property works for a pointGeometry for me, so I will use that for now.

 

Many thanks for your help!

 

Adrian