Skip to content
GitLab
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
1 year ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Adding center too.
Still wrong
parent
2ad61a3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/eu/simstadt/regionchooser/RegionExtractor.java
+4
-2
src/main/java/eu/simstadt/regionchooser/RegionExtractor.java
with
4 additions
and
2 deletions
+4
-2
src/main/java/eu/simstadt/regionchooser/RegionExtractor.java
+
4
-
2
View file @
d1ad9518
...
@@ -101,10 +101,12 @@ static int selectRegionDirectlyFromCityGML(String wktPolygon, String srsName, Wr
...
@@ -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
)
{
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
.
xMax
,
cityObjectNode
.
yMin
).
within
(
polygon
)
||
point
(
cityObjectNode
.
xMin
,
cityObjectNode
.
yMin
).
within
(
polygon
)
||
point
(
cityObjectNode
.
xMin
,
cityObjectNode
.
yMin
).
within
(
polygon
)
||
point
(
cityObjectNode
.
xMin
,
cityObjectNode
.
yMax
).
within
(
polygon
);
point
(
cityObjectNode
.
xMin
,
cityObjectNode
.
yMax
).
within
(
polygon
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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