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


