Solutions for sharing data (IEO)

20 APRIL 2018

PLASMAR & MarSP workshop

ALLOW ME INTRODUCE MYSELF...

LUIS MIGUEL AGUDO

** GIS DEVELOPER **

  • INSTITUTO ESPAÑOL DE OCEANOGRAFÍA
  • IOC/UNESCO
  • JRC / EUROPEAN COMMISSION

Have you ever shared data using ArcGIS?

... TOO DISORGANIZED

MAP PACKAGES

... AND IN THE WEB?

WEB SERVICES

  1. ArcGIS Server
  2. ArcGIS Online

WHAT IS ArcGIS SERVER?

ArcGIS Server is software that makes your geographic information available to others in your organization and optionally anyone with an Internet connection.

 

This is accomplished through web services, which allow a powerful server computer to receive and process requests for information sent by other devices. ArcGIS Server opens your GIS to tablets, smartphones, laptops, desktop workstations, and any other devices that can connect to web services

WEB SERVICES

INSTALL...

SYSTEM ARCHITECTURE ...

SOFTWARE:

  • ARCGIS Server (10.3)
  • ARCGIS Desktop (10.3)
  • RMDBS (Microsoft SQl Server 2012)
  • Apache Tomcat 7 (Web Adaptor)
  • Web Applications Server (IIS 8)

 

HARDWARE:

  • Map Server
  • DB Server
  • Applications Server

 

SERVICES

  • MAP SERVICES (including map services with WMS enabled)
  • FEATURE SERVICES (map services with feature access enabled)
  • IMAGE SERVICES
  • GEODATABASE SERVICES
  • GEOPROCESSING SERVICES
  • GEOMETRY SERVICES
  • NETWORK ANALYSIS SERVICES
  • GEOCODING SERVICES

http://barretosm.md.ieo.es/arcgis/rest/services

CONNECTING

ArcMAP - ArcGIS Server

GENERATE A NEW MAP SERVICE

ArcGIS SERVER MANAGER

http://barretosm.md.ieo.es/arcgis/manager

GEOPROCESSING SERVICES

WEB PROCESSING SERVICE

A web service interface to standarize the way that (spatial) algorithms are made available on the internet

GEOPROCESSING SERVICES

MODEL BUILDER

GEOPROCESSING SERVICES

PYTHON - ARCPY

######################################################################
## 22/06/2016
## Crear shapefile con re
## Luis Miguel Agudo Bravo
######################################################################


# Import arcpy module
import arcpy
from os import listdir
from os.path import isfile, join
import os
import os

# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")

#Establezco las variables de entorno
arcpy.env.overwriteOutput = True
#pathSalida=arcpy.env.scratchFolder
#pathSalida = "D:\\datos\\extradata\\IOC"

# Parametros de entrada
Raster1 = arcpy.GetParameterAsText(0)
Raster2 = arcpy.GetParameterAsText(1)
pathSalida = arcpy.env.scratchFolder

#Parametros de salida
#AnomalyRaster = arcpy.GetParameterAsText(3)

# Local variables:
CCLME_Reg =r'C:\IEO\CCLME\CCLME_Servidor.gdb\Info_Base\\CCLME_Reg'
Extract_img1 = os.path.join(pathSalida,"Extract_img1")
Extract_img2 = os.path.join(pathSalida,"Extract_img2")
Minus_Extrac1 = os.path.join(pathSalida,"Minus_Extrac1")
FinalRaster = os.path.join(pathSalida,"ProjectRaster")

try:
    # Process: Extract by Mask
    arcpy.gp.ExtractByMask_sa(Raster1, CCLME_Reg, Extract_img1)
    # Process: Extract by Mask (2)
    arcpy.gp.ExtractByMask_sa(Raster2, CCLME_Reg, Extract_img2)
    # Process: Minus
    arcpy.gp.Minus_sa(Extract_img2, Extract_img1, Minus_Extrac1)
    # Process: Project Raster
    arcpy.ProjectRaster_management(Minus_Extrac1, FinalRaster, "PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator_Auxiliary_Sphere'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Auxiliary_Sphere_Type',0.0],UNIT['Meter',1.0]]", "NEAREST", "5124,34121541113 5124,34121541113", "", "", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]")

    # Process: Build Pyramids And Statistics
    arcpy.BuildPyramidsandStatistics_management(FinalRaster, "INCLUDE_SUBDIRECTORIES", "BUILD_PYRAMIDS", "CALCULATE_STATISTICS", "NONE", "", "NONE", "1", "1", "", "-1", "NONE", "NEAREST", "DEFAULT", "75", "SKIP_EXISTING")
    arcpy.SetParameter(2,FinalRaster)

except Exception as e:
    print e
except arcpy.ExecuteError:
    print arcpy.GetMessage(2)

GENERATE A NEW GEOPROCESSING SERVICE

BORING...

USING  SERVICES...

API FOR JAVASCRIPT

API FOR JAVASCRIPT

https://developers.arcgis.com/javascript/

API FOR JAVASCRIPT

// Reference the JavaScript API from our CDN and you are ready to get started:
<link rel="stylesheet" href="https://js.arcgis.com/4.6/esri/css/main.css">
<script src="https://js.arcgis.com/4.6/"></script>
require([
  "esri/Map",
  "esri/views/MapView",
  "dojo/domReady!"
], function(Map, MapView) {
  var map = new Map({
    basemap: "streets"
  });

  var view = new MapView({
    container: "viewDiv",  // Reference DOM node that will contain the view
    map: map               // References the map object
  });
});

API FOR JAVASCRIPT

require(["esri/layers/MapImageLayer"], function(MapImageLayer){
  // points to the states layer in a service storing U.S. census data
  var layer = new MapImageLayer({
    url: "http://<hostname>/arcgis/rest/services/<service-name>/MapServer"
  });
  map.add(layer);  // adds the layer to the map
});

MAP SERVICES

require(["esri/layers/FeatureLayer"], function(FeatureLayer){
  // points to the states layer in a service storing U.S. census data
  const fl = new FeatureLayer({
    url: "http://<hostname>/arcgis/rest/services/<service-name>/MapServer/<number-layer>"
  });
  map.add(fl);  // adds the layer to the map
});

FEATURE LAYER SERVICES

API FOR JAVASCRIPT


require(["esri/tasks/Geoprocessor"], function(Geoprocessor) {
    var gpUrl = "http://<hostname>/arcgis/rest/services/<service-name>/GPServer/<geopro-name>";
});

var gp = new Geoprocessor(gpUrl);
gp.outSpatialReference = {
    wkid: 102100
};

var params = {
    "param1": param1,
    "param2": param2
};

gp.execute(params).then(handleFunction);

function drawResultData(result) {
    //handle result
}

GEOPROCESSING SERVICES

GIS CLOUD

https://www.arcgis.com/home/index.html

http://ieo.maps.arcgis.com/home/index.html

Luis Miguel Agudo

lmagudo@gmail.com