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
cf59f25e
Commit
cf59f25e
authored
Apr 21, 2017
by
duminil
Browse files
Try to build BuildingXmlNode
parent
eaacae87
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/eu/simstadt/lowlevelgmlparser/BuildingXmlNode.java
0 → 100644
View file @
cf59f25e
package
eu.simstadt.lowlevelgmlparser
;
import
com.ximpleware.AutoPilot
;
import
com.ximpleware.NavException
;
import
com.ximpleware.VTDNav
;
public
class
BuildingXmlNode
{
private
int
buildingOffset
;
private
int
buildingLength
;
private
VTDNav
navigator
;
private
AutoPilot
coordinatesFinder
;
public
BuildingXmlNode
(
VTDNav
navigator
,
int
buildingOffset
,
int
buildingLength
)
{
this
.
navigator
=
navigator
;
this
.
coordinatesFinder
=
new
AutoPilot
(
navigator
);
//COULD BE STATIC?
this
.
buildingLength
=
buildingLength
;
this
.
buildingOffset
=
buildingOffset
;
}
public
String
toString
()
{
try
{
return
navigator
.
toRawString
(
buildingOffset
,
buildingLength
);
}
catch
(
NavException
ex
)
{
return
null
;
}
}
}
src/eu/simstadt/lowlevelgmlparser/CityGmlIterator.java
View file @
cf59f25e
...
...
@@ -55,7 +55,8 @@ public String next() {
offsetAndLength
=
navigator
.
getElementFragment
();
buildingOffset
=
(
int
)
offsetAndLength
;
buildingLength
=
(
int
)
(
offsetAndLength
>>
32
);
return
navigator
.
toRawString
(
buildingOffset
,
buildingLength
);
BuildingXmlNode
b
=
new
BuildingXmlNode
(
navigator
,
buildingOffset
,
buildingLength
);
return
b
.
toString
();
}
catch
(
NavException
ex
)
{}
return
null
;
}
...
...
src/eu/simstadt/regionchooser/RegionExtractor.java
View file @
cf59f25e
...
...
@@ -18,6 +18,7 @@
import
com.ximpleware.VTDNav
;
import
com.ximpleware.XPathEvalException
;
import
com.ximpleware.XPathParseException
;
import
eu.simstadt.lowlevelgmlparser.CityGmlIterator
;
public
class
RegionExtractor
...
...
@@ -30,6 +31,12 @@ static public StringBuffer selectRegionDirectlyFromCityGML(Path citygmlPath, Str
throws
SAXParseException
,
XMLStreamException
,
ParseException
,
XPathParseException
,
NavException
,
NumberFormatException
,
XPathEvalException
,
IOException
{
CityGmlIterator
citygml
=
new
CityGmlIterator
(
citygmlPath
);
for
(
String
lowLevelBuildingXML
:
citygml
)
{
System
.
out
.
println
(
lowLevelBuildingXML
.
length
());
}
Geometry
poly
=
wktReader
.
read
(
wktPolygon
);
final
GeometryFactory
gf
=
new
GeometryFactory
();
StringBuffer
sb
=
new
StringBuffer
();
...
...
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