Wiki source code of Spatial Module

Last modified by Vincent Massol on 2026/08/05 16:03

Hide last authors
Jerome 1.1 1 {{include document="XWiki.DesignClassSheet"/}}
Jerome 2.1 2
Jerome 3.2 3 **Summary**
Jerome 2.1 4 The spatial module objective is to bring storage, indexing and querying facilities for geometry objects in XWiki.
5
6 == Use cases ==
Jerome 2.2 7
8 * UC1: It should be possible to create XWiki applications that declare geometric objects fields in its XClass(es). Such geometric objects could be : coordinates (or point, or LatLon), shapes, polygons.
Sergiu Dumitriu 3.3 9 * UC2: It should be possible to perform geometric operations and queries on those fields, such as computing distance, querying intersection, etc.
Jerome 2.2 10
11 == Implementation ideas ==
12
Jerome 5.1 13 === XClass/geo data mapping strategy ===
Jerome 2.2 14
Jerome 5.1 15 * Strategy A: One geometry field common for all objects. Property instances with values such as ##POINT(10 70)##, ##POLYGON((-10 30, -40 40, -10 -20, 40 20, 0 0, -10 30))##, etc.
Ecaterina Moraru (Valica) 11.1 16 ** Pros:
Jerome 5.1 17 *** Generic, supports all objects upstart
Ecaterina Moraru (Valica) 11.1 18 ** Cons:
Jerome 5.1 19 *** Not easy/possible to have a generic displayer/picker.
20 *** Object type restrictions have to be implemented at the application level.
21 *** {{info}}Idea: maybe have a field configuration select list (multivalued) that allows to restrict which objects are allowed (same as NumberClass with "integer", "long", etc.).{{/info}}
22 * Strategy B: One geometry field per object : point, polygon, circle, etc.
Ecaterina Moraru (Valica) 11.1 23 ** Pros:
Jerome 5.1 24 *** Isolated displayers/pickers
25 *** Easier for application developers to restrict to one type of object
Jerome 6.1 26 ** Cons:
27 *** Must declare all object types possible as meta classes
28 *** Probably too much different object types, will clutter the field type picker in the class editor
Jerome 5.1 29
30 === Underlying implementation ===
31
32 ==== Storage ====
33
Jerome 3.1 34 Hibernate spatial. See http://www.hibernatespatial.org/
Jerome 2.2 35
Jerome 3.1 36 Note: hibernate spatial is integrated in hibernate ORM starting in 4.x.
37
Jerome 5.1 38 ==== Search ====
Jerome 3.1 39
Jerome 4.1 40 The idea here is to use Solr Spatial Search module. See http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
Jerome 3.1 41
42 Related thread : http://xwiki.markmail.org/thread/gy6qtgtl2bfbosoa
43
44 == Current status ==
45
jvelo 7.1 46 Some work started at: https://github.com/xwiki-contrib/module-spatial and https://github.com/jvelo/xwiki-platform/tree/feature-spatial
Roman Muntyanu 7.2 47
48 == Q&A ==
Ecaterina Moraru (Valica) 11.1 49
Roman Muntyanu 7.2 50 **Q:** Does this relate anyhow to SVG and [[SVG Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/SVG+Macro]]?
51 **A:**

Get Connected