org.geolatte.geom.codec.Sfa121WktDecoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geolatte-geom Show documentation
Show all versions of geolatte-geom Show documentation
This geoLatte-geom library offers a geometry model that conforms to the OGC Simple Features for SQL
specification.
The newest version!
package org.geolatte.geom.codec;
import org.geolatte.geom.Geometry;
import org.geolatte.geom.Position;
import org.geolatte.geom.crs.CoordinateReferenceSystem;
/**
* A WKT decoder for the format specified in Simple Feature Access, version 1.2.1
*/
public class Sfa121WktDecoder implements WktDecoder {
@Override
public Geometry
decode(String wkt, CoordinateReferenceSystem
crs) {
return new Sfa121WktParser<>(wkt, crs).parse();
}
}
class Sfa121WktParser
extends BaseWktParser
{
Sfa121WktParser(String wkt, CoordinateReferenceSystem
crs) {
super(Sfa110WktDialect.INSTANCE, wkt, crs);
}
@Override
protected void matchesOptionalZMMarkers() {
tokenizer.skipWhitespace();
if (tokenizer.matchesOneOf('Z', 'z').isPresent()) {
this.hasZMark = true;
}
if (tokenizer.matchesOneOf('M', 'm').isPresent()) {
this.hasMMark = true;
}
}
}