Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
da7ce302
Commit
da7ce302
authored
3 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Feat: Add entrypoints for parsing CityModel from Stream
parent
d1bfb680
master
dev
dev_cpp_code_conversion
dev_gui_features_zip_loading
3.17.0
archive/dev_gui_features_zip_loading
2 merge requests
!28
Version 3.17.0 Release
,
!26
Add ZIP-archive support
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java
+35
-0
...va/de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java
with
35 additions
and
0 deletions
+35
-0
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java
+
35
-
0
View file @
da7ce302
...
...
@@ -196,6 +196,41 @@ public class CityGmlParser {
}
}
public
static
CityDoctorModel
parseCityGmlStream
(
InputStream
is
,
ParserConfiguration
config
)
throws
CityGmlParseException
,
InvalidGmlFileException
{
return
parseCityGmlStream
(
is
,
config
,
null
,
null
);
}
public
static
CityDoctorModel
parseCityGmlStream
(
InputStream
is
,
ParserConfiguration
config
,
ProgressListener
l
)
throws
CityGmlParseException
,
InvalidGmlFileException
{
return
parseCityGmlStream
(
is
,
config
,
l
,
null
);
}
public
static
CityDoctorModel
parseCityGmlStream
(
InputStream
is
,
ParserConfiguration
config
,
ProgressListener
l
,
GMLValidationHandler
handler
)
throws
CityGmlParseException
,
InvalidGmlFileException
{
CityGMLContext
context
=
getContext
();
if
(
config
.
getValidate
())
{
//TODO: Think of something to validate Inputstream
throw
new
InvalidGmlFileException
(
"Invalid GML File."
);
}
try
{
parseEpsgCodeFromStream
(
is
,
config
);
CityGMLInputFactory
in
=
context
.
createCityGMLInputFactory
()
.
withChunking
(
ChunkOptions
.
chunkByProperties
(
chunkProperties
).
skipCityModel
(
false
));
try
(
ObservedInputStream
ois
=
new
ObservedInputStream
(
is
,
is
.
available
())){
if
(
l
!=
null
){
ois
.
addListener
(
l:
:
updateProgress
);
}
return
readAndKeepFeatures
(
config
,
Path
.
of
(
""
),
in
,
ois
);
}
}
catch
(
CityGMLReadException
|
IOException
|
ParserConfigurationException
|
SAXException
e
)
{
logger
.
error
(
e
);
throw
new
CityGmlParseException
(
"Failed to read CityGML file"
,
e
);
}
}
public
static
void
streamCityGml
(
String
file
,
ParserConfiguration
config
,
CityGmlConsumer
cityObjectConsumer
,
String
outputFile
)
throws
CityGmlParseException
{
Path
f
=
Paths
.
get
(
file
);
...
...
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
Menu
Explore
Projects
Groups
Snippets