Skip to content
vjrj edited this page Dec 12, 2019 · 22 revisions

Introduction

In this page we document how to:

  • Load a shapefile (polygon) spatial layer, and access it via web services and the spatial portal UI.
  • Load a grid (raster) spatial layer, and access it via web services and the spatial portal UI.

Load Shapefile into spatial service

  1. Using a browser go to your: http://spatial.l-a.site/ws
  2. Upload shapefile (SHP) in zip file using the “Manage layer uploads”. Your shapefile should be zipped and contain at least SHP, DBF, PRJ and SHX files. You can download an example shapefile here or here
  3. Create the “Layer” using the UI
  4. View the DBF fields of the Shapefile by clicking on the map (this requires the PRJ file to included) - view the layers and click “edit layer”
  5. Define one or “Fields” for your layer. These are the properties used in sampling. Make sure to:
    1. Select a sensible field from the layer
    2. Change the display name. This is how the layer can be found in the spatial portal
    3. Edit the layer and set values for the properties Classification1 and Classification2. This is visible in a tree hierarchy in the spatial portal
  6. Monitor progress of Field generation using the “Tasks” UI. All these tasks are time consuming so, be patient.
  7. Refresh intersect config: http://spatial.l-a.site/ws/intersect/reloadConfig
  8. Verify the layer and fields in spatial service & geoserver and web services are working:
    1. Use the geoserver UI http://spatial.l-a.site/geoserver
      1. Preview the layer in OpenLayers
      2. View configuration for layers (default username/password = admin/geoserver)
    2. Test the following JSON services:
      1. Check your layer appears in the layer list: http://spatial.l-a.site/ws/layers
      2. Check you field(s) appears in the fields list: http://spatial.l-a.site/ws/fields
      3. List the objects in the field http://spatial.l-a.site/ws/objects/<FIELD_ID>
      4. http://spatial.l-a.site/ws/objects/cl10003
      5. Retrieve the details of single object http://spatial.l-a.site/ws/object/<OBJECT_ID>
      6. Download the KML for an object: http://spatial.l-a.site/ws/shape/kml/<OBJECT_ID>
      7. Check point intersection works for your field(s) http://spatial.l-a.site/ws/intersect/<FIELD_ID>/<LATITUDE>/<LONGITUDE>
  9. Test the uploaded layer in the spatial portal
    1. Use “Add to Map > Areas > Gazetteer Polygon”
    2. Use “Add to Map > Areas > Select from Polygon Layer”

Load a grid file into spatial service

Examples can be downloaded from: http://www.worldclim.org/current. Look for the BioClim layers. You can get an example of grid layers here. If you are only testing, use a 10 minute grid (smaller). Note: the zips from this website will fail. Uploads require a zip with a single set of HDR, BIL, PRJ and bil.aux.xml files).

But you can for example download 1.4 version from http://worldclim.org/version1 like http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/prec_10m_bil.zip, unzip and zip again a single set of .hdr and .bil files, such as prec1.hdr and prec1.bil and then zip that up and use that file.

For http://worldclim.org/version2, that is, GeoTIFF files, use gdal_translate before hand: gdal_translate -of EHdr -ot Float32 wc2.0_bio_10m_01.tif wc2.0_bio_10m_01.bil.

  1. Using a browser go to your: http://spatial.l-a.site/ws for the admin screen
  2. Upload grid file (must contain HDR, BIL and PRJ files) in zip file using the “Manage layer uploads”.
  3. Create the “Layer” using the UI
  4. Create a “Field” associated with this layer using the UI
  5. Monitor progress of Field generation using the “Tasks” UI
  6. Refresh intersect config: http://spatial.l-a.site/ws/intersect/reloadConfig
  7. Verify the layer and fields in spatial service & geoserver and web services are working:
    1. Use the geoserver UI http://spatial.l-a.site/geoserver
      1. Preview the layer in OpenLayers
    2. Test the following JSON services:
      1. Check you layer appears in the layer list: http://spatial.l-a.site/ws/layers
      2. Check you field(s) appears in the fields list: http://spatial.l-a.site/ws/fields
      3. Check point intersection works for your field(s) http://spatial.l-a.site/ws/intersect/<FIELD_ID>/<LAT>/<LNG>
Clone this wiki locally