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
24b24d58
Commit
24b24d58
authored
May 18, 2016
by
duminil
Browse files
RegionChooser: Todos
parent
4e46e9df
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/eu/simstadt/regionchooser/RegionExtractor.java
View file @
24b24d58
...
@@ -18,16 +18,18 @@
...
@@ -18,16 +18,18 @@
{
{
static
private
WKTReader
wktReader
=
new
WKTReader
();
static
private
WKTReader
wktReader
=
new
WKTReader
();
//TODO: Test it
static
public
StringBuffer
selectRegionDirectlyFromCityGML
(
Path
citygmlPath
,
String
wktPolygon
)
static
public
StringBuffer
selectRegionDirectlyFromCityGML
(
Path
citygmlPath
,
String
wktPolygon
)
throws
IOException
,
ParseException
{
throws
IOException
,
ParseException
{
//TODO: Write directly to file
// Instant start = Instant.now();
// Instant start = Instant.now();
Geometry
poly
=
wktReader
.
read
(
wktPolygon
);
Geometry
poly
=
wktReader
.
read
(
wktPolygon
);
final
GeometryFactory
gf
=
new
GeometryFactory
();
final
GeometryFactory
gf
=
new
GeometryFactory
();
//TODO: Don't read all the file. Not possible for 15GB gml files
String
s
=
new
String
(
Files
.
readAllBytes
(
citygmlPath
),
Charset
.
defaultCharset
());
String
s
=
new
String
(
Files
.
readAllBytes
(
citygmlPath
),
Charset
.
defaultCharset
());
Pattern
cityObjectPattern
=
Pattern
Pattern
cityObjectPattern
=
Pattern
.
compile
(
"(?s)<(core:)?cityObjectMember>.*?<\\/(core:)?cityObjectMember>\\s*"
);
.
compile
(
"(?s)<(core:)?cityObjectMember>.*?<\\/(core:)?cityObjectMember>\\s*"
);
//TODO: Allow other coordinate systems
Pattern
gsk3CoordinatesPattern
=
Pattern
Pattern
gsk3CoordinatesPattern
=
Pattern
.
compile
(
"(?<![\\d\\.])(3\\d\\d\\d\\d\\d\\d[\\.\\d]*) (5\\d\\d\\d\\d\\d\\d[\\.\\d]*)"
);
.
compile
(
"(?<![\\d\\.])(3\\d\\d\\d\\d\\d\\d[\\.\\d]*) (5\\d\\d\\d\\d\\d\\d[\\.\\d]*)"
);
Matcher
cityObjectMatcher
=
cityObjectPattern
.
matcher
(
s
);
Matcher
cityObjectMatcher
=
cityObjectPattern
.
matcher
(
s
);
...
...
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