@@ -36,66 +36,6 @@ class Geometry {
36
36
*/
37
37
static PreparedGeometryFactory preparedFactory = new PreparedGeometryFactory ()
38
38
39
- /**
40
- * The WKT Writer
41
- */
42
- private static WktWriter wktWriter = new WktWriter ()
43
-
44
- /**
45
- * The WKT Reader
46
- */
47
- private static WktReader wktReader = new WktReader ()
48
-
49
- /**
50
- * The WKB Writer
51
- */
52
- private static WkbWriter wkbWriter = new WkbWriter ()
53
-
54
- /**
55
- * The WKB Reader
56
- */
57
- private static WkbReader wkbReader = new WkbReader ()
58
-
59
- /**
60
- * The KML Writer
61
- */
62
- private static KmlWriter kmlWriter = new KmlWriter ()
63
-
64
- /**
65
- * The KML Reader
66
- */
67
- private static KmlReader kmlReader = new KmlReader ()
68
-
69
- /**
70
- * The GeoJSON Writer
71
- */
72
- private static GeoJSONWriter geoJSONWriter = new GeoJSONWriter ()
73
-
74
- /**
75
- * The GeoJSON Reader
76
- */
77
- private static GeoJSONReader geoJSONReader = new GeoJSONReader ()
78
-
79
- /**
80
- * The GML2 Writer
81
- */
82
- private static Gml2Writer gml2Writer = new Gml2Writer ()
83
-
84
- /**
85
- * The Gml2 Reader
86
- */
87
- private static Gml2Reader gml2Reader = new Gml2Reader ()
88
-
89
- /**
90
- * The GML3 Writer
91
- */
92
- private static Gml3Writer gml3Writer = new Gml3Writer ()
93
-
94
- /**
95
- * The Gml3 Reader
96
- */
97
- private static Gml3Reader gml3Reader = new Gml3Reader ()
98
-
99
39
/**
100
40
* Create a new Geometry wrapping a JTS Geometry
101
41
* @param g The JTS Geometry
@@ -796,55 +736,55 @@ class Geometry {
796
736
* @return The WKT of this Geometry
797
737
*/
798
738
String getWkt () {
799
- wktWriter . write(this )
739
+ new WktWriter () . write(this )
800
740
}
801
741
802
742
/**
803
743
* Get the WKB of the Geometry
804
744
* @return The WKB hex string of this Geometry
805
745
*/
806
746
String getWkb () {
807
- wkbWriter . write(this )
747
+ new WkbWriter () . write(this )
808
748
}
809
749
810
750
/**
811
751
* Get the WKB of the Geometry
812
752
* @return The WKB byte array of this Geometry
813
753
*/
814
754
byte [] getWkbBytes () {
815
- wkbWriter . writeBytes(this )
755
+ new WkbWriter () . writeBytes(this )
816
756
}
817
757
818
758
/**
819
759
* Get a KML String for this Geometry
820
760
* @return The KML String
821
761
*/
822
762
String getKml () {
823
- kmlWriter . write(this )
763
+ new KmlWriter () . write(this )
824
764
}
825
765
826
766
/**
827
767
* Get a GeoJSON String for this Geometry
828
768
* @return The GeoJSON String
829
769
*/
830
770
String getGeoJSON () {
831
- geoJSONWriter . write(this )
771
+ new GeoJSONWriter () . write(this )
832
772
}
833
773
834
774
/**
835
775
* Get a GML 2 String for this Geometry
836
776
* @return The GML 2 String
837
777
*/
838
778
String getGml2 () {
839
- gml2Writer . write(this )
779
+ new Gml2Writer () . write(this )
840
780
}
841
781
842
782
/**
843
783
* Get a GML 3 String for this Geometry
844
784
* @return The GML 3 String
845
785
*/
846
786
String getGml3 () {
847
- gml3Writer . write(this )
787
+ new Gml3Writer () . write(this )
848
788
}
849
789
850
790
/**
@@ -980,7 +920,7 @@ class Geometry {
980
920
* @return A Geometry
981
921
*/
982
922
static Geometry fromWKT (String wkt ) {
983
- wktReader . read(wkt)
923
+ new WktReader () . read(wkt)
984
924
}
985
925
986
926
/**
@@ -989,7 +929,7 @@ class Geometry {
989
929
* @return A Geometry
990
930
*/
991
931
static Geometry fromWKB (byte [] wkb ) {
992
- wkbReader . read(wkb)
932
+ new WkbReader () . read(wkb)
993
933
}
994
934
995
935
/**
@@ -998,7 +938,7 @@ class Geometry {
998
938
* @return A Geometry
999
939
*/
1000
940
static Geometry fromWKB (String wkb ) {
1001
- wkbReader . read(wkb)
941
+ new WkbReader () . read(wkb)
1002
942
}
1003
943
1004
944
/**
@@ -1007,7 +947,7 @@ class Geometry {
1007
947
* @return A Geometry
1008
948
*/
1009
949
static Geometry fromKml (String kml ) {
1010
- kmlReader . read(kml)
950
+ new KmlReader () . read(kml)
1011
951
}
1012
952
1013
953
/**
@@ -1016,7 +956,7 @@ class Geometry {
1016
956
* @return A Geometry
1017
957
*/
1018
958
static Geometry fromGeoJSON (String geoJSON ) {
1019
- geoJSONReader . read(geoJSON)
959
+ new GeoJSONReader () . read(geoJSON)
1020
960
}
1021
961
1022
962
/**
@@ -1025,7 +965,7 @@ class Geometry {
1025
965
* @return A Geometry
1026
966
*/
1027
967
static Geometry fromGML2 (String gml2 ) {
1028
- gml2Reader . read(gml2)
968
+ new Gml2Reader () . read(gml2)
1029
969
}
1030
970
1031
971
/**
@@ -1034,7 +974,7 @@ class Geometry {
1034
974
* @return A Geometry
1035
975
*/
1036
976
static Geometry fromGML3 (String gml3 ) {
1037
- gml3Reader . read(gml3)
977
+ new Gml3Reader () . read(gml3)
1038
978
}
1039
979
1040
980
/**
0 commit comments