我的github
posts - 3243,  comments - 42,  views - 158万

Library

The GeoTools library is organized into a series of jars. These jars form a software stack, each building on the services of the others. Individual jars such as “data” are extended with plugins in order to support additional capabilities. For data these plugins include support for common spatial formats such as shapefiles.

https://docs.geotools.org/stable/userguide/library/index.html

1. OpenGIS

Interfaces for GeoSpatial concepts, often defined by the OGC or ISO standards bodies. The interfaces in this module serve as a great reference if you do not have the time to purchase and read the official standards documents. Approach the standards using an environment you are comfortable with - Java!

地理空间概念的接口,通常由OGC或ISO标准机构定义。如果您没有时间购买和阅读官方标准文档,本模块中的界面将是一个很好的参考。使用您熟悉的环境来接近标准-Java!

../../_images/gt-opengis.png

GeoTools is all about implementing spatial solutions, and we do our very best to follow a don’t invent here policy (rather than get off topic). By referencing standards we are able to use well understood names for common spatial ideas and constructs.

GeoTools致力于实现空间解决方案,我们尽最大努力遵循“不是在这里发明”的政策(而不是偏离主题)。通过参考标准,我们能够为常见的空间想法和结构使用易于理解的名称。

The gt-opengis module provides:

gt-opengis模块提供:

  • interfaces implemented by gt-main such as Feature, FeatureType, Filter and Function

  • 由gt-main实现的接口,例如Feature,FeatureType,Filter和Function。
  • interfaces implemented by gt-coverage such as GridCoverage

  • 由gt-coverage实现的接口,例如GridCoverage。
  • interfaces implemented by gt-referencing such as CoordinateReferenceSystem

  • 由gt-referencing实现的接口,例如CoordinateReferencingSystem。
  • interfaces implemented by gt-metadata such as Citation

  • 由gt-metadata实现的接口,例如Citation。

For more information on the standards covered by the library as whole: Standards Covered

有关整个库涵盖的标准的更多信息:涵盖的标准

Reference参考

Maven:Maven依赖:

<dependency>
  <groupId>org.geotools</groupId>
  <artifactId>gt-opengis</artifactId>
  <version>${geotools.version}</version>
</dependency>

Contents目录

Model模型

GeoTools provides a clear separation between:

GeoTools提供了清晰的分割在:

  • data model - feature responsible for holding values

  • 数据模型-feature,用来存储数值。
  • query model - filter and expression used to select content and drill in and retrieve values

  • 查询模型-filter和expression,用来查询内容以及钻取以及检索数据。
  • metadata model - feature type describing contents in sufficient details for validation and query construction

  • 元数据模型-feature type,为验证和查询构造器提供足够详细的内容描述

References:

Comparison to Java:

与Java的比较:

The data structure Feature is used to hold information. Each Feature “belongs to” a FeatureType which is used to describe valid contents. This is a dynamic type system because FeatureType is a data structure we can define at runtime.

数据结构Feature用来存储信息。每一个Feature属于一种FeatureType,后者是用来描述有效的内容的。这是一种动态的类型系统,因为FeatureType是可以在运行时定义的数据结构。

The data structure Object is used to hold information. Each Object “belongs to” a Class which is used to describe valid contents. This is a static type system because Class is a data structure we need to compile before the application is started.

数据结构Object用来存储信息。每一个Object 属于一个Class,后者用来描述有效的内容。这是一个静态的类型系统,因为Class是一种我们需要在应用程序启动前编译的数据结构。

Java 例子:

复制代码
      class Flag {
            public Point location;
            public String name;
            public int classification;
            public double height;
        };

        GeometryFactory geomFactory = JTSFactoryFinder.getGeometryFactory();

        Flag here = new Flag();
        here.location = geomFactory.createPoint(new Coordinate(23.3, -37.2));
        here.name = "Here";
        here.classification = 3;
        here.height = 2.0;
复制代码

Feature例子:

复制代码
        SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
        b.setName("Flag");
        b.setCRS(DefaultGeographicCRS.WGS84);
        b.add("location", Point.class);
        b.add("name", String.class);
        b.add("classification", Integer.class);
        b.add("height", Double.class);
        SimpleFeatureType type = b.buildFeatureType();

        GeometryFactory geomFactory = JTSFactoryFinder.getGeometryFactory();

        SimpleFeatureBuilder f = new SimpleFeatureBuilder(type);
        f.add(geomFactory.createPoint(new Coordinate(23.3, -37.2)));
        f.add("here");
        f.add(3);
        f.add(2.0);
        SimpleFeature feature = f.buildFeature("fid.1");
复制代码

 

2. JTS

The JTS Topology Suite is an external project that GeoTools uses to provide an implementation of the Geometry data structure. The major benefit is the numerically stable geometry operations as a result of years of dedicated effort.

JTS拓扑套件是GeoTools用于提供几何数据结构实现的外部项目。主要的好处是,经过多年的努力,几何操作在数值上是稳定的。

../../_images/gt-jts.png

GeoTools is all about implementing spatial solutions, and we do our very best to follow a don’t invent here policy (rather than get off topic). The excellent JTS Topology Suite project offers an implementation of Geometry which we use throughout our library.

GeoTools致力于实现空间解决方案,我们尽最大努力遵循“不要在这里发明”的政策(而不是偏离主题)。优秀的JTS拓扑套件项目提供了我们在整个库中使用的几何体实现。

The GeoTools provides some help for working with JTS:

  • gt-main offers helper classes (such as JTS and Geometries) and extends JTS with a CurvedGeometryFactory for working with curves along with helper classes to translate Geometry into a Java Shape for display

References

Maven:

<dependency>
  <groupId>org.locationtech</groupId>
  <artifactId>jts</artifactId>
  <version>1.13</version>
</dependency>

Contents

 

geotools添加数据源:

geotools数据的存储和读取:

Geotools示例:Tests

geotools-18.1-bin:包含252个jar包。。。可怕

看geotools的pom.xml。。。也是几千行。。。依赖库多到爆炸

GeoTools折腾手记:https://zhuanlan.zhihu.com/p/39113566 有时候因为geotools太复杂难学直接使用数据库postgis自带的函数就够用了

posted on   XiaoNiuFeiTian  阅读(190)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2021-02-07 gulp和webpack的区别和联系
2021-02-07 Cesium-CesiumWidget, Viewer, Scene三者之间的关系
2019-02-07 Tensorflow从源代码编译2
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示