1-
21Data type Geometry (module for Omeka S)
32=======================================
43
@@ -7,14 +6,15 @@ Data type Geometry (module for Omeka S)
76> than the previous repository.__
87
98[ Data type Geometry] is a module for [ Omeka S] that adds five new data types for
10- the properties: ` geography ` , ` geometry ` , ` geography:coordinates ` , ` geometry:coordinates ` ,
11- ` geometry:position ` . It allows to manage points and areas on images and maps.
9+ the values of properties: ` geography ` , ` geometry ` , ` geography:coordinates ` ,
10+ ` geometry:coordinates ` , ` geometry:position ` . It allows to manage points and
11+ areas on images and maps.
12+
13+ The data types are managed with the standard [ WKT] format.
1214
1315The datatype for geographic coordinates uses the standard latitude/longitude,
1416that is called nowadays "GPS" or even "Google coordinates".
1517
16- The data types are managed with the standard [ WKT] format.
17-
1818The geometric position and geometric coordinates are similar, but the first uses
1919the top left corner as base and allows only integer values, so it is adapted to
2020describe images by pixel, and the second use the arithmetic plane with the
@@ -74,21 +74,29 @@ browse quicker too.
7474By default, related to minimal database versions, Omeka support spatial search,
7575but not spatial indexing.
7676
77+ #### Before Omeka S v4.1
78+
7779To support searches of geometries, (distance around a point, geometries
7880contained inside another geometry), the version of the database should be
7981minimum [ mySql 5.6.1] (2011-02) or [ mariaDB 5.3.3] (2011-12-21). Note that the
8082minimum Omeka version until version 4.0 are [ mySql 5.6.4] (2011-11-20), and
81- [ MariaDB 10.0.5] (2013-11-07)). For Omeka S v4.1, the new minimum versions are
82- [ mySql 5.7.9] , and [ MariaDB 10.2.6] and is now fine to support spatial indexing.
83+ [ MariaDB 10.0.5] (2013-11-07)).
84+
85+ So you need to check if the database supports spatial indexing. The database
86+ must be equal or greater than [ MariaDB 10.2.2] (2016-09-27) or [ mySql 5.7.5]
87+ (2014-09-25), for the engine InnoDB. Prior database releases can support spatial
88+ index too, but only with the engine MyIsam (that does not support referential
89+ integrity and is not used by Omeka). The choice between InnoDB and MyIsam is
90+ done automatically.
91+
92+ #### Since Omeka S v4.1
93+
94+ For Omeka S v4.1, the new minimum versions are [ mySql 5.7.9] , and [ MariaDB 10.2.6] ,
95+ so Omeka is now fine to support spatial indexing.
8396
8497For a precise support of geometry, see the [ spatial support matrix] .
8598
86- So if your install is lower than Omeka S v4.1, check if the database supports
87- spatial indexing. It must be equal or greater than [ MariaDB 10.2.2] (2016-09-27)
88- or [ mySql 5.7.5] (2014-09-25), for the engine InnoDB. Prior database releases
89- can support spatial index too, but only with the engine MyIsam (that does not
90- support referential integrity and is not used by Omeka). The choice between
91- InnoDB and MyIsam is done automatically.
99+ #### External database
92100
93101You may prefer to use an external database. To config it, set the parameters in
94102the file ` config/database-cartography.ini ` , beside your main ` config/database.ini ` .
@@ -98,7 +106,8 @@ Furthermore, if PostgreSql is used, the `config/local.config.php` should
98106indicate it in ` [entity_manager][functions][numeric] ` , by overriding keys of the
99107mysql functions.
100108
101- The support for MariaDB, mySql and PostgreSql is provided though [ doctrine2-spatial] .
109+ The support for MariaDB, mySql and PostgreSql is provided though [ longitude-one/doctrine-spatial] ,
110+ an active fork of [ creof/doctrine2-spatial] .
102111
103112
104113Usage
@@ -140,8 +149,8 @@ kilometers.
140149
141150Most of the time, the srid is [ ` 4326 ` ] , because it’s the Mercator projection
142151used by default in many expert geographic systems, included GPS. It is not the
143- one used by OpenStreetMap and derivative web maps, that uses [ ` 3857 ` ] . The
144- module [ Annotate Cartography] uses 4326 too.
152+ one used by OpenStreetMap and derivative web maps, that uses the code [ ` 3857 ` ] .
153+ The module [ Annotate Cartography] uses ` 4326 ` too.
145154
146155Another value can be set in the main settings, and each value can set a specific
147156one with the ewkt format: ` SRID=4326; POINT (2.294497 48.858252) ` . It is not
@@ -158,8 +167,10 @@ A geographic point is the latitude and longitude coordinates: `48.858252,2.29449
158167In the user interface, this value is composed with two decimal values (` xsd:decimal ` ),
159168separated by a ` , ` . In the database, it is stored the same and as a geographic
160169WKT point. In the api, the value is a string compliant with [ geo: kmlLiteral ] .
161- Note: to avoid issues with json implementations of clients, check the cast to
162- float when extracting it, in particular to be compatible with [ w3c geolocation api] .
170+
171+ Furthermore, the geolocation position is appended to be compatible with the
172+ [ w3c geolocation api] . It avoids issues with json implementations of clients
173+ when casting to float when extracting it.
163174
164175*** Important*** : Unlike the data type Geography, the order of values is latitude
165176then longitude. WKT uses ` Point(x y) ` , so the representation of a geographic
@@ -178,15 +189,15 @@ WKT point. In the api, the value is a simple string.
178189
179190### Geometric position
180191
181- A geometric position is a ` x,y ` pair: ` 2,48 ` .
192+ A geometric position is a ` x,y ` pair with two positive integers values: ` 2,48 ` ,
193+ representing a point from the top left corner and usually describes the position
194+ of a pixel in a image.
182195
183- In the user interface, this value is composed with two positive integer values,
184- separated by a ` , ` . In the database, it is stored the same and as a geometric
185- WKT point.
196+ In the api, the value is a simple string. In the database, it is stored the same
197+ in the table ` value ` but as a geometric WKT point in the specific table ` data_type_geometry ` .
186198
187- ** Warning** : This point is based on bottom left corner, so the y is negated.
188-
189- In the api, the value is a simple string.
199+ ** Warning** : In database, the point is based on bottom left corner, according to
200+ the standard x/y axis, so the y is negated.
190201
191202### JSON-LD and GeoJSON
192203
@@ -196,9 +207,12 @@ GeoJson cannot be used in all cases inside a JSON-LD.
196207So the representation uses Omeka types and appends the data type ` http://www.opengis.net/ont/geosparql#wktLiteral `
197208of the [ OGC standard] . The deprecated datatype ` http://geovocab.org/geometry#asWKT `
198209is no more used. For geometric coordinates and position, no "@type " is appended.
199- It appends the data type ` http://www.opengis.net/ont/geosparql#kmlLiteral too `
210+ It appends the data type ` http://www.opengis.net/ont/geosparql#kmlLiteral ` too
200211for coordinates.
201212
213+ Furthemore, for compatibility with [ w3c geolocation api] , the position is
214+ appended for geography coordinates.
215+
202216``` json
203217{
204218 "dcterms:spatial" : [
@@ -210,7 +224,13 @@ for coordinates.
210224 {
211225 "type" : " geography:coordinates" ,
212226 "@value" : " 48.858252,2.294497" ,
213- "@type" : " http://www.opengis.net/ont/geosparql#kmlLiteral"
227+ "@type" : " http://www.opengis.net/ont/geosparql#kmlLiteral" ,
228+ "position" : {
229+ "coords" : {
230+ "latitude" : 48.858252 ,
231+ "longitude" : 2.294497
232+ },
233+ },
214234 }
215235 ],
216236 "curation:data" : [
@@ -265,6 +285,8 @@ See online issues on the [module issues] page on GitLab.
265285License
266286-------
267287
288+ ### Module
289+
268290This module is published under the [ CeCILL v2.1] license, compatible with
269291[ GNU/GPL] and approved by [ FSF] and [ OSI] .
270292
@@ -301,7 +323,7 @@ Copyright
301323---------
302324
303325* See ` asset/vendor/ ` and ` vendor/ ` for the copyright of the libraries.
304- * Some portions are adapted from the modules [ Numeric data types] and [ Neatline] .
326+ * Some portions were initially adapted from the modules [ Numeric data types] and [ Neatline] .
305327* Copyright Daniel Berthereau, 2018-2024, (see [ Daniel-KM] on GitLab)
306328
307329This module was built first for the French École des hautes études en sciences
@@ -314,7 +336,7 @@ sociales [EHESS]. The improvements were developed for the digital library of the
314336[ WKT ] : https://wikipedia.org/wiki/Well-known_text
315337[ Annotate Cartography ] : https://gitlab.com/Daniel-KM/Omeka-S-module-Cartography
316338[ Mapping ] : https://github.com/Omeka-S-modules/Mapping
317- [ Installing a module] : https://omeka.org/s/docs/user-manual/modules/#installing-modules
339+ [ installing a module] : https://omeka.org/s/docs/user-manual/modules/#installing-modules
318340[ mySql 5.6.1 ] : https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-1.html
319341[ MariaDB 5.3.3 ] : https://mariadb.com/kb/en/library/mariadb-533-release-notes/
320342[ mySql 5.6.4 ] : https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-4.html
@@ -328,15 +350,16 @@ sociales [EHESS]. The improvements were developed for the digital library of the
328350[ `data_type_geography` ] : https://gitlab.com/Daniel-KM/Omeka-S-module-DataTypeGeometry/-/blob/master/data/install/schema.sql#L11-20
329351[ DataTypeGeometry.zip ] : https://gitlab.com/Daniel-KM/Omeka-S-module-DataTypeGeometry/-/releases
330352[ Common ] : https://gitlab.com/Daniel-KM/Omeka-S-module-Common
331- [ doctrine2-spatial ] : https://github.com/creof/doctrine2-spatial/blob/HEAD/doc/index.md
353+ [ longitude-one/doctrine-spatial ] : https://github.com/longitude-one/doctrine-spatial
354+ [ creof/doctrine2-spatial ] : https://github.com/creof/doctrine2-spatial/blob/HEAD/doc/index.md
332355[ search a point in a polygon for a sphere ] : https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html
333356[ supports only flat geometric queries ] : https://mariadb.com/kb/en/st_srid
334357[ `4326` ] : https://epsg.io/4326
335358[ `3857` ] : https://epsg.io/3857
336359[ discussion ] : https://github.com/json-ld/json-ld.org/issues/397
337360[ geo:kmlLiteral ] : http://www.opengis.net/ont/geosparql#kmlLiteral
338361[ OGC standard ] : https://www.ogc.org/standards/geosparql
339- [ w3c geolocation api ] : https://www.w3.org/TR/geolocation/#dom-geolocationcoordinates
362+ [ w3c geolocation api ] : https://www.w3.org/TR/geolocation/#position_interface
340363[ module issues ] : https://gitlab.com/Daniel-KM/Omeka-S-module-DataTypeGeometry/-/issues
341364[ CeCILL v2.1 ] : https://www.cecill.info/licences/Licence_CeCILL_V2.1-en.html
342365[ GNU/GPL ] : https://www.gnu.org/licenses/gpl-3.0.html
0 commit comments