## 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
Do you mean
Highlighted
Contributor
Posts: 25
Registered: ‎02-24-2017

# Spatial Query Of Rectangle/Grid

[ Edited ]

Dear All

• In GeoMedia 16.1 I’m trying to create a rectangle.
• The rectangle should contain a grid, for instance 25m
1. Horizontal Line: 1-10
2. Vertical line: A-J
• With this given info it should be possible to perform a spatial query. For example;
1. What's the content of grid B8?
1. Result: Pastures, Houses, Forest, Road
2. In which Grid number are the town churches located?
1. Result: F8 and A2

Let me know asap if this is even possible in GM2016!

Kind regards

Phil

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

## Re: Spatial Query Of Rectangle/Grid

Hi Phil

It should be possible to generate the grid: Fill a data table with the grid elements/ centerpoint of the rectangles (should be easy with a table calculation like excel). Use functional attributes to build the rectangle geometries (construct the vertices of the rectangle geometrie with four shifts of the centerpoint).

What you can do with spatial query depends on the data. Your question/example is not very concret regarding the data model. Your first output example looks like the result of an aggregation query, the second output like a "normal" spatial query (operator overlaps or something like that).

Best regards,

hesrah

Highlighted
Contributor
Posts: 25
Registered: ‎02-24-2017

## Re: Spatial Query Of Rectangle/Grid

[ Edited ]

Hi hesrah

Reading the first part, I have no clue what you mean.

The second part I fully understand.

Regarding the first part, is it possible to send me a dummy / demo excel file so I can load it into GM? Btw, how do I load an excel file?

At the end I only need a spatial grid in which I can perform queries…

Kind regards

Phil

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

## Re: Spatial Query Of Rectangle/Grid

Hi Phil

The Excel list looks like (3x3 grid, victive coordinates):

row line x y

1 1 235000 756000

1 2 235000 756100

1 3 235000 756200

2 1 235100 756000

2 2 235100 756100

2 3 235100 756200

3 1 235200 756000

3 2 235200 756100

3 3 235200 756200

Should be easy to generate with Excel expressions.

To load an Excel file in GeoMedia, you need a read-write connection. In the dialog feature class definition there is a function to attach Ecxel (office 97) data.

Or you copy the Excel data in a new database table, it's easy done with copy-paste.

Now you can geocode the grid points. And use a functional attribute to create the rectangle to each geocoded point geometry

The funtional attribute expression looks like

CREATEPOLYGON(MOVE(Input.GeocodedPointGeometry;-50;-50;0;ProjectedMeas);MOVE(Input.GeocodedPointGeometry;50;-50;0;ProjectedMeas);MOVE(Input.GeocodedPointGeometry;50;50;0;ProjectedMeas);MOVE(Input.GeocodedPointGeometry;-50;50;0;ProjectedMeas))

Of course the parameters vary depending to your desired settings.

Best regards,

hesrah

Highlighted
Frequent Contributor
Posts: 129
Registered: ‎11-10-2015

Hi,