Esri Geoportal Server
1.2.9

com.esri.gpt.control.georss
Class GeometryService

java.lang.Object
  extended by com.esri.gpt.control.georss.GeometryService

public class GeometryService
extends Object

Geometry service.


Constructor Summary
GeometryService(String URL)
          Creates instance of the service object.
 
Method Summary
static GeometryService createDefaultInstance()
          Creates instance as configured in gpt.xml.
protected  Map<String,List<Envelope>> createEnvMap(List<Envelope> envelopes, String defWkid)
          Creates WKID to envelope mapping.
protected  String enc(String str)
          Encodes a string.
protected  String envToJson(Envelope env, String wkid)
          Turns a single envelope into a JSON object.
protected  String envToJson(List<Envelope> envList, String wkid)
          Turns list of envelopes into a JSON object.
 List<Envelope> project(List<Envelope> envelopes, String outSR)
          Performs projection.
protected  List<Envelope> project(List<Envelope> inEnv, String inSR, String outSR)
          Performs projection.
protected  Envelope readEnvelope(org.json.JSONObject geom)
          Read envelope from the JSON object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryService

public GeometryService(String URL)
Creates instance of the service object.

Parameters:
URL - URL to the service
Method Detail

createDefaultInstance

public static GeometryService createDefaultInstance()
Creates instance as configured in gpt.xml.

Returns:
instance of the service

project

public List<Envelope> project(List<Envelope> envelopes,
                              String outSR)
                       throws org.json.JSONException,
                              HttpClientException,
                              IOException
Performs projection.

Parameters:
envelopes - list of envelopes to project
outSR - output spatial reference (WKID)
Returns:
list of projected envelopes
Throws:
org.json.JSONException - if reading response as JSON fails
HttpClientException - if HTTP communication fails
IOException - if data transmission fails

project

protected List<Envelope> project(List<Envelope> inEnv,
                                 String inSR,
                                 String outSR)
                          throws org.json.JSONException,
                                 HttpClientException,
                                 IOException
Performs projection.

Parameters:
inEnv - list of envelopes
inSR - input spatial reference (WKID)
outSR - output spatial reference (WKID)
Returns:
list of projected envelopes
Throws:
org.json.JSONException - if reading response as JSON fails
HttpClientException - if HTTP communication fails
IOException - if data transmission fails

readEnvelope

protected Envelope readEnvelope(org.json.JSONObject geom)
                         throws org.json.JSONException
Read envelope from the JSON object.

Parameters:
geom - JSON object representing envelope
Returns:
envelope
Throws:
org.json.JSONException - if input object is not a valid envelope

createEnvMap

protected Map<String,List<Envelope>> createEnvMap(List<Envelope> envelopes,
                                                  String defWkid)
Creates WKID to envelope mapping.

Parameters:
envelopes - envelopes
defWkid - default WKID
Returns:
mapping

envToJson

protected String envToJson(List<Envelope> envList,
                           String wkid)
Turns list of envelopes into a JSON object.

Parameters:
envList - list of envelopes
wkid - WKID
Returns:
string representation of JSON object

envToJson

protected String envToJson(Envelope env,
                           String wkid)
Turns a single envelope into a JSON object.

Parameters:
env - envelope
wkid - WKID
Returns:
string representation of JSON object

enc

protected String enc(String str)
Encodes a string.

Parameters:
str - string to encode
Returns:
encoded string

Esri Geoportal Server
1.2.9

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.