redblackcoder commented on code in PR #240: URL: https://github.com/apache/parquet-format/pull/240#discussion_r1911583551
########## Geospatial.md: ########## @@ -0,0 +1,171 @@ +<!-- + - Licensed to the Apache Software Foundation (ASF) under one + - or more contributor license agreements. See the NOTICE file + - distributed with this work for additional information + - regarding copyright ownership. The ASF licenses this file + - to you under the Apache License, Version 2.0 (the + - "License"); you may not use this file except in compliance + - with the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, + - software distributed under the License is distributed on an + - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + - KIND, either express or implied. See the License for the + - specific language governing permissions and limitations + - under the License. + --> + +Geospatial Definitions +==== + +This document contains the specification of geospatial types and statistics. + +# Background + +The Geometry and Geography class hierarchy and its Well-Known Text (WKT) and +Well-Known Binary (WKB) serializations (ISO supporting XY, XYZ, XYM, XYZM) are +defined by [OpenGIS Implementation Specification for Geographic information – +Simple feature access – Part 1: Common architecture][sfa-part1], from [OGC +(Open Geospatial Consortium)][ogc]. + +The version of the OGC standard first used here is 1.2.1, but future versions +may also used if the WKB representation remains wire-compatible. + +[sfa-part1]: https://portal.ogc.org/files/?artifact_id=25355 +[ogc]: https://www.ogc.org/standard/sfa/ + +## Well-Known Binary + +Well-Known Binary (WKB) representations of geometries. + +Apache Parquet follows the same definitions of GeoParquet for [WKB][geoparquet-wkb] +and [coordinate axis order][coordinate-axis-order]: +- Geometries should be encoded as ISO WKB supporting XY, XYZ, XYM, XYZM. Supported +standard geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, +MultiPolygon, and GeometryCollection. +- Coordinate axis order is always (x, y) where x is easting or longitude, and +y is northing or latitude. This ordering explicitly overrides the axis order +as specified in the CRS following the [GeoPackage specification][geopackage-spec]. + +[geoparquet-wkb]: https://github.com/opengeospatial/geoparquet/blob/v1.1.0/format-specs/geoparquet.md?plain=1#L92 +[coordinate-axis-order]: https://github.com/opengeospatial/geoparquet/blob/v1.1.0/format-specs/geoparquet.md?plain=1#L155 +[geopackage-spec]: https://www.geopackage.org/spec130/#gpb_spec + +## Coordinate Reference System + +Coordinate Reference System (CRS) is a mapping of how coordinates refer to +locations on Earth. + +Apache Parquet supports CRS Customization by providing following attributes: +* `crs`: a CRS text representation. If unset, the CRS defaults to "OGC:CRS84". +* `crs_encoding`: a standard encoding used to represent the CRS text. If unset, + `crs` can be arbitrary string. + +For maximum interoperability of a custom CRS, it is recommended to provide +the CRS text with a standard encoding. Supported CRS encodings are: +* `SRID`: [Spatial reference identifier][srid], CRS text is the identifier itself. +* `PROJJSON`: [PROJJSON][projjson], CRS text is the projjson string. + +For example, if a Geometry or Geography column uses the CRS "OGC:CRS84", a writer +may write a PROJJSON representation of [OGC:CRS84][ogc-crs84] to the `crs` field +and set the `crs_encoding` field to `PROJJSON`. + +[srid]: https://en.wikipedia.org/wiki/Spatial_reference_system#Identifier +[projjson]: https://proj.org/en/stable/specifications/projjson.html +[ogc-crs84]: https://github.com/opengeospatial/geoparquet/blob/main/format-specs/geoparquet.md#ogccrs84-details + +## Edge Interpolation Algorithm + +The edge interpolation algorithm is used for interpreting edges of elements of +a Geography column. It is applies to all non-point geometry objects and is +independent of the [Coordinate Reference System](#coordinate-reference-system). + +Supported values are: +* `spherical`: edges are interpolated as geodesics on a sphere. The radius of the underlying sphere is the mean radius of the spheroid defined by the CRS, defined as (2 * major_axis_length + minor_axis_length / 3). +* `vincenty`: [https://en.wikipedia.org/wiki/Vincenty%27s_formulae](https://en.wikipedia.org/wiki/Vincenty%27s_formulae) +* `thomas`: Thomas, Paul D. Spheroidal geodesics, reference systems, & local geometry. US Naval Oceanographic Office, 1970. +* `andoyer`: Thomas, Paul D. Mathematical models for navigation systems. US Naval Oceanographic Office, 1965. +* `karney`: [Karney, Charles FF. "Algorithms for geodesics." Journal of Geodesy 87 (2013): 43-55](https://link.springer.com/content/pdf/10.1007/s00190-012-0578-z.pdf), and [GeographicLib](https://geographiclib.sourceforge.io/) + +# Logical Types + +Apache Parquet supports the following geospatial logical type annotations: +* `GEOMETRY`: Geometry features in the WKB format with linear/planar edges interpolation. See [Geometry logical type](LogicalTypes.md#geometry) +* `GEOGRAPHY`: Geometry features in the WKB format with non-linear/non-planar edges interpolation. See [Geography logical type](LogicalTypes.md#geography) Review Comment: Typo: ```suggestion * `GEOGRAPHY`: Geography features in the WKB format with non-linear/non-planar edges interpolation. See [Geography logical type](LogicalTypes.md#geography) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
