Wiki source code of Spatial Module
Last modified by Vincent Massol on 2026/08/05 16:03
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{include document="XWiki.DesignClassSheet"/}} | ||
| 2 | |||
| 3 | **Summary** | ||
| 4 | The spatial module objective is to bring storage, indexing and querying facilities for geometry objects in XWiki. | ||
| 5 | |||
| 6 | == Use cases == | ||
| 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. | ||
| 9 | * UC2: It should be possible to perform geometric operations and queries on those fields, such as computing distance, querying intersection, etc. | ||
| 10 | |||
| 11 | == Implementation ideas == | ||
| 12 | |||
| 13 | === XClass/geo data mapping strategy === | ||
| 14 | |||
| 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. | ||
| 16 | ** Pros: | ||
| 17 | *** Generic, supports all objects upstart | ||
| 18 | ** Cons: | ||
| 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. | ||
| 23 | ** Pros: | ||
| 24 | *** Isolated displayers/pickers | ||
| 25 | *** Easier for application developers to restrict to one type of object | ||
| 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 | ||
| 29 | |||
| 30 | === Underlying implementation === | ||
| 31 | |||
| 32 | ==== Storage ==== | ||
| 33 | |||
| 34 | Hibernate spatial. See http://www.hibernatespatial.org/ | ||
| 35 | |||
| 36 | Note: hibernate spatial is integrated in hibernate ORM starting in 4.x. | ||
| 37 | |||
| 38 | ==== Search ==== | ||
| 39 | |||
| 40 | The idea here is to use Solr Spatial Search module. See http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4 | ||
| 41 | |||
| 42 | Related thread : http://xwiki.markmail.org/thread/gy6qtgtl2bfbosoa | ||
| 43 | |||
| 44 | == Current status == | ||
| 45 | |||
| 46 | Some work started at: https://github.com/xwiki-contrib/module-spatial and https://github.com/jvelo/xwiki-platform/tree/feature-spatial | ||
| 47 | |||
| 48 | == Q&A == | ||
| 49 | |||
| 50 | **Q:** Does this relate anyhow to SVG and [[SVG Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/SVG+Macro]]? | ||
| 51 | **A:** |