Geo data and library Hand Book
=======
2019.12.14 GeoSaturday 作業開始
Geo系データ、ライブラリ、プログラムをプログラマが使いたいときの参考ページ 記述の追加、間違いの指摘、サンプルコードやリンクの追加は歓迎
## Geo data用ライブラリ(データ読み書き等基礎系)
- GDAL/OGR
- 多数のラスタ/ベクタ形式データの読み書き、操作のライブラリ。(QGISのプラグインとしても利用可能)
- API インタフェース: C、C++、Python、Java、C#、Ruby、VB6、Perl
- ライセンス X/MIT style Open Source license
- [WEBサイト](https://gdal.org/)
- [ソースコードリポジトリ](https://github.com/OSGeo/GDAL)
- Geotools
- 多数の空間データ操作、読み書きのためのJavaライブラリ
- ライセンス GNU Lesser General Public License (GPL).
- [WEBサイト](https://www.geotools.org/)
- API インタフェース: Java
- SharpMap
- API インタフェース: C#
- [ソースコードリポジトリ](https://github.com/SharpMap/SharpMap)
- ライセンス GNU Lesser General Public License v2.1
- Rasterio
- ラスタデータ読み書きライブラリ
- [WEBサイト](https://rasterio.readthedocs.io/en/stable/index.html)
- API インタフェース: Python
- ライセンス [Copyright (c) 2016, MapBox All rights reserved](https://rasterio.readthedocs.io/en/stable/intro.html#rasterio-license)
- [ソースコードリポジトリ](https://github.com/mapbox/rasterio)
- GeoPHP
- [WEBサイト](https://geophp.net/)
- [ソースコードリポジトリ](https://github.com/phayes/geoPHP)
- API インタフェース: PHP
- ライセンス This library is open-source and dual-licensed under both the Modified BSD License and GPLv2. Either license may be used at your option.
- PDAL
- ポイントクラウド用抽象ライブラリ
- [WEBサイト](https://pdal.io/)
- API インタフェース: c++
- ライセンス BSD
- [ソースコードリポジトリ](https://github.com/PDAL/PDAL)
- MDAL
- メッシュデータ用抽象ライブラリ
- [WEBサイト](https://www.mdal.xyz/)
- API インタフェース: c++
- ライセンス MIT
- [ソースコードリポジトリ](https://github.com/lutraconsulting/MDAL)
## Geo data用ライブラリ(データ操作系)
- JTS Topology Suite
- ベクタジオメトリ作成、操作用Javaライブラリ
- [WEBサイト](https://projects.eclipse.org/projects/locationtech.jts)
- ライセンス Eclipse Distribution License 1.0 (BSD) , Eclipse Public License 1.0
- [リポジトリ](https://github.com/locationtech/jts)
- GEOS Geometry Engine, Open Source
- JTS Topology Suite を C++に移植したもの
- [WEBサイト](https://trac.osgeo.org/geos/)
- [ソースコードリポジトリ](https://git.osgeo.org/gitea/geos/geos.git)
- API インタフェース: C、C++、PHP
- ライセンス GNU Lesser General Public License (LGPL).
- NetTopologySuite
- JTSを .NET Frameworkに移植したもの
- [ソースコードリポジトリ](https://github.com/NetTopologySuite/NetTopologySuite)
- JSTS JavaScript Topology Suite
- [ソースコードリポジトリ](https://github.com/bjornharrtell/jsts)
- [WEBサイト](http://bjornharrtell.github.io/jsts/)
- API インタフェース: JavaScript
- ライセンス dual BSD/EPL liceence
- turf.js
- JavaScript空間演算ライブラリ
- [WEBサイト](https://turfjs.org/)
- ライセンス MIT License
- [ソースコードリポジトリ](https://github.com/Turfjs/turf)
- proj
- 投影変換ライブラリ
- [WEBサイト](https://proj.org/)
- ライセンス MIT License
- GeoPandas
- Pythonのデータ分析用パッケージPandasで空間情報が利用できるようにした拡張
- [WEBサイト](http://geopandas.org/)
- pgRouting
- PostGIS/PostgreSQLで経路探索を行うための拡張
- [WEBサイト](http://www.pgrouting.org)
- ライセンス GNU General Public License (GPL) version 2
- API インタフェース: SQL
- [商用サポート](http://www.pgrouting.org/support.html)
- OTB
- 画像処理 (QGISプラグインでも利用可能)
- [WEBサイト](http://www.orfeo-toolbox.org/)
- ライセンス Apache v2.0
- API インタフェース: C++
- R
- Mapnik
- MapSlicer
## Geo data用ライブラリ システム(表示、操作環境 デスクトップ、サーバ)
- QGIS
- 汎用デスクトップGIS Server Web Client
- [WEBサイト](https://www.qgis.org/)
- API インタフェース: C++ Python Web ClientはJavaScript
- ライセンス GNU GPL
- [PyQGIS Cock book](https://docs.qgis.org/3.4/ja/docs/pyqgis_developer_cookbook/index.html)
- [QGIS API](https://qgis.org/api/)
- GMT
- 空間データ描画用コマンドラインツール群
- [WEBサイト](https://www.generic-mapping-tools.org/)
- ライセンス LGPL
- [リポジトリ](https://github.com/GenericMappingTools)
- GRASS GIS
- 空間データ加工、描画用コマンド群(QGISのプラグインとしても利用可能)
- [WEBサイト](https://grass.osgeo.org)
- ライセンス GNU General Public License (GPL) version 2+
- API インタフェース: C, Python, Bourne Shell
- gvSIG Desktop
- デスクトップGIS
- [WEBサイト](http://www.gvsig.com/)
- ライセンス GNU General Public License (GPL) version 2+
- [サポートML](http://www.gvsig.com/en/community/mailing-lists)
- [サポート](http://www.gvsig.com/en/gvsig-association)
- uDig
- デスクトップGIS
- [WEBサイト](http://udig.refractions.net/)
- ライセンス Dual BSD / EPL (Eclipse Foundation)
- API インタフェース: GeoTools, ImageIO-Ext, Java Advanced Imaging, Eclipse Rich Client Platform, Eclipse Modelling Framework
- [サポート](http://udig.refractions.net/users/)
- [開発者サポート](http://udig.refractions.net/developers/)
- OpenJUMP GIS
- デスクトップGIS
- [WEBサイト](http://www.openjump.org)
- ライセンス GPL
- API インタフェース: GeoTools, ImageIO-Ext, Java Advanced Imaging, Eclipse Rich Client Platform, Eclipse Modelling Framework
- [コミュニティサポート](http://www.openjump.org/support.html)
- [コマーシャルサポート](http://ojwiki.soldin.de/index.php?title=Professional_Support_Page)
- [ダウンロードページ](http://sourceforge.net/projects/jump-pilot/files/)
- SAGA
- 地形解析、水文解析が強いデスクトップGIS(QGISのプラグインとしても利用可能)
- [WEBサイト](http://www.saga-gis.org)
- ライセンス LGPL v2.1 (api); GPLv2 (GUI and modules)
- API インタフェース: C++, Python, R
- CloudCompare
- 3次元ポイントクラウド編集、加工ソフトウェア
- [WEBサイト](https://www.cloudcompare.org/)
- ライセンス GPL2
- [リポジトリ](https://github.com/cloudcompare/cloudcompare)
## Geo data用ライブラリ(表示、操作環境 WEBクライアント)
- OpenLayers
- 2次元WEB地図操作用 JavaScriptライブラリ
- [WEBサイト](https://openlayers.org/)
- ライセンス 2-clause BSD License
- LeafLet
- 2次元WEB地図操作用 JavaScriptライブラリ
- [WEBサイト](https://leafletjs.com/)
- API インタフェース: JavaScript
- ライセンス BSD
- GeoExt
- 2次元WEB地図操作用 JavaScriptライブラリ
- [WEBサイト](https://geoext.github.io/geoext3/)
- API インタフェース: JavaScript
- ライセンス GPLv3 or BSD License dependent on ExtJS license
- MapBox GL JS
- [WEBサイト](https://docs.mapbox.com/mapbox-gl-js/api/)
- Cesium
- 2次元,3次元WEB地図操作用 JavaScriptライブラリ WebGL利用
- [WEBサイト](https://cesium.com/cesiumjs/)
- ライセンス Apache 2.0 license
- [コミュニティサポート](https://cesiumjs.org/forum/)
- iTowns
- [WEBサイト](http://www.itowns-project.org/)
- vts-geospatial
- [WEBサイト](https://www.melowntech.com/products/vts-geospatial/)
- Potree
- ポイントクラウド操作用ライブラリ WebGL利用
- [WEBサイト](http://potree.org/)
- ライセンス [Copyright (c) 2011-2017, Markus Schütz All rights reserved.](https://github.com/potree/potree/blob/develop/LICENSE)
## Geo data用ライブラリ(表示、操作環境 、WEBシステム用フレームワーク)
- GeoDjango
- [WEBサイト](https://docs.djangoproject.com/en/3.0/ref/contrib/gis/#)
- GEOMAJAS
- [WEBサイト](http://www.geomajas.org/geomajas)
- API インタフェース: Java JavaScript
- ライセンス AGPL
- Mapbender
- [WEBサイト](https://www.mapbender.org/)
- ライセンス MIT license
- [サポート](https://www.mapbender.org/en/community)
- GeoMoose
- [WEBサイト](https://www.geomoose.org/)
- ライセンス MIT license
- [顧客サポート](https://www.geomoose.org/info/commercial_support.html)
- [コミュニティサポート](https://www.geomoose.org/info/mailing_lists.html)
- GeoNode
- 空間コンテンツ管理システム
- [WEBサイト](http://geonode.org/)
- ライセンス GNU General Public License (GPL) version 2.0
- API インタフェース: Python (Django)
- [サポート](http://opengeo.org/technology/geonode/)
## Geo data 配信、変換、WEB Service system
- GeoServer
- OGCプロトコル等各種空間データ配信サーバ
- [WEBサイト](http://geoserver.org/)
- MapServer
- OGCプロトコル等各種空間データ配信サーバ
- [WEBサイト](https://mapserver.org/)
- MapProxy
- ラスタ配信プロトコル変換、座標変換、画像形式変換プロキシサーバ
- [WEBサイト](https://mapproxy.org/)
- ZOO Project
- WPS(Web processing service)システム
- [WEBサイト](http://zoo-project.org/)
- TileServerGL
- タイル(ベクタ、ラスタ)配信サーバ
- [WEBサイト](http://tileserver.org/)
- [リポジトリ](https://github.com/klokantech/tileserver-gl)
- [Live demo](https://maps.klokantech.com/)
- t-rex
- バイナリベクタタイル配信サーバ
- [WEBサイト](https://t-rex.tileserver.ch/)
- [リポジトリ](https://github.com/t-rex-tileserver/t-rex/)
- GeoMesa
- 巨大空間データ解析、配信サービス
- ライセンス Apache License, Version 2.0
- [WEBサイト](https://www.geomesa.org/)
- [リポジトリ](https://github.com/locationtech/geomesa)
- [ユーザマニュアル](https://www.geomesa.org/documentation/user/index.html)
- MapCache
- deegree
- ncWMS
- EOxServer
- GeoNetwork
- pycsw
- pyWPS
- QGIS Server
- istSOS
- 52 North SOS
- 52 North WPS
- Actina
## 空間データ格納 データ管理システム
- PostGIS
- Spatialite
- Rasdamen
- MySQL
- GeoGig
- 空間データ分散バージョン管理システム
- ライセンス Eclipse Distribution License 1.0 (BSD)
- [WEBサイト](http://geogig.org/)
- [リポジトリ](https://github.com/locationtech/geogig)
- [ドキュメント](http://geogig.org/docs/index.html)
## protocol 空間データネットワーク配信用等規約
- WMS
- WFS
- WPS
- CSW
- Slippy tile (XYZ tile)
- TMS
- 3DTiles
## Vector data
- Aeronav FAA
- [GDAL page](https://gdal.org/drivers/vector/aeronavfaa.html)
- AmigoCloud
- [GDAL page](https://gdal.org/drivers/vector/amigocloud.html)
- ESRI ArcObjects
- [GDAL page](https://gdal.org/drivers/vector/ao.html)
- ARCGEN - Arc/Info Generate
- [GDAL page](https://gdal.org/drivers/vector/arcgen.html)
- Arc/Info Binary Coverage
- [GDAL page](https://gdal.org/drivers/vector/avcbin.html)
- Arc/Info E00 (ASCII) Coverage
- [GDAL page](https://gdal.org/drivers/vector/avce00.html)
- BNA - Atlas BNA
- [GDAL page](https://gdal.org/drivers/vector/bna.html)
- CAD – AutoCAD DWG
- [GDAL page](https://gdal.org/drivers/vector/cad.html)
- Carto
- [GDAL page](https://gdal.org/drivers/vector/carto.html)
- Cloudant – Cloudant
- [GDAL page](https://gdal.org/drivers/vector/cloudant.html)
- CouchDB - CouchDB/GeoCouch
- [GDAL page](https://gdal.org/drivers/vector/couchdb.html)
- [Introduce GeoSpatial Index To CouchDB](https://github.com/cloudant-labs/hastings/wiki/Introduce-GeoSpatial-Index-To-CouchDB)
- Comma Separated Value (.csv)
- [GDAL page](https://gdal.org/drivers/vector/csv.html)
sample code read csv layer using QGIS3.x API
```Python=
import os
from qgis.core import *
from qgis.gui import *
from qgis.PyQt.QtWidgets import QAction, QMainWindow
from qgis.PyQt.QtCore import Qt
#
# QGIS インストール位置を環境変数 QGIS_PREFIX_PATH から取得
qgis_installed=os.environ['QGIS_PREFIX_PATH']
# QGIS インストールパス指定
QgsApplication.setPrefixPath(qgis_installed, True)
# Create a reference to the QgsApplication.
# Setting the second argument to True enables the GUI. We need
# this since this is a custom application.
qgs = QgsApplication([], True)
# load providers
qgs.initQgis()
uri='file:///C:/work/csvtest/hinan.csv?delimiter=,&encoding=UTF-8&xField=x&yField=y'
output_dir = 'C:/work/csvtest/hinan.tif'
csvlayer = QgsVectorLayer(uri, "hinan", "delimitedtext")
# CSV レイヤのオープン成功
if csvlayer.isValid():
canvas = QgsMapCanvas()
canvas.setCanvasColor(Qt.white)
# enable this for smooth rendering
canvas.enableAntiAliasing(True)
print("Layer load OK")
canvas.setExtent(csvlayer.extent())
canvas.setLayers([csvlayer])
canvas.refresh()
# rendering my map canvas to tif image
settings = canvas.mapSettings()
settings.setLayers([csvlayer])
job = QgsMapRendererParallelJob(settings)
job.start()
job.waitForFinished()
image = job.renderedImage()
image.save(output_dir)
#QgsProject.instance().addMapLayer(csvlayer)
#features = csvlayer.getFeatures()
#for feature in features:
# attrs = feature.attributes()
# print(attrs)
# csv レイヤオープン失敗
else:
print("csv Layer failed to load!")
# Write your code here to load some layers, use processing
# algorithms, etc.
# Finally, exitQgis() is called to remove the
# provider and layer registries from memory
qgs.exitQgis()
```
- CSW - OGC CSW (Catalog Service for the Web)
- [GDAL page](https://gdal.org/drivers/vector/csw.html)
- DB2 Spatial
- [GDAL page](https://gdal.org/drivers/vector/db2.html)
- Microstation DGN
- [GDAL page](https://gdal.org/drivers/vector/dgn.html)
- Microstation DGN v8
- [GDAL page](https://gdal.org/drivers/vector/dgnv8.html)
- DODS/OPeNDAP
- [GDAL page](https://gdal.org/drivers/vector/dods.html)
- AutoCAD DWG
- [GDAL page](https://gdal.org/drivers/vector/dwg.html)
- AutoCAD DXF
- [GDAL page](https://gdal.org/drivers/vector/dxf.html)
- Google Earth Engine Data API
- [GDAL page](https://gdal.org/drivers/vector/eeda.html)
- EDIGEO
- [GDAL page](https://gdal.org/drivers/vector/edigeo.html)
- ElasticSearch: Geographically Encoded Objects for ElasticSearch
- [GDAL page](https://gdal.org/drivers/vector/elasticsearch.html)
- ESRIJSON / FeatureService driver
- [GDAL page](https://gdal.org/drivers/vector/esrijson.html)
- ESRI File Geodatabase (FileGDB)
- [GDAL page](https://gdal.org/drivers/vector/filegdb.html)
- FlatGeobuf
- [GDAL page](https://gdal.org/drivers/vector/flatgeobuf.html)
- FMEObjects Gateway
- [GDAL page](https://gdal.org/drivers/vector/fme.html)
- GeoConcept text export
- [GDAL page](https://gdal.org/drivers/vector/geoconcept.html)
- GeoJSON
- [GDAL page](https://gdal.org/drivers/vector/geojson.html)
- [Python bindings and utilities for GeoJSON](https://pypi.org/project/geojson/)
- [pythonを用いたshapefileやgeojsonの読込および描画](https://qiita.com/HidKamiya/items/5e7240f8f66c9af8b10e)
- GeoJSONSeq: sequence of GeoJSON features
- [GDAL page](https://gdal.org/drivers/vector/geojsonseq.html)
- Geomedia MDB database
- [GDAL page](https://gdal.org/drivers/vector/geomedia.html)
- GeoRSS : Geographically Encoded Objects for RSS feeds
- [GDAL page](https://gdal.org/drivers/vector/georss.html)
- GMLAS - Geography Markup Language (GML) driven by application schemas
- [GDAL page](https://gdal.org/drivers/vector/gmlas.html)
- GML - Geography Markup Language
- [GDAL page](https://gdal.org/drivers/vector/gml.html)
- GMT ASCII Vectors (.gmt)
- [GDAL page](https://gdal.org/drivers/vector/gmt.html)
- GPKG – GeoPackage vector
- [GDAL page](https://gdal.org/drivers/vector/gpkg.html)
shape file のGeopackage変換
```Shell=
% ogr2ogr -f GPKG filename.gpkg abc.shp
```
ディレクトリ内 複数shape file のGeopackage変換
```Shell=
% ogr2ogr -f GPKG filename.gpkg ./path/to/dir
```
PostGISデータベース のGeopackage変換
```Shell=
% ogr2ogr -f GPKG filename.gpkg PG:'dbname=mydatabase host=localhost'
```
QGIS python script での ogrドライバでのGeopackage利用
```python=
import os
from qgis.core import *
places_layer = "/home/project/data/data.gpkg|layername=places"
vlayer = QgsVectorLayer(places_layer, "layername", "ogr")
if vlayer.isValid():
features = vlayer.getFeatures()
for feature in features:
attrs = feature.attributes()
print(attrs)
```
- [OGC GeoPackage](https://www.geopackage.org/)
- [Getting Started With GeoPackage](http://www.geopackage.org/guidance/getting-started.html)
- [leaflet-geopackage — Load GeoPackage layers in Leaflet](https://github.com/ngageoint/geopackage-js/tree/master/leaflet)
sample code
```JavaScript=
// Load the Rivers GeoPackage and display the feature layer
L.geoPackageFeatureLayer([], {
geoPackageUrl: 'http://ngageoint.github.io/GeoPackage/examples/rivers.gpkg',
layerName: 'rivers'
}).addTo(map);
```
- [GeoPackage Plugin — GeoTools 23-SNAPSHOT User Guide](https://docs.geotools.org/latest/userguide/library/data/geopackage.html)
- [Learn spatial SQL and master GeoPackage with QGIS 3](https://medium.com/@GispoFinland/learn-spatial-sql-and-master-geopackage-with-qgis-3-16b1e17f0291)
- [GeoPackage Implementations](http://www.geopackage.org/implementations.html)
- GPSBabel
- [GDAL page](https://gdal.org/drivers/vector/gpsbabel.html)
- GPX - GPS Exchange Format
- [GDAL page](https://gdal.org/drivers/vector/gpx.html)
- GRASS Vector Format
- [GDAL page](https://gdal.org/drivers/vector/grass.html)
- GTM - GPS TrackMaker
- [GDAL page](https://gdal.org/drivers/vector/gtm.html)
- HTF - Hydrographic Transfer Format
- [GDAL page](https://gdal.org/drivers/vector/htf.html)
- IDB
- [GDAL page](https://gdal.org/drivers/vector/idb.html)
- Idrisi Vector (.VCT)
- [GDAL page](https://gdal.org/drivers/vector/idrisi.html)
- “INTERLIS 1” and “INTERLIS 2” drivers
- [GDAL page](https://gdal.org/drivers/vector/ili.html)
- INGRES
- [GDAL page](https://gdal.org/drivers/vector/ingres.html)
- JML: OpenJUMP JML format
- [GDAL page](https://gdal.org/drivers/vector/jml.html)
- KML - Keyhole Markup Language
- [GDAL page](https://gdal.org/drivers/vector/kml.html)
- LIBKML Driver (.kml .kmz)
- [GDAL page](https://gdal.org/drivers/vector/libkml.html)
- Access MDB databases
- [GDAL page](https://gdal.org/drivers/vector/mdb.html)
- Memory
- [GDAL page](https://gdal.org/drivers/vector/memory.html)
- MapInfo TAB and MIF/MID
- [GDAL page](https://gdal.org/drivers/vector/mitab.html)
- MongoDB
- [GDAL page](https://gdal.org/drivers/vector/mongodb.html)
- MongoDBv3
- [GDAL page](https://gdal.org/drivers/vector/mongodbv3.html)
- MSSQLSpatial - Microsoft SQL Server Spatial Database
- [GDAL page](https://gdal.org/drivers/vector/mssqlspatial.html)
- MVT: Mapbox Vector Tiles
- [GDAL page](https://gdal.org/drivers/vector/mvt.html)
- MySQL
- [GDAL page](https://gdal.org/drivers/vector/mysql.html)
- NAS - ALKIS
- [GDAL page](https://gdal.org/drivers/vector/nas.html)
- NetCDF: Network Common Data Form - Vector
- [GDAL page](https://gdal.org/drivers/vector/netcdf.html)
- NGW – NextGIS Web
- [GDAL page](https://gdal.org/drivers/vector/ngw.html)
- UK .NTF
- [GDAL page](https://gdal.org/drivers/vector/ntf.html)
- OGC API - Features
- [GDAL page](https://gdal.org/drivers/vector/oapif.html)
- Oracle Spatial
- [GDAL page](https://gdal.org/drivers/vector/oci.html)
- ODBC RDBMS
- [GDAL page](https://gdal.org/drivers/vector/odbc.html)
- ODS - Open Document Spreadsheet
- [GDAL page](https://gdal.org/drivers/vector/ods.html)
- OGDI Vectors
- [GDAL page](https://gdal.org/drivers/vector/ogdi.html)
- OpenAir - OpenAir Special Use Airspace Format
- [GDAL page](https://gdal.org/drivers/vector/openair.html)
- ESRI File Geodatabase (OpenFileGDB)
- [GDAL page](https://gdal.org/drivers/vector/openfilegdb.html)
- OSM - OpenStreetMap XML and PBF
- [GDAL page](https://gdal.org/drivers/vector/osm.html)
- PDF – Geospatial PDF
- [GDAL page](https://gdal.org/drivers/vector/pdf.html)
- PDS - Planetary Data Systems TABLE
- [GDAL page](https://gdal.org/drivers/vector/pds.html)
- PostgreSQL SQL Dump
- [GDAL page](https://gdal.org/drivers/vector/pgdump.html)
- ESRI Personal GeoDatabase
- [GDAL page](https://gdal.org/drivers/vector/pgeo.html)
- PostgreSQL / PostGIS
- [GDAL page](https://gdal.org/drivers/vector/pg.html)
- PLScenes (Planet Labs Scenes/Catalog API)
- [GDAL page](https://gdal.org/drivers/vector/plscenes.html)
- IHO S-57 (ENC)
- [GDAL page](https://gdal.org/drivers/vector/s57.html)
- ESRI ArcSDE
- [GDAL page](https://gdal.org/drivers/vector/sde.html)
- SDTS
- [GDAL page](https://gdal.org/drivers/vector/sdts.html)
- SEG-P1 / UKOOA P1/90
- [GDAL page](https://gdal.org/drivers/vector/segukooa.html)
- SEG-Y / SEGY
- [GDAL page](https://gdal.org/drivers/vector/segy.html)
- Selafin files
- [GDAL page](https://gdal.org/drivers/vector/selafin.html)
- ESRI Shapefile / DBF
- [GDAL page](https://gdal.org/drivers/vector/shapefile.html)
- sample code GeoTools
```java=
/*
* Write the features to the shapefile
*/
Transaction transaction = new DefaultTransaction("create");
String typeName = newDataStore.getTypeNames()[0];
SimpleFeatureSource featureSource = newDataStore.getFeatureSource(typeName);
SimpleFeatureType SHAPE_TYPE = featureSource.getSchema();
/*
* The Shapefile format has a couple limitations:
* - "the_geom" is always first, and used for the geometry attribute name
* - "the_geom" must be of type Point, MultiPoint, MuiltiLineString, MultiPolygon
* - Attribute names are limited in length
* - Not all data types are supported (example Timestamp represented as Date)
*
* Each data store has different limitations so check the resulting SimpleFeatureType.
*/
System.out.println("SHAPE:" + SHAPE_TYPE);
if (featureSource instanceof SimpleFeatureStore) {
SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource;
/*
* SimpleFeatureStore has a method to add features from a
* SimpleFeatureCollection object, so we use the ListFeatureCollection
* class to wrap our list of features.
*/
SimpleFeatureCollection collection = new ListFeatureCollection(TYPE, features);
featureStore.setTransaction(transaction);
try {
featureStore.addFeatures(collection);
transaction.commit();
} catch (Exception problem) {
problem.printStackTrace();
transaction.rollback();
} finally {
transaction.close();
}
System.exit(0); // success!
} else {
System.out.println(typeName + " does not support read/write access");
System.exit(1);
}
}
```
- sample code ogr with python
```python=
from osgeo import ogr
import os
DriverName = "ESRI Shapefile" # e.g.: GeoJSON, ESRI Shapefile
FileName = 'test.shp'
driver = ogr.GetDriverByName(DriverName)
if os.path.exists(FileName):
driver.DeleteDataSource(FileName)
```
- [pythonを用いたshapefileやgeojsonの読込および描画](https://qiita.com/HidKamiya/items/5e7240f8f66c9af8b10e)
- Norwegian SOSI Standard
- [GDAL page](https://gdal.org/drivers/vector/sosi.html)
- SQLite / Spatialite RDBMS
- [GDAL page](https://gdal.org/drivers/vector/sqlite.html)
- sample code QGIS3.API using ogr driver with python
```python=
vlayer = QgsVectorLayer("stat.db|layername=work", "stat1", "ogr")
if vlayer.isValid():
vlayer.setProviderEncoding('utf-8')
features = vlayer.getFeatures()
for feature in features:
attrs = feature.attributes()
print(attrs)
```
- SUA - Tim Newport-Peace’s Special Use Airspace Format
- [GDAL page](https://gdal.org/drivers/vector/sua.html)
- SVG - Scalable Vector Graphics
- [GDAL page](https://gdal.org/drivers/vector/svg.html)
- Storage and eXchange Format - SXF
- [GDAL page](https://gdal.org/drivers/vector/sxf.html)
- U.S. Census TIGER/Line
- [GDAL page](https://gdal.org/drivers/vector/tiger.html)
- TopoJSON driver
- [GDAL page](https://gdal.org/drivers/vector/topojson.html)
- VDV - VDV-451/VDV-452/INTREST Data Format
- [GDAL page](https://gdal.org/drivers/vector/vdv.html)
- VFK - Czech Cadastral Exchange Data Format
- [GDAL page](https://gdal.org/drivers/vector/vfk.html)
- VRT – Virtual Format
- [GDAL page](https://gdal.org/drivers/vector/vrt.html)
- Walk - Walk Spatial Data
- [GDAL page](https://gdal.org/drivers/vector/walk.html)
- WAsP - WAsP .map format
- [GDAL page](https://gdal.org/drivers/vector/wasp.html)
- WFS - OGC WFS service
- [GDAL page](https://gdal.org/drivers/vector/wfs.html)
- XLS - MS Excel format
- [GDAL page](https://gdal.org/drivers/vector/xls.html)
- XLSX - MS Office Open XML spreadsheet
- [GDAL page](https://gdal.org/drivers/vector/xlsx.html)
- X-Plane/Flightgear aeronautical data
- [GDAL page](https://gdal.org/drivers/vector/xplane.html)
## Raster data
- Arc/Info ASCII Grid
- short name AAIGrid
- [GDAL page](https://gdal.org/drivers/raster/aaigrid.html)
- ACE2
- short name ACE2
- [GDAL page](https://gdal.org/drivers/raster/ace2.html)
- ADRG/ARC Digitized Raster Graphics (.gen/.thf)
- short name ADRG
- [GDAL page](https://gdal.org/drivers/raster/adrg.html)
- Arc/Info Binary Grid
- short name AIG
- [GDAL page](https://gdal.org/drivers/raster/aig.html)
- AIRSAR Polarimetric Format
- short name AIRSAR
- [GDAL page](https://gdal.org/drivers/raster/airsar.html)
- Azavea Raster Grid
- short name ARG
- [GDAL page](https://gdal.org/drivers/raster/arg.html)
- Bathymetry Attributed Grid
- short name BAG
- [GDAL page](https://gdal.org/drivers/raster/bag.html)
- Magellan BLX Topo File Format
- short name BLX
- [GDAL page](https://gdal.org/drivers/raster/blx.html)
- Microsoft Windows Device Independent Bitmap
- short name BMP
- [GDAL page](https://gdal.org/drivers/raster/bmp.html)
- Better Portable Graphics
- short name BPG
- [GDAL page](https://gdal.org/drivers/raster/bpg.html)
- Maptech/NOAA BSB Nautical Chart Format
- short name BSB
- [GDAL page](https://gdal.org/drivers/raster/bsb.html)
- VTP .bt Binary Terrain Format
- short name BT
- [GDAL page](https://gdal.org/drivers/raster/bt.html)
- BYN - Natural Resources Canada’s Geoid file format (.byn)
- short name BYN
- [GDAL page](https://gdal.org/drivers/raster/byn.html)
- AutoCAD DWG raster layer
- short name CAD
- [GDAL page](https://gdal.org/drivers/raster/cad.html)
- CALS Type 1
- short name CALS
- [GDAL page](https://gdal.org/drivers/raster/cals.html)
- CEOS Image
- short name CEOS
- [GDAL page](https://gdal.org/drivers/raster/ceos.html)
- DRDC COASP SAR Processor Raster
- short name COASP
- [GDAL page](https://gdal.org/drivers/raster/coasp.html)
- Cloud Optimized GeoTIFF generator
- short name COG
- [GDAL page](https://gdal.org/drivers/raster/cog.html)
- TerraSAR-X Complex SAR Data Product
- short name COSAR
- [GDAL page](https://gdal.org/drivers/raster/cosar.html)
- Convair PolGASP data
- short name CPG
- [GDAL page](https://gdal.org/drivers/raster/cpg.html)
- CTable2 Datum Grid Shift
- short name CTable2
- [GDAL page](https://gdal.org/drivers/raster/ctable2.html)
- USGS LULC Composite Theme Grid
- short name CTG
- [GDAL page](https://gdal.org/drivers/raster/ctg.html)
- DAAS (Airbus DS Intelligence Data As A Service driver)
- short name DAAS
- [GDAL page](https://gdal.org/drivers/raster/daas.html)
- DB2 raster
- short name DB2 raster
- [GDAL page](https://gdal.org/drivers/raster/db2.html)
- DirectDraw Surface
- short name DDS
- [GDAL page](https://gdal.org/drivers/raster/dds.html)
- Derived subdatasets driver
- short name DERIVED
- [GDAL page](https://gdal.org/drivers/raster/derived.html)
- Spot DIMAP
- short name DIMAP
- [GDAL page](https://gdal.org/drivers/raster/dimap.html)
- ELAS DIPEx
- short name DIPEx
- [GDAL page](https://gdal.org/drivers/raster/dipex.html)
- OPeNDAP Grid Client
- short name DODS
- [GDAL page](https://gdal.org/drivers/raster/dods.html)
- First Generation USGS DOQ
- short name DOQ1
- [GDAL page](https://gdal.org/drivers/raster/doq1.html)
- New Labelled USGS DOQ
- short name DOQ2
- [GDAL page](https://gdal.org/drivers/raster/doq2.html)
- Military Elevation Data
- short name DTED
- [GDAL page](https://gdal.org/drivers/raster/dted.html)
- Arc/Info Export E00 GRID
- short name E00GRID
- [GDAL page](https://gdal.org/drivers/raster/e00grid.html)
- ECRG Table Of Contents (TOC.xml)
- short name ECRGTOC
- [GDAL page](https://gdal.org/drivers/raster/ecrgtoc.html)
- Enhanced Compressed Wavelets (.ecw)
- short name ECW
- [GDAL page](https://gdal.org/drivers/raster/ecw.html)
- Google Earth Engine Data API Image
- short name EEDAI
- [GDAL page](https://gdal.org/drivers/raster/eedai.html)
- ESRI .hdr Labelled
- short name EHdr
- [GDAL page](https://gdal.org/drivers/raster/ehdr.html)
- Erdas Imagine Raw
- short name EIR
- [GDAL page](https://gdal.org/drivers/raster/eir.html)
- Earth Resources Laboratory Applications Software
- short name ELAS
- [GDAL page](https://gdal.org/drivers/raster/elas.html)
- ENVI .hdr Labelled Raster
- short name ENVI
- [GDAL page](https://gdal.org/drivers/raster/envi.html)
- Wavelet compressed images
- short name Epsilon
- [GDAL page](https://gdal.org/drivers/raster/epsilon.html)
- Envisat Image Product
- short name ESAT
- [GDAL page](https://gdal.org/drivers/raster/esat.html)
- ERMapper .ERS
- short name ERS
- [GDAL page](https://gdal.org/drivers/raster/ers.html)
- EOSAT FAST Format
- short name FAST
- [GDAL page](https://gdal.org/drivers/raster/fast.html)
- FIT
- short name FIT
- [GDAL page](https://gdal.org/drivers/raster/fit.html)
- Flexible Image Transport System
- short name FITS
- [GDAL page](https://gdal.org/drivers/raster/fits.html)
- Fuji BAS Scanner Image
- short name FujiBAS
- [GDAL page](https://gdal.org/drivers/raster/fujibas.html)
- Generic Binary (.hdr labelled)
- short name GenBin
- [GDAL page](https://gdal.org/drivers/raster/genbin.html)
- Oracle Spatial GeoRaster
- short name GeoRaster
- [GDAL page](https://gdal.org/drivers/raster/georaster.html)
- Sandia National Laboratories GSAT File Format
- short name GFF
- [GDAL page](https://gdal.org/drivers/raster/gff.html)
- Graphics Interchange Format
- short name GIF
- [GDAL page](https://gdal.org/drivers/raster/gif.html)
- GMT Compatible netCDF
- short name GMT
- [GDAL page](https://gdal.org/drivers/raster/gmt.html)
- GeoPackage raster
- short name GPKG
- [GDAL page](https://gdal.org/drivers/raster/gpkg.html)
- GRASS Raster Format
- short name GRASS
- [GDAL page](https://gdal.org/drivers/raster/grass.html)
- GRASS ASCII Grid
- short name GRASSASCIIGrid
- [GDAL page](https://gdal.org/drivers/raster/grassasciigrid.html)
- WMO General Regularly-distributed Information in Binary form
- short name GRIB
- [GDAL page](https://gdal.org/drivers/raster/grib.html)
- Golden Software Surfer 7 Binary Grid File Format
- short name GS7BG
- [GDAL page](https://gdal.org/drivers/raster/gs7bg.html)
- Golden Software ASCII Grid File Format
- short name GSAG
- [GDAL page](https://gdal.org/drivers/raster/gsag.html)
- Golden Software Binary Grid File Format
- short name GSBG
- [GDAL page](https://gdal.org/drivers/raster/gsbg.html)
- GSC Geogrid
- short name GSC
- [GDAL page](https://gdal.org/drivers/raster/gsc.html)
- Generic Tagged Arrays
- short name GTA
- [GDAL page](https://gdal.org/drivers/raster/gta.html)
- GeoTIFF File Format
- short name GTiff
- [GDAL page](https://gdal.org/drivers/raster/gtiff.html)
- Grid eXchange File
- short name GXF
- [GDAL page](https://gdal.org/drivers/raster/gxf.html)
- Hierarchical Data Format Release 4 (HDF4)
- short name HDF4
- [GDAL page](https://gdal.org/drivers/raster/hdf4.html)
- Hierarchical Data Format Release 5 (HDF5)
- short name HDF5
- [GDAL page](https://gdal.org/drivers/raster/hdf5.html)
- HF2/HFZ heightfield raster
- short name HF2
- [GDAL page](https://gdal.org/drivers/raster/hf2.html)
- Erdas Imagine .img
- short name HFA
- [GDAL page](https://gdal.org/drivers/raster/hfa.html)
- Image Display and Analysis
- short name IDA
- [GDAL page](https://gdal.org/drivers/raster/ida.html)
- Idrisi Raster Format
- short name RST
- [GDAL page](https://gdal.org/drivers/raster/Idrisi.html)
- IGN-France height correction ASCII grids
- short name IGNFHeightASCIIGrid
- [GDAL page](https://gdal.org/drivers/raster/ignfheightasciigrid.html)
- Raster Map
- short name ILWIS
- [GDAL page](https://gdal.org/drivers/raster/ilwis.html)
- Intergraph Raster Format
- short name INGR
- [GDAL page](https://gdal.org/drivers/raster/intergraphraster.html)
- IRIS – Vaisala’s weather radar software format
- short name IRIS
- [GDAL page](https://gdal.org/drivers/raster/iris.html)
- ISCE
- short name ISCE
- [GDAL page](https://gdal.org/drivers/raster/isce.html)
- USGS Astrogeology ISIS Cube (Version 2)
- short name ISIS2
- [GDAL page](https://gdal.org/drivers/raster/isis2.html)
- USGS Astrogeology ISIS Cube (Version 3)
- short name ISIS3
- [GDAL page](https://gdal.org/drivers/raster/isis3.html)
- Japanese DEM (.mem)
- short name JDEM
- [GDAL page](https://gdal.org/drivers/raster/jdem.html)
- ERDAS JPEG2000 (.jp2)
- short name JP2ECW
- [GDAL page](https://gdal.org/drivers/raster/jp2ecw.html)
- JPEG-2000 (based on Kakadu)
- short name JP2KAK
- [GDAL page](https://gdal.org/drivers/raster/jp2kak.html)
- JPEG2000 driver based on Lurawave library
- short name JP2Lura
- [GDAL page](https://gdal.org/drivers/raster/jp2lura.html)
- JPEG2000 via MrSID SDK
- short name JP2MrSID
- [GDAL page](https://gdal.org/drivers/raster/jp2mrsid.html)
- JPEG2000 driver based on OpenJPEG library
- short name JP2OpenJPEG
- [GDAL page](https://gdal.org/drivers/raster/jp2openjpeg.html)
- Implementation of the JPEG-2000 part 1
- short name JPEG2000
- [GDAL page](https://gdal.org/drivers/raster/jpeg2000.html)
- JPEGLS
- short name JPEGLS
- [GDAL page](https://gdal.org/drivers/raster/jpegls.html)
- JPEG JFIF File Format
- short name JPEG
- [GDAL page](https://gdal.org/drivers/raster/jpeg.html)
- JPIP Streaming
- short name JPIPKAK
- [GDAL page](https://gdal.org/drivers/raster/jpipkak.html)
- KEA
- short name KEA
- [GDAL page](https://gdal.org/drivers/raster/kea.html)
- KMLSuperoverlay
- short name KMLSuperoverlay
- [GDAL page](https://gdal.org/drivers/raster/kmlsuperoverlay.html)
- KOLOR Raw format
- short name KRO
- [GDAL page](https://gdal.org/drivers/raster/kro.html)
- Erdas 7.x .LAN and .GIS
- short name LAN
- [GDAL page](https://gdal.org/drivers/raster/lan.html)
- NOAA Polar Orbiter Level 1b Data Set (AVHRR)
- short name L1B
- [GDAL page](https://gdal.org/drivers/raster/l1b.html)
- FARSITE v.4 LCP Format
- short name LCP
- [GDAL page](https://gdal.org/drivers/raster/lcp.html)
- Daylon Leveller Heightfield
- short name Leveller
- [GDAL page](https://gdal.org/drivers/raster/leveller.html)
- NADCON .los/.las Datum Grid Shift
- short name LOSLAS
- [GDAL page](https://gdal.org/drivers/raster/loslas.html)
- OziExplorer .MAP
- short name MAP
- [GDAL page](https://gdal.org/drivers/raster/map.html)
- Meta Raster Format
- short name MRF
- [GDAL page](https://gdal.org/drivers/raster/marfa.html)
- MBTiles
- short name MBTiles
- [GDAL page](https://gdal.org/drivers/raster/mbtiles.html)
- In Memory Raster
- short name MEM
- [GDAL page](https://gdal.org/drivers/raster/mem.html)
- Vexcel MFF Raster
- short name MFF
- [GDAL page](https://gdal.org/drivers/raster/mff.html)
- Vexcel MFF2 Image
- short name MFF2
- [GDAL page](https://gdal.org/drivers/raster/mff2.html)
- MG4Lidar – MrSID/MG4 LiDAR Compression / Point Cloud View files
- short name MG4Lidar
- [GDAL page](https://gdal.org/drivers/raster/mg4lidar.html)
- Multi-resolution Seamless Image Database
- short name MrSID
- [GDAL page](https://gdal.org/drivers/raster/mrsid.html)
- Meteosat Second Generation
- short name MSG
- [GDAL page](https://gdal.org/drivers/raster/msg.html)
- Meteosat Second Generation (MSG) Native Archive Format (.nat)
- short name MSGN
- [GDAL page](https://gdal.org/drivers/raster/msgn.html)
- NLAPS Data Format
- short name NDF
- [GDAL page](https://gdal.org/drivers/raster/ndf.html)
- NetCDF: Network Common Data Form
- short name netCDF
- [GDAL page](https://gdal.org/drivers/raster/netcdf.html)
- NGSGEOID - NOAA NGS Geoid Height Grids
- short name NGSGEOID
- [GDAL page](https://gdal.org/drivers/raster/ngsgeoid.html)
- NextGIS Web
- short name NGW
- [GDAL page](https://gdal.org/drivers/raster/ngw.html)
- National Imagery Transmission Format
- short name NITF
- [GDAL page](https://gdal.org/drivers/raster/nitf.html)
- NTv1 Datum Grid Shift
- short name NTv1
- [GDAL page](https://gdal.org/drivers/raster/ntv1.html)
- NTv2 Datum Grid Shift
- short name NTv2
- [GDAL page](https://gdal.org/drivers/raster/ntv2.html)
- Northwood/Vertical Mapper File Format
- short name NWT_GRD/NWT_GRC
- [GDAL page](https://gdal.org/drivers/raster/nwtgrd.html)
- OZF2/OZFX3 raster
- short name OZI
- [GDAL page](https://gdal.org/drivers/raster/ozi.html)
- JAXA PALSAR Processed Products
- short name JAXAPALSAR
- [GDAL page](https://gdal.org/drivers/raster/palsar.html)
- PAux – PCI .aux Labelled Raw Format
- short name PAux
- [GDAL page](https://gdal.org/drivers/raster/paux.html)
- PCIDSK – PCI Geomatics Database File
- short name PCIDSK
- [GDAL page](https://gdal.org/drivers/raster/pcidsk.html)
- PCRaster – PCRaster raster file format
- short name PCRaster
- [GDAL page](https://gdal.org/drivers/raster/pcraster.html)
- Geospatial PDF
- short name PDF
- [GDAL page](https://gdal.org/drivers/raster/pdf.html)
- Planetary Data System v3
- short name PDS
- [GDAL page](https://gdal.org/drivers/raster/pds.html)
- NASA Planetary Data System (Version 4)
- short name PDS4
- [GDAL page](https://gdal.org/drivers/raster/pds4.html)
- PLMosaic (Planet Labs Mosaics API)
- short name PLMosaic
- [GDAL page](https://gdal.org/drivers/raster/plmosaic.html)
- Portable Network Graphics
- short name PNG
- [GDAL page](https://gdal.org/drivers/raster/png.html)
- Netpbm (.pgm, .ppm)
- short name PNM
- [GDAL page](https://gdal.org/drivers/raster/pnm.html)
- PostGIS Raster driver
- short name PostGISRaster
- [GDAL page](https://gdal.org/drivers/raster/postgisraster.html)
- PHOTOMOD Raster File
- short name PRF
- [GDAL page](https://gdal.org/drivers/raster/prf.html)
- Rasdaman GDAL driver
- Rasdaman
- [GDAL page](https://gdal.org/drivers/raster/rasdaman.html)
- Rasters in SQLite DB
- short name Rasterlite
- [GDAL page](https://gdal.org/drivers/raster/rasterlite.html)
- Rasters in SQLite DB
- short name RasterLite2
- [GDAL page](https://gdal.org/drivers/raster/rasterlite2.html)
- R Object Data Store
- short name R
- [GDAL page](https://gdal.org/drivers/raster/r.html)
- RDA (DigitalGlobe Raster Data Access)
- short name RDA
- [GDAL page](https://gdal.org/drivers/raster/rda.html)
- RDB - <em>RIEGL</em> Database
- short name RDB
- [GDAL page](https://gdal.org/drivers/raster/rdb.html)
- Swedish Grid Maps
- short name RIK
- [GDAL page](https://gdal.org/drivers/raster/rik.html)
- Raster Matrix Format
- short name RMF
- [GDAL page](https://gdal.org/drivers/raster/rmf.html)
- ROI_PAC
- short name ROI_PAC
- [GDAL page](https://gdal.org/drivers/raster/roi_pac.html)
- Raster Product Format/RPF (a.toc)
- short name RPFTOC
- [GDAL page](https://gdal.org/drivers/raster/rpftoc.html)
- R Raster
- short name RRASTER
- [GDAL page](https://gdal.org/drivers/raster/rraster.html)
- RadarSat 2 XML Product
- short name RS2
- [GDAL page](https://gdal.org/drivers/raster/rs2.html)
- Sentinel-1 SAFE XML Product
- short name SAFE
- [GDAL page](https://gdal.org/drivers/raster/safe.html)
- CEOS SAR Image
- short name SAR_CEOS
- [GDAL page](https://gdal.org/drivers/raster/sar_ceos.html)
- SAGA GIS Binary Grid File Format
- short name SAGA
- [GDAL page](https://gdal.org/drivers/raster/sdat.html)
- USGS SDTS DEM
- short name SDTS
- [GDAL page](https://gdal.org/drivers/raster/sdts.html)
- ESRI ArcSDE Raster
- short name SDE
- [GDAL page](https://gdal.org/drivers/raster/sde.html)
- Sentinel-2 Products
- short name SENTINEL2
- [GDAL page](https://gdal.org/drivers/raster/sentinel2.html)
- SGI Image Format
- short name SGI
- [GDAL page](https://gdal.org/drivers/raster/sgi.html)
- Scaled Integer Gridded DEM
- short name SIGDEM
- [GDAL page](https://gdal.org/drivers/raster/sigdem.html)
- Snow Data Assimilation System
- short name SNODAS
- [GDAL page](https://gdal.org/drivers/raster/snodas.html)
- Standard Product Format (ASRP/USRP) (.gen)
- short name SRP
- [GDAL page](https://gdal.org/drivers/raster/srp.html)
- SRTM HGT Format
- short name SRTMHGT
- [GDAL page](https://gdal.org/drivers/raster/srtmhgt.html)
- Terragen – Terragen™ Terrain File
- short name Terragen
- [GDAL page](https://gdal.org/drivers/raster/terragen.html)
- EarthWatch/DigitalGlobe .TIL
- short name TIL
- [GDAL page](https://gdal.org/drivers/raster/til.html)
- TileDB
- short name TileDB
- [GDAL page](https://gdal.org/drivers/raster/tiledb.html)
- TSX – TerraSAR-X Product
- short name TSX
- [GDAL page](https://gdal.org/drivers/raster/tsx.html)
- USGS ASCII DEM (and CDED)
- short name USGSDEM
- [GDAL page](https://gdal.org/drivers/raster/usgsdem.html)
- VICAR
- short name VICAR
- [GDAL page](https://gdal.org/drivers/raster/vicar.html)
- GDAL Virtual Format
- short name VRT
- [GDAL page](https://gdal.org/drivers/raster/vrt.html)
- OGC Web Coverage Service
- short name WCS
- [GDAL page](https://gdal.org/drivers/raster/wcs.html)
- WEBP
- short name WEBP
- [GDAL page](https://gdal.org/drivers/raster/webp.html)
- Web Map Services
- short name WMS
- [GDAL page](https://gdal.org/drivers/raster/wms.html)
- OGC Web Map Tile Service
- short name WMTS
- [GDAL page](https://gdal.org/drivers/raster/wmts.html)
- X11 Pixmap
- short name XPM
- [GDAL page](https://gdal.org/drivers/raster/xpm.html)
- ASCII Gridded XYZ
- short name XYZ
- [GDAL page](https://gdal.org/drivers/raster/xyz.html)
- ZMap Plus Grid
- short name ZMap
- [GDAL page](https://gdal.org/drivers/raster/zmap.html)