-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reorder contents, remove gfi (not needed)
- Loading branch information
1 parent
af88f80
commit 5af2eeb
Showing
17 changed files
with
590 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# TODO | ||
|
||
## MUSS | ||
|
||
* Liste ermittelter Orte | ||
* Liste ermittelter Texte mit Ortsbezug | ||
* Ortsbezüge eines Textes graphisch darstellen | ||
* Suchgeometrien: Rechtecke, Punkte | ||
* Suchgeometrien: Ortspolygone (Adresssuche?) | ||
* Kontextsuche: Filtern ermittelter Texte (???) | ||
* Relevanzbewertung von Ortsbezügen (UI nur Count?) | ||
|
||
## SOLL | ||
|
||
* Häufigkeit von Funden | ||
* Dataport-Geo-Design | ||
* Ortsbezüge von Texten als Ortsgebirge (?) | ||
* Zugriff auf weitere Geodaten (???) | ||
* Schreibweisen/Sprachen von Orten berücksichtigen | ||
* Historische Ortspolygone beachten | ||
* Suchgeometrien: Kreise, Vielecke | ||
* Ortssuche | ||
|
||
## KANN | ||
|
||
* 3D-Darstellung Ortsgebirge | ||
* Höhenlinien Ortsgebirge | ||
* Farbliche Markieren Ortsgebirge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
import { Feature, Map, View } from 'ol' | ||
import TileLayer from 'ol/layer/Tile' | ||
import TileWMS from 'ol/source/TileWMS.js' | ||
import OSM, { ATTRIBUTION } from 'ol/source/OSM' | ||
import { getTransform } from 'ol/proj.js' | ||
import WKT from 'ol/format/WKT.js' | ||
import Polygon from 'ol/geom/Polygon.js' | ||
import VectorSource from 'ol/source/Vector' | ||
import VectorLayer from 'ol/layer/Vector' | ||
import Overlay from 'ol/Overlay.js' | ||
import { Fill, Stroke, Style } from 'ol/style.js' | ||
import { Control, defaults as defaultControls } from 'ol/control.js' | ||
|
||
const WKTfmt = new WKT() | ||
|
||
const resultFeatureStyle = [ | ||
new Style({ | ||
stroke: new Stroke({ | ||
color: 'blue', | ||
width: 3, | ||
}), | ||
fill: new Fill({ | ||
color: 'rgba(0, 0, 255, 0.1)', | ||
}), | ||
}), | ||
] | ||
const resultVectorLayer = new VectorLayer({ | ||
source: new VectorSource({ | ||
features: resultFeatures, | ||
style: resultFeatureStyle, | ||
}), | ||
}) | ||
// used to display the colored Geometries when clicking a location | ||
const geometriesVectorLayer = new VectorLayer({ | ||
source: new VectorSource({ | ||
features: [], | ||
style: resultFeatureStyle, | ||
}), | ||
}) | ||
geometriesVectorLayer.setOpacity(0.7) | ||
|
||
// for coloring all geometries to all locations found in a title | ||
const titleGeometriesVectorLayer = new VectorLayer({ | ||
source: new VectorSource({ | ||
features: [], | ||
style: resultFeatureStyle, | ||
}), | ||
}) | ||
titleGeometriesVectorLayer.setOpacity(0.8) | ||
|
||
const popupOverlay = new Overlay({ | ||
element: popupContainer, | ||
autoPan: { | ||
animation: { | ||
duration: 250, | ||
}, | ||
}, | ||
}) | ||
|
||
popupCloser.onclick = function () { | ||
popupOverlay.setPosition(undefined) | ||
popupCloser.blur() | ||
return false | ||
|
||
class ResetLocationGeometries extends Control { | ||
geometriesVectorLayer.getSource().clear() | ||
|
||
class ResetTextGeometries extends Control { | ||
titleGeometriesVectorLayer.getSource().clear() | ||
|
||
overlays: [popupOverlay] | ||
|
||
showPopup(text, coordinate) { | ||
popupOverlay.setPosition(coordinate) | ||
this.popupContent.innerHTML = text | ||
|
||
displayUserSelectedPoly(geometry) { | ||
const displayPoly = geometry.clone() | ||
displayPoly.applyTransform(getTransform('EPSG:4326', 'EPSG:3857')) | ||
this.resultVectorLayer.getSource().getFeatures()[0].setGeometry(displayPoly) | ||
|
||
removeUserSelectedPoly() { | ||
this.resultVectorLayer | ||
.getSource() | ||
.getFeatures()[0] | ||
.setGeometry(new Polygon([])) | ||
|
||
displayGeometriesOnMap(geometriesList) { | ||
this.resultVectorLayer.getSource().clear() | ||
this.resultVectorLayer.setOpacity(0.45) | ||
geometriesList.forEach((wktGeom) => { | ||
const feature = WKTfmt.readFeature(wktGeom, { | ||
dataProjection: 'EPSG:4326', | ||
featureProjection: 'EPSG:3857', | ||
}) | ||
this.resultVectorLayer.getSource().addFeature(feature) | ||
|
||
colorGeometries(locationName, nameGeometryDict) { | ||
this.geometriesVectorLayer.getSource().clear() | ||
const geometriesList = nameGeometryDict[locationName] | ||
if (geometriesList && Array.isArray(geometriesList)) { | ||
let geometryCounter = 0 | ||
geometriesList.forEach((wktGeom) => { | ||
const style = new Style({ | ||
fill: new Fill({ | ||
color: colorPalette[geometryCounter], | ||
}), | ||
}) | ||
const feature = WKTfmt.readFeature(wktGeom, { | ||
dataProjection: 'EPSG:4326', | ||
featureProjection: 'EPSG:3857', | ||
}) | ||
feature.setStyle(style) | ||
this.geometriesVectorLayer.getSource().addFeature(feature) | ||
geometryCounter++ | ||
}) | ||
} else { | ||
console.log('No Geometries for this location') | ||
|
||
colorGeometriesMultipleLocations( | ||
article_title, | ||
titleLocationFreqDict, | ||
nameGeometryDict | ||
) { | ||
this.titleGeometriesVectorLayer.getSource().clear() | ||
const locationsFreqs = titleLocationFreqDict[article_title] | ||
for (const locationName in locationsFreqs) { | ||
const geometriesList = nameGeometryDict[locationName] | ||
if (geometriesList && Array.isArray(geometriesList)) { | ||
geometriesList.forEach((wktGeom) => { | ||
const style = new Style({ | ||
fill: new Fill({ | ||
color: heatColorPalette[locationsFreqs[locationName]], | ||
}), | ||
}) | ||
const feature = WKTfmt.readFeature(wktGeom, { | ||
dataProjection: 'EPSG:4326', | ||
featureProjection: 'EPSG:3857', | ||
}) | ||
feature.setStyle(style) | ||
this.titleGeometriesVectorLayer.getSource().addFeature(feature) | ||
}) | ||
} else { | ||
console.log('No Geometries for this location') |
Oops, something went wrong.