- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.sis.io.wkt.WKTFormat.setConvention()
方法的一些代码示例,展示了WKTFormat.setConvention()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WKTFormat.setConvention()
方法的具体详情如下:
包路径:org.apache.sis.io.wkt.WKTFormat
类名称:WKTFormat
方法名:setConvention
[英]Sets the convention for parsing and formatting WKT elements.
[中]设置解析和格式化WKT元素的约定。
代码示例来源:origin: Geomatys/geotoolkit
/**
* Formats the given CRS as a string.
*
* @throws ContentFormatException if the given CRS is not formattable as a WKT.
*/
private static String format(final CoordinateReferenceSystem crs) throws ContentFormatException {
final WKTFormat format = new WKTFormat(null, null);
format.setConvention(Convention.WKT1);
format.setIndentation(WKTFormat.SINGLE_LINE);
final String wkt = format.format(crs);
final Warnings warning = format.getWarnings();
if (warning != null) {
throw new ContentFormatException(warning.toString());
}
return wkt;
}
代码示例来源:origin: apache/sis
/**
* Asserts that the WKT of the given object according the given convention is equal to the given regular expression.
* This method is like {@link #assertWktEquals(String, Object)}, but the use of regular expression allows some
* tolerance for example on numerical parameter values that may be subject to a limited form of rounding errors.
*
* @param convention the WKT convention to use.
* @param expected the expected regular expression, or {@code null} if {@code object} is expected to be null.
* @param object the object to format in <cite>Well Known Text</cite> format, or {@code null}.
*
* @since 0.6
*/
public static void assertWktEqualsRegex(final Convention convention, final String expected, final Object object) {
if (expected == null) {
assertNull(object);
} else {
assertNotNull(object);
final String wkt;
synchronized (WKT_FORMAT) {
WKT_FORMAT.setConvention(convention);
wkt = WKT_FORMAT.format(object);
}
if (!wkt.matches(expected.replace("\n", System.lineSeparator()))) {
fail("WKT does not match the expected regular expression. The WKT that we got is:\n" + wkt);
}
}
}
代码示例来源:origin: apache/sis
final WKTFormat f = new WKTFormat(locale, timezone);
if (convention != null) {
f.setConvention(convention);
代码示例来源:origin: apache/sis
/**
* Tests consistency between the parser and the formatter when using the WKT 1 format.
* This test parses a WKT, formats it then parses again. We should obtain the same result.
*
* @throws ParseException if a parsing failed.
*/
@Test
@DependsOnMethod("testConsistencyOfWKT1")
public void testConsistencyOfWKT1_WithCommonUnits() throws ParseException {
format = new WKTFormat(null, null);
format.setConvention(Convention.WKT1_COMMON_UNITS);
parser = new WKTFormat(null, null);
parser.setConvention(Convention.WKT1);
testConsistency();
testConsistencyWithDenormalizedBaseCRS();
}
代码示例来源:origin: apache/sis
/**
* Tests consistency between the parser and the formatter when using the WKT 2 format.
* This test parses a WKT, formats it then parses again. We should obtain the same result.
*
* @throws ParseException if a parsing failed.
*/
@Test
@DependsOnMethod("testConsistencyOfWKT1")
public void testConsistencyOfWKT2() throws ParseException {
format = new WKTFormat(null, null);
format.setConvention(Convention.WKT2);
parser = format;
testConsistency();
}
代码示例来源:origin: apache/sis
/**
* Tests consistency between the parser and the formatter when using the WKT 2 simplified format.
* This test parses a WKT, formats it then parses again. We should obtain the same result.
*
* @throws ParseException if a parsing failed.
*/
@Test
@DependsOnMethod("testConsistencyOfWKT2")
public void testConsistencyOfWKT2_Simplified() throws ParseException {
format = new WKTFormat(null, null);
format.setConvention(Convention.WKT2_SIMPLIFIED);
parser = format;
testConsistency();
}
代码示例来源:origin: apache/sis
/**
* Tests consistency between the parser and the formatter when using the WKT 1 format.
* This test parses a WKT, formats it then parses again. We should obtain the same result.
*
* @throws ParseException if a parsing failed.
*/
@Test
public void testConsistencyOfWKT1() throws ParseException {
format = new WKTFormat(null, null);
format.setConvention(Convention.WKT1);
parser = format;
testConsistency();
testConsistencyWithDenormalizedBaseCRS();
}
代码示例来源:origin: apache/sis
/**
* Specialization of {@link #testCoordinateReferenceSystems()} for specific cases that were known to fail.
* This is used for debugging purposes only; not included in normal test execution because it is redundant
* with {@link #testCoordinateReferenceSystems()}.
*
* @throws FactoryException if the coordinate reference system can not be created.
*
* @see <a href="https://issues.apache.org/jira/browse/SIS-433">SIS-433</a>
* @see <a href="https://issues.apache.org/jira/browse/SIS-434">SIS-434</a>
*/
public void debug() throws FactoryException {
final String code = "EPSG::29871";
final CoordinateReferenceSystem crs = CRS.forCode(code);
final WKTFormat format = new WKTFormat(null, null);
format.setConvention(Convention.WKT2);
lookup(parseAndFormat(format, code, crs), crs);
}
代码示例来源:origin: apache/sis
/**
* Asserts that the WKT of the given object according the given convention is equal to the expected one.
* This method expected the {@code “…”} quotation marks instead of {@code "…"} for easier readability of
* {@link String} constants in Java code.
*
* @param convention the WKT convention to use.
* @param expected the expected text, or {@code null} if {@code object} is expected to be null.
* @param object the object to format in <cite>Well Known Text</cite> format, or {@code null}.
*/
public static void assertWktEquals(final Convention convention, final String expected, final Object object) {
if (expected == null) {
assertNull(object);
} else {
assertNotNull(object);
final String wkt;
synchronized (WKT_FORMAT) {
WKT_FORMAT.setConvention(convention);
wkt = WKT_FORMAT.format(object);
}
assertMultilinesEquals((object instanceof IdentifiedObject) ?
((IdentifiedObject) object).getName().getCode() : object.getClass().getSimpleName(), expected, wkt);
}
}
代码示例来源:origin: apache/sis
final WKTFormat v2 = new WKTFormat(null, null);
final WKTFormat v2s = new WKTFormat(null, null);
v1 .setConvention(Convention.WKT1);
v1c.setConvention(Convention.WKT1_COMMON_UNITS);
v2 .setConvention(Convention.WKT2);
v2s.setConvention(Convention.WKT2_SIMPLIFIED);
for (final String code : CRS.getAuthorityFactory(null).getAuthorityCodes(CoordinateReferenceSystem.class)) {
if (!EXCLUDES.contains(code) && !code.startsWith("Proj4:")) {
代码示例来源:origin: apache/sis
/**
* Prints the coordinate operation or math transform in Well Known Text format.
* This information is printed only if the {@code --verbose} option was specified.
*/
private void printDetails() throws IOException {
final boolean debug = options.containsKey(Option.DEBUG);
final WKTFormat f = new WKTFormat(locale, timezone);
if (colors) f.setColors(Colors.DEFAULT);
f.setConvention(convention);
CharSequence[] lines = CharSequences.splitOnEOL(f.format(debug ? operation.getMathTransform() : operation));
for (int i=0; i<lines.length; i++) {
if (i == 0) {
printHeader(Vocabulary.Keys.Details);
} else {
printCommentLinePrefix();
outHeader.nextColumn();
}
outHeader.append(lines[i]);
outHeader.nextLine();
}
final Warnings warnings = f.getWarnings();
if (warnings != null) {
lines = CharSequences.splitOnEOL(warnings.toString());
if (lines.length != 0) { // Paranoiac check.
printHeader(Vocabulary.Keys.Note);
outHeader.append(lines[0]);
outHeader.nextLine();
}
}
}
代码示例来源:origin: apache/sis
format.setConvention(Convention.WKT1);
assertMultilinesEquals(
"PROJCS[“OSGB 1936 / British National Grid”,\n" +
format.setConvention(Convention.WKT1_COMMON_UNITS);
assertMultilinesEquals(
"PROJCS[“OSGB 1936 / British National Grid”,\n" +
我需要在不点击“保存”按钮的情况下在绘制后保存特征... 我选择使用“drawend”监听器来执行此操作... 这是我的“drawend”代码的一部分... draw.on('drawend', fu
我找不到如何在 OpenLayers 中使用 WKT 格式。 我已经尝试找到 solution in the documentation ,女巫基本上把我带到了这里:http://jsfiddle.n
我正在使用 pandas,我获得的数据集有一个 WKT 格式的位置列。例如: hospital.get_value(1,'WKT') POLYGON ((-58.4932 -34.5810,-58.4
我正在尝试使用 gdal 从多个局部坐标系投影一些基本形状。 ArcGIS 支持这些坐标系,但最终我只是厌倦了使用 gdal(和 proj4)将这些几何图形转换为基本纬度/经度(EPSG:4326)。
我是 GIS 领域的新手,我需要在 Java 中验证 WKT 格式的几何图形,以检查一个简单的多边形是否为闭环,即顶点的起点和终点应该相同。我目前正在使用 jGeometry 类的 oracle sp
我需要将数据从 Well Known-Text 转换为 Oracle SDO_Geometry。我在 Oracle 中找到了 SDO_UTIL.FROM_WKTGEOMETRY 方法,它非常适合我的
我正在开发一个使用 map 的应用程序。我想在 Java Android 中显示一个带有“洞”的多边形。我进行了搜索,但不幸的是,我找不到解决方案。我想我的问题是我无法设置正确的 fillColor。
我有一个 WKT - 包含一些几何数据的文件。 这里是一个例子(折线): s = "ST_GeomFromText( 'LINESTRING( 11.6614 48.0189, 11.6671 48.
我对oracle空间很陌生。 我有一个带有一个 SDO_GEOMETRY 列的空间表。在此表中插入 POINT 数据后,我想以 WKT 格式检索数据。 这是我所做的: 插入数据 - INSERT IN
我在here this文件中找到了。我读了它,但我一直想知道如何在WKT中定义一个具有3个环的多边形? 最佳答案 您可以使用POLYGON或MULTIPOLYGON类型,但请确保首先列出外部容器环,然
我有一个 Postgres 表,它以特定格式在其中一列中存储多边形几何图形,类似于这样- 0103000020E61000000100000004000000B8627F336B1554405DD60
我对 PostGIS 还很陌生,所以请多多包涵。 假设我有一个定义如下的表: CREATE TABLE gtest (name varchar, geom geometry); 起初,为了插入,我正在
我从mysql获取WKT数据: POLYGON((148.798828125 -34.37971258046219, 148.86474609375 -34.10270799
我在 java 中使用 ANLTR4,我可以像这样解析 WKT 多边形字符串 polygon((20 30, 30 40, 50 60, 20 30)) 使用这个词法分析器: POLYGON: ('p
我有一些众所周知的文本 (WKT) 用于表示几何对象,例如点、多点、线串、多边形、多多边形等。我有一个总共有 40000 个点的多边形。 我找到了 this plugin to convert SVG
我想使用定义为 wkt 的 POLYGON 使用 ogr2ogr 剪辑 shapefile。 根据文档,应该可以使用 WKT 作为 clipsrc [1] 但我无法获得正确的语法,我在下面有一些简化的
本文整理了Java中org.apache.sis.io.wkt.WKTFormat类的一些代码示例,展示了WKTFormat类的具体用法。这些代码示例主要来源于Github/Stackoverflow
我有一个 CSV 文件,其中的数据字段包含如下数据 POLYGON ((79.87749999947846 6.997500000409782, 79.882499999478456.99750000
我在 t-sql 语句中有以下 where 子句: where a.CELL_GEOM.STIntersects( STGeomFromText('POLYGON((-25.43623984375 4
我想将 wkt 地理转换为 jts 几何。 我尝试像这样使用 jts wkt reader。 导入 com.vividsolutions.jts.geom.Geometry; 导入 com.vivid
我是一名优秀的程序员,十分优秀!