Skip to content

bennidietz/Geosoftware-II-AALLH

 
 

Repository files navigation

Geosoftware II Project of the Group "A²HL²", WWU

Aysel Tandik, Anika Graupner, Henry Fock, Lia Kirsch, Lukas Jahnich

Project order: This project will close the gap between geospatial data formats and repositories respectively geospatial metadata catalogues and similarity measurements. Project groups will extend an existing Free and Open Source Software (FOSS) project with the functionality to retrieve and view similar records. This comprises both the API and UI, namely providing an HTTP endpoint to retrieve an ordered list of records based on a provided record and displaying/linking similar records in a detail view of a record respectively.

Table of Contents

Instructions to start pycsw

  • install docker: https://docs.docker.com/install/
  • clone our repository to your computer
  • make sure, docker is running
  • open Windows PowerShell (or Docker Toolbox) on your computer and navigate into the pycsw folder:
cd .../pycsw
  • add the following in PowerShell (just completely copy and paste):
docker run --name pycsw-dev --volume ${PWD}/pycsw:/usr/lib/python3.5/site-packages/pycsw --volume ${PWD}/docs:/home/pycsw/docs --volume ${PWD}/VERSION.txt:/home/pycsw/VERSION.txt --volume ${PWD}/LICENSE.txt:/home/pycsw/LICENSE.txt --volume ${PWD}/COMMITTERS.txt:/home/pycsw/COMMITTERS.txt --volume ${PWD}/CONTRIBUTING.rst:/home/pycsw/CONTRIBUTING.rst --volume ${PWD}/pycsw/plugins:/home/pycsw/pycsw/plugins --volume ${PWD}/our.cfg:/etc/pycsw/pycsw.cfg --volume ${PWD}/db-data:/db-data/ --publish 8000:8000 geopython/pycsw --reload
  • sometimes you could get an input/output error, if so, simply restart Docker and try again
  • go to localhost:8000 in your browser, when you see a xml tree, everething went fine
  • to remove the container, add the following in powerShell (necessary if the container should be restarted with the above command):
docker rm -f pycsw-dev

Test our additional features:

  • we added two own functions for the api in pycsw/pycsw/ogc/csw/csw2.py (for code review):
    • def getsimilarrecords(self)
    • def getsimilaritybbox(self, raw=False)

In your Browser, test our new requests by adding the following endpoints:

Using the CLI-Tools

If you have cloned our repository and installed Python, open the commandline and navigate to the CLI Tools folder in our project folder and type python masterExtract.py --help to show the options you can chose from.

Options:
  --path TEXT  Path to Folder containing Geofiles
  -c, --clear  Clear screen before showing results
  -t, --time   execute time extraction for one file
  -s, --space  execute boundingbox extraction for one file
  -h, --hull   execute convex-hull extraction for one file
  --help       Show this message and exit.

Those are only options, you do not have to use them. However, if you do not choos any of the execution flags (-t / -s / -h), the folderextraction will be triggered and gives you the spatial and temporal extent of each of your Geofiles within the chosen folder in addition to the full spatial and temporal extent of the folder.

You are not limeted to choose only one option but all of them at once except for --help.

If you do not use --path, the path will be prompted. That means it is a shortcut only.

Examples

$ python masterExtract.py -t -s -h
Pleas enter path to Folder: <path>
Pleas enter filename: <filename>

Timeextent:
['1935/01/01 00:00:00 GMT+0', '2014/01/01 00:00:00 GMT+0', 365.253164556962]


Spatialextent:
[-179.5, -89.5, 179.5, 89.5]


Spatialextent as Convex Hull:
[(-179.5, -89.5), (-179.5, 89.5), (179.5, 89.5), (179.5, -89.5)]

The Timeextent starts with the beginning and ends with the end date as ISO8601 standard. the last number is the average intervall in which measurements have been taken.

The spatial extent is shown as a boundingbox. [minX/minLong, minY/minLat, maxX/maxLong, maxY/maxLat]

For more percission the -h / --hull flag gives you the spatial exnent as a convex hull. That means from all the points of a dataset the outer most points are beeing calculated and returned in correct order.

Folderextraction

If you want to extract your hole folder, the -c / --clear flag is recommended because a long list of processing outputs is generated before the final output appears.

$ python masterExtract.py -c --path "<folder path>"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.3%
  • C 1.3%
  • C++ 0.4%
  • Fortran 0.0%
  • Makefile 0.0%
  • Dockerfile 0.0%