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
78d64e52
Commit
78d64e52
authored
Jun 15, 2016
by
duminil
Browse files
RegionChooser: Beginning to merge both RegionChoosers.
parent
78ce1bc2
Changes
1
Show whitespace changes
Inline
Side-by-side
src/eu/simstadt/regionchooser/RegionExtractor.java
View file @
78d64e52
...
...
@@ -18,10 +18,15 @@
{
static
private
WKTReader
wktReader
=
new
WKTReader
();
//TODO: Test it
static
public
StringBuffer
selectRegionDirectlyFromCityGML
(
Path
citygmlPath
,
String
wktPolygon
)
throws
IOException
,
ParseException
{
// Instant start = Instant.now();
//TODO: wktPolygon should be in WGS84, and converted here to locate coordinates system
//TODO: GetSRSName, either via CityDoctorModel or reading 50 first lines of the citygmlfile
// CityDoctorModel model = CityDoctorModel.loadWithEnergyADEAndNoSchemaValidation(citygmlPath.toFile());
// GeoCoordinatesAccessor coordinates = GeoCoordinatesAccessor.coordinatesComputedFromBuildingsIfNeeded(model);
// System.out.println(coordinates.getCoordinateReferenceSystem().getName());
Geometry
poly
=
wktReader
.
read
(
wktPolygon
);
final
GeometryFactory
gf
=
new
GeometryFactory
();
//TODO: Don't read all the file. Not possible for 15GB gml files
...
...
@@ -29,7 +34,7 @@ static public StringBuffer selectRegionDirectlyFromCityGML(Path citygmlPath, Str
Pattern
cityObjectPattern
=
Pattern
.
compile
(
"(?s)<(core:)?cityObjectMember>.*?<\\/(core:)?cityObjectMember>\\s*"
);
//TODO: Allow other coordinate systems
//TODO: Allow other coordinate systems
. Either use distinc patterns depending on EPSG, or use CityDoctorModel
Pattern
gsk3CoordinatesPattern
=
Pattern
.
compile
(
"(?<![\\d\\.])(3\\d\\d\\d\\d\\d\\d[\\.\\d]*) (5\\d\\d\\d\\d\\d\\d[\\.\\d]*)"
);
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