Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
d1ad9518
Commit
d1ad9518
authored
Dec 18, 2023
by
Eric Duminil
Browse files
Adding center too.
Still wrong
parent
2ad61a3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/eu/simstadt/regionchooser/RegionExtractor.java
View file @
d1ad9518
...
...
@@ -101,10 +101,12 @@ static int selectRegionDirectlyFromCityGML(String wktPolygon, String srsName, Wr
}
/**
* Returns true if bounding box of cityObjectNode intersects the polygon.
* Returns true if corners or center of bounding box of cityObjectNode are inside the polygon. Might select too much,
* which might be desirable for roads or landuse.
*/
private
static
boolean
isBoundingBoxTouching
(
CityObjectMember
cityObjectNode
,
Geometry
polygon
)
{
return
point
(
cityObjectNode
.
xMax
,
cityObjectNode
.
yMax
).
within
(
polygon
)
||
return
point
(
cityObjectNode
.
x
,
cityObjectNode
.
y
).
within
(
polygon
)
||
point
(
cityObjectNode
.
xMax
,
cityObjectNode
.
yMax
).
within
(
polygon
)
||
point
(
cityObjectNode
.
xMax
,
cityObjectNode
.
yMin
).
within
(
polygon
)
||
point
(
cityObjectNode
.
xMin
,
cityObjectNode
.
yMin
).
within
(
polygon
)
||
point
(
cityObjectNode
.
xMin
,
cityObjectNode
.
yMax
).
within
(
polygon
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment