Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
a709e0ae
Commit
a709e0ae
authored
Oct 09, 2014
by
bruse
Browse files
Coordinate Reference Systems are listed by an enumeration type now
parent
7e0e8154
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/eu/simstadt/nf4j/CRSWKT.java
0 → 100644
View file @
a709e0ae
package
eu.simstadt.nf4j
;
/**
* This enumeration lists some of the "well known texts" (WKT) which are used to identify
* coordinate reference systems (CRS).
*
* @author Marcel Bruse
*
*/
public
enum
CRSWKT
{
EPSG_31467
(
"EPSG:31467"
),
// DHDN Gauss-Kruger zone 3
EPSG_4326
(
"EPSG:4326"
);
// WGS 84
/** The well known texts for a CRS. */
public
String
wkt
;
private
CRSWKT
(
String
wkt
)
{
this
.
wkt
=
wkt
;
}
}
src/eu/simstadt/nf4j/JobBuilderImpl.java
View file @
a709e0ae
...
...
@@ -261,7 +261,7 @@ public static ProjCoordinate transformCoordinate(ProjCoordinate wgs84Position,
CoordinateReferenceSystem
targetCRS
)
{
ProjCoordinate
result
=
new
ProjCoordinate
();
CRSFactory
f
=
new
CRSFactory
();
CoordinateReferenceSystem
sourceCRS
=
f
.
createFromName
(
"
EPSG
:
4326
"
);
// WGS 84 (used by Google Maps / OpenStreetMap)
CoordinateReferenceSystem
sourceCRS
=
f
.
createFromName
(
CRSWKT
.
EPSG
_
4326
.
wkt
);
// WGS 84 (used by Google Maps / OpenStreetMap)
BasicCoordinateTransform
transform
=
new
BasicCoordinateTransform
(
sourceCRS
,
targetCRS
);
transform
.
transform
(
wgs84Position
,
result
);
return
result
;
...
...
@@ -279,7 +279,7 @@ private static Element appendRegionPolygon(Document doc, List<Coord> regionPolyg
Element
polygon
=
doc
.
createElement
(
"polygon"
);
polygon
.
setAttribute
(
"srs"
,
"31467"
);
CRSFactory
f
=
new
CRSFactory
();
CoordinateReferenceSystem
targetCRS
=
f
.
createFromName
(
"
EPSG
:
31467
"
);
// DHDN Gauss-Kruger zone 3
CoordinateReferenceSystem
targetCRS
=
f
.
createFromName
(
CRSWKT
.
EPSG
_
31467
.
wkt
);
// DHDN Gauss-Kruger zone 3
for
(
Coord
coord
:
regionPolygon
)
{
ProjCoordinate
sourcePosition
=
new
ProjCoordinate
(
coord
.
longitude
,
coord
.
latitude
);
ProjCoordinate
targetPosition
=
transformCoordinate
(
sourcePosition
,
targetCRS
);
...
...
src/eu/simstadt/nf4j/Main.java
View file @
a709e0ae
package
eu.simstadt.nf4j
;
public
class
Main
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
NFConnector
connector
=
new
NFConnectorImpl
(
"193.196.136.164"
);
ExportJob
job
=
connector
.
requestExportJob
(
58
3
);
ExportJob
job
=
connector
.
requestExportJob
(
58
4
);
System
.
out
.
println
(
job
.
getJobId
()
+
": "
+
job
.
getStatus
()
+
" - "
+
job
.
getStatus
().
getMessage
());
connector
.
requestExportJobResult
(
583
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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