-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add GeometryReader to avoid direct use of WKTReader from JTS (refs #232)
- Loading branch information
Showing
8 changed files
with
54 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
validator-core/src/main/java/fr/ign/validator/geometry/GeometryReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package fr.ign.validator.geometry; | ||
|
||
import org.locationtech.jts.geom.Geometry; | ||
import org.locationtech.jts.io.ParseException; | ||
import org.locationtech.jts.io.WKTReader; | ||
|
||
/** | ||
* Helper class to read geometries with a support for curved geometries. Note | ||
* that it currently supports only WKT format produced by ogr2ogr. | ||
* | ||
* @see https://github.com/IGNF/validator/issues/232 related to the introduction | ||
* of this class to avoid the direct use of WKTReader from JTS. | ||
* | ||
* @author MBorne | ||
* | ||
*/ | ||
public class GeometryReader { | ||
/** | ||
* WKT reader from JTS. | ||
*/ | ||
private WKTReader format; | ||
|
||
public GeometryReader() { | ||
this.format = new WKTReader(); | ||
} | ||
|
||
public Geometry read(String wkt) throws ParseException { | ||
return format.read(wkt); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters