Strabon

changeset 189:35e57a27c1f0

Hanlding geojson accept type
author Kostis Kyzirakos <kkyzir@di.uoa.gr>
date Wed May 23 14:25:25 2012 +0300 (2012-05-23)
parents 44695999d693
children 39de290fc0ec
files endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java
line diff
     1.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Wed May 23 13:58:47 2012 +0300
     1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Wed May 23 14:25:25 2012 +0300
     1.3 @@ -133,16 +133,20 @@
     1.4  		} else if (reqAccept.contains("text/xml")) {
     1.5  			response.setContentType("text/xml; charset=UTF-8");
     1.6  			hive.setFormat("XML");
     1.7 +		} else if (reqAccept.contains("application/json"))  {
     1.8 +			response.setContentType("application/json; charset=UTF-8");
     1.9 +			hive.setFormat("GEOJSON");
    1.10 +
    1.11  		} else if (reqFormat.equalsIgnoreCase("KML file")) {
    1.12  			response.setContentType("application/vnd.google-earth.kml+xml; charset=UTF-8");
    1.13 -            response.setHeader("Content-Disposition","attachment;filename=pico.kml");
    1.14 +		        response.setHeader("Content-Disposition","attachment;filename=pico.kml");
    1.15  			hive.setFormat("KML");
    1.16  		} else if (reqFormat.equalsIgnoreCase("KML")) {
    1.17  			response.setContentType("text/plain; charset=UTF-8");
    1.18  			hive.setFormat("KML");
    1.19  		} else if (reqFormat.equalsIgnoreCase("KMZ file")) {
    1.20  			response.setContentType("application/vnd.google-earth.kmz; charset=UTF-8");
    1.21 -            response.setHeader("Content-Disposition","attachment;filename=pico.kmz");
    1.22 +			response.setHeader("Content-Disposition","attachment;filename=pico.kmz");
    1.23  			hive.setFormat("KMZ");
    1.24  		} else if (reqFormat.equalsIgnoreCase("KMZ")) {
    1.25  			response.setContentType("text/plain; charset=UTF-8");