139 if (gis_type_name.equalsIgnoreCase(
"geometry")
140 || gis_type_name.equalsIgnoreCase(
"geography")) {
141 Object gis_object = rs.getObject(column_number);
142 PGgeometry pGeometry = (PGgeometry) gis_object;
143 if (pGeometry == null)
throw new SQLException(
"unknown type");
147 int semi_colon_indx = pGeometry.getValue().
indexOf(
';');
148 if (-1 != semi_colon_indx && semi_colon_indx < pGeometry.getValue().length()) {
149 return pGeometry.getValue().
substring(semi_colon_indx + 1);
151 return pGeometry.getValue();
153 StringBuffer WKT_string =
new StringBuffer();
154 if (gis_type_name.equalsIgnoreCase(
"point")) {
155 PGpoint point = (PGpoint) rs.getObject(column_number);
156 WKT_string.append(extra_types.get(gis_type_name) +
"(" +
wkt_point(point) +
")");
158 }
else if (gis_type_name.equalsIgnoreCase(
"polygon")) {
159 PGpolygon polygon = (PGpolygon) rs.getObject(column_number);
160 WKT_string.append(extra_types.get(gis_type_name) +
"((");
161 for (PGpoint p : polygon.points) {
164 WKT_string.replace(WKT_string.length() - 1, WKT_string.length(),
"))");
165 }
else if (gis_type_name.equalsIgnoreCase(
"lseg")) {
166 PGlseg lseg = (PGlseg) rs.getObject(column_number);
167 WKT_string.append(extra_types.get(gis_type_name) +
"(");
168 for (PGpoint p : lseg.point) {
171 WKT_string.replace(WKT_string.length() - 1, WKT_string.length(),
")");
173 return WKT_string.toString();
String wkt_point(PGpoint point)
size_t indexOf(std::vector< T > &vec, T val)