- 1. What types of physical things with locations are there according to the sources
- 2. Which various possibilities can be observed regarding the identification of a physical object with a spatial position/extend
- 3. User Input
- 4. Backend and Background Witchcraft
- 5. GUI
1. What types of physical things with locations are there according to the sources¶
I. Physical things like buildings, settlements, regions, areas etc. that have or originally had a position in space and a certain extend
II. Roads/routes/rivers that have or originally had a position in space and a certain extend
III. (Find-)Spots with no spatial extend that only have point coordinates.
2. Which various possibilities can be observed regarding the identification of a physical object with a spatial position/extend¶
case 1: The extend is known and can be drawn as a polygon that represents the extend=shape of the physical thing
E.g. the shape of a building or the area of excavation or the area of a settlement that can be drawn for example from an aerial photograph or a map.
case 2: The extend is not known but known to be within a larger area with known extend that can be drawn as a polygon.
E.g a no longer existing settlement that is known to have been situated within a known area for example in a valley between two other known settlements.
case 3: The extend is not known but known to be within a larger predefined area with known extend that is already in the database.
E.g an archeological findspot of unknown position that is known to have been situated inside the boundaries of a certain administrative unit.
case 4: The extend is not known but known to be within a larger area with unknown extend that cannot be drawn as a polygon
E.g. a no longer existing settlement that is known to have been situated within the historical boundaries of a no longer existing county.
case 5: There is no extend but only a known centerpoint
E.g. the coordinates where one find has been found.
case 6: Neither the extend nor a vague position within a reasonable larger area are known.
In many cases the exact identification of physical things/places mentioned in sources (e.g. in charters or also in archaeological publications) with one certain and still existing physcial entity and its extend is not possible. Therefore it is necessary to allow multiple possibilites to record possible locations of physical things:
A charter for example may mention one church and today two still existing churches might be identified with the one mentioned. In this case the church-entity from the source should be linked to two possible spatial objects. Here they would be two polygons, representing the extend of the respective church. However, any combination of the above mentioned cases must be technically and conceptually possible in any number. In theory it must be possible to link e.g. a castle known from a charter to the very extend of a still existing castle and at the same time to a vanished castle that is known to have been located within a certain area and also to another possible location within a certain administrative unit etc. etc.
3. User Input¶
Each entity with spatial position will be represented on the map at least with a marker as point. If polygon data is available these polygons will be shown too.
We want to offer the possibility to define the spatial position in any combination of the aforementioned categories. Therefore the location of the physical entity is connected 1-n to one or more entries in the gis-tables
In the map interface:
The user should be able to draw polygons or points to define either the extend of the physical entity or an area in which the physical thing is situated.
Also predefined categories should be chosen to define whether it is extend or area.
These polygons should be editable and deletable.
Methods: leaflet draw polygon and postgis
The user should be able to define an already existing area in which the site is located
2a) Administrative Unit: with known extend
2b) Historical Region: with unknown extend
The user should be able to set markers to define a point of location. In this case a point is drawn and saved to gis_centerpoints. No polygon is drawn.
4. Backend and Background Witchcraft¶
Postgis to/from Leaflet: see Stefan's drawshapes.js
1. get geojson from existing polygons and show them in the map.
2. Show centerpoints in Map
3. Make polygons from vertices drawn in leaflet and saves new ones and edited ones to the db
4. delete Polygons from leaflet and db
5. Create/update centerpoint data automatically after polygon is drawn or edited using postgis ST_PointOnSurface
SELECT ST_AsText(ST_PointOnSurface((SELECT ST_AsText (geom) FROM openatlas.polygon WHERE WHERE id = value of id)::geometry))insert or replace result into gis_centerpoints
6. Warnings if Point data is updated and moved outside of polygon using postgis ST_Intersects
SELECT ST_Intersects(ST_GeomFromText('POINT(value of new X, value of new Y)', 4326), (SELECT geom FROM openatlas.polygon WHERE id = value of id))if true: all is good. if false: alert and do not allow to draw a new centerpoint.
to be extended... on the fly
After new Site form is filled: offer button for localisation (next to save).
If pushed: save site and open Map-Tab
select type of localisation (see 2.)
if 1 - start polygon draw-tool in map and open form (type is automatically "shape")
if 2 - start polygon draw-tool in map and open form (type is automatically "area")
if 3 - offer selection tool for administrative units
if 4 - offer selection tool for historical regions
https://www.jstree.com/ for 3 and 4
if 5 - start markerdraw (as it is by now)
after 1-3: save to db and trigger the creation of a centerpoint
after 4: if historical region has a geometry trigger the creation of a centerpoint else don't
after 5: nothing necessary
Map: use existing map Interface but remove buttons.
after one localisation is done: offer the possibility to add one more (1-n)