• Keine Ergebnisse gefunden

Spatial Databases and GIS Solution for Sheet 3

N/A
N/A
Protected

Academic year: 2021

Aktie "Spatial Databases and GIS Solution for Sheet 3"

Copied!
4
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Exercises for Spatial Databases and GIS

Institut für Informationssysteme – TU Braunschweig - http://www.ifis.cs.tu-bs.de

Technische Universität Braunschweig Institut für Informationssysteme http://www.ifis.cs.tu-bs.de Karl Neumann, Sarah Tauscher

Spatial Databases and GIS Solution for Sheet 3 Exercise 1 (Geometric Operations)

What steps are necessary to determine the area of the intersection of two polygons.

a. If both are given as vector geometry?

- Determine the linear equations for all edges of both polygons.

- Calculate the intersection points and check if they are on both edges.

- Calculate the angles between the intersecting edges. The direction is im- portant (see picture below)

- Start with one intersection point, if the angle between P1(the olive rectangle in the picture above) and P2 (blue star) is positive (then the angle is marked with a green arrow) follow the edges of P2 to the next intersection point oth- erwise the edges of P1.

- Calculate the area of the polygon.

b. If both are given as raster geometry?

If the raster width and origin are the same, you have to check for each cell be- longing to the first polygon if it also belongs to the second one. If so you have to increment a counter for the area.

If the raster width or origins are different you have to transform one raster to the other first.

c. If one polygon is given as raster and the other as vector geometry?

(2)

Exercises for Spatial Databases and GIS

Institut für Informationssysteme – TU Braunschweig - http://www.ifis.cs.tu-bs.de

Technische Universität Braunschweig Institut für Informationssysteme http://www.ifis.cs.tu-bs.de Karl Neumann, Sarah Tauscher

1) Consider the center of every cell belonging to the raster polygon as a point and und use a point-in-polygon algorithm to check if it is within the vector polygon and count those that are.

2) Rasterize the vector polygon. And then b) 3) Vectorize the raster polygon and then a)

d. Which of those cases is the easiest?

b. if the raster-width and origin are the same.

2. Compress the line using the chain code and calculate the length using the com- pressed line.

Chain code: ne-n-ne-e-e-e-se-se-se-e-ne-n-ne-e-se-ne-se-se-se-se-e-e To calculate the length:

chessboard distance: count the directions and add one: 23

3. Compress the polygon using the blockcode and calculate the centroid using the com- pressed polygon.

Block code: 6,0,4 – 8,4,2 – 10,4,3 – 10,1,3 – 13,2,4 – 15,1,1 – 16,1,1 Centroids of the squares (coordinate +( size)/2):

x-coordinate: 8 – 9 – 11.5 – 11.5 – 15 – 15.5 – 16.5 y-coordinate: 2 – 5 – 5.5 – 2.5 – 4 – 1.5 – 1.5 centroid of the polygon:

x-coordinate: (16*8 + 4*9 + 9*11.5 + 9*11.5 + 16*15 + 15.5 + 16.5 )/56 ≈ 11.5 y-coordinate: ≈3.5

(3)

Exercises for Spatial Databases and GIS

Institut für Informationssysteme – TU Braunschweig - http://www.ifis.cs.tu-bs.de

Technische Universität Braunschweig Institut für Informationssysteme http://www.ifis.cs.tu-bs.de Karl Neumann, Sarah Tauscher

Exercise 2 (Shortest Path Problem)

The graph given below show ICE-connections between some german cities. The weight of each edge is the time needed to cover that distance.

1. Calculate the path with the shortest driving time from Braunschweig to every other city using one of the three algorithms presented on slides 203 to 205.

Dijkstra:

- Start with BS

- Update distances to its neighbours

- Delete edges if a shorter way to that neighbour is already known.

- Continue with the node with the shortest distance that hasn’t been visited (green) yet.

(4)

Exercises for Spatial Databases and GIS

Institut für Informationssysteme – TU Braunschweig - http://www.ifis.cs.tu-bs.de

Technische Universität Braunschweig Institut für Informationssysteme http://www.ifis.cs.tu-bs.de Karl Neumann, Sarah Tauscher

2. Why did you choose that algorithm?

Because it has the best runtime.

Referenzen

ÄHNLICHE DOKUMENTE

The Maritime Domain is all areas and things of, on , under, relating to, adjacent to, or bordering on a sea, ocean, or other navigable waterway, including all

The crisis in eastern Ukraine has not changed the Czech Republic, Hungary and Slovakia’s perception of their relations with Russia, which continues to be defined primarily

37 year-old Maude Mondesir, Janen’s water committee treasurer, can also see changes: „The availability of services sup- plying water and sanitation are starting to

China views Brussels’ Asia policies with continued suspicion while the United States thinks the EU’s ‘soft power’ approach is simply not enough.. By Axel Berkofsky

Compared to older American jets, to say nothing of the latest Russian and Chinese fighter designs, the F-35 is looking worse and worse.. "Can't turn, can't climb, can't run,"

Module A 04 – specialisation financial restructuring and insolvency management.. » redevelopment strategies and chances to restructure companies in

The ministry states that the draft law was a first proposal on how human rights due diligence could be made binding for companies if by 2020 less than half of the companies over

The prima facie duty to reply, in such cases, will be reduced to the less demanding need to cite and positively note these papers in one’s routine work, if pertinent.. Relating