public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { throw new ServiceException( "Service for " + pathName + " needs to override " + "getConveyor(HttpSerlvetRequest,HttpServletResponse)"); }
/** * Convert Google's tiling coordinates into an {x,y,x} * * see http://code.google.com/apis/maps/documentation/overlays.html#Custom_Map_Types * * @param quadKey * @return */ public static long[] convert(long zoomLevel, long x, long y) throws ServiceException { // Extent is the total number of tiles in y direction long extent = (long) Math.pow(2, zoomLevel); if (x < 0 || x > extent - 1) { throw new ServiceException("The X coordinate is not sane: " + x); } if (y < 0 || y > extent - 1) { throw new ServiceException("The Y coordinate is not sane: " + y); } // xPos and yPos correspond to the top left hand corner long[] gridLoc = { x, extent - y - 1, zoomLevel }; return gridLoc; } }
throw new ServiceException("Zoomlevel cannot be greater than 17 for Mobile GMaps"); throw new ServiceException("The X coordinate is not sane: " + x); throw new ServiceException("The Y coordinate is not sane: " + y);
/** * Convert Google's tiling coordinates into an {x,y,x} * * <p>see http://code.google.com/apis/maps/documentation/overlays.html#Custom_Map_Types * * @param zoomLevel * @param x * @param y * @return */ public static long[] convert(long zoomLevel, long x, long y) throws ServiceException { // Extent is the total number of tiles in y direction long extent = (long) Math.pow(2, zoomLevel); if (x < 0 || x > extent - 1) { throw new ServiceException("The X coordinate is not sane: " + x); } if (y < 0 || y > extent - 1) { throw new ServiceException("The Y coordinate is not sane: " + y); } // xPos and yPos correspond to the top left hand corner long[] gridLoc = {x, extent - y - 1, zoomLevel}; return gridLoc; } }
throw new ServiceException("Zoomlevel cannot be greater than 17 for Mobile GMaps"); throw new ServiceException("The X coordinate is not sane: " + x); throw new ServiceException("The Y coordinate is not sane: " + y);
protected String getLayersParameter(HttpServletRequest request) throws ServiceException { String layers = ServletUtils.stringFromMap( request.getParameterMap(), request.getCharacterEncoding(), "layers"); if (layers == null) { throw new ServiceException("Unable to parse layers parameter from request."); } return layers; }
protected static long[] parseGridLocString(String key) throws ServiceException { // format should be x<x>y<y>z<z> long[] ret = {-1, -1, -1}; int yloc = key.indexOf("y"); int zloc = key.indexOf("z"); if (yloc < 2 || zloc < 4) { return ret; } try { ret[0] = Long.parseLong(key.substring(1, yloc)); ret[1] = Long.parseLong(key.substring(yloc + 1, zloc)); ret[2] = Long.parseLong(key.substring(zloc + 1, key.length())); } catch (NumberFormatException nfe) { throw new ServiceException("Unable to parse " + key); } catch (StringIndexOutOfBoundsException sobe) { throw new ServiceException("Unable to parse " + key); } return ret; }
protected static long[] parseGridLocString(String key) throws ServiceException { // format should be x<x>y<y>z<z> long[] ret = { -1, -1, -1 }; int yloc = key.indexOf("y"); int zloc = key.indexOf("z"); if (yloc < 2 || zloc < 4) { return ret; } try { ret[0] = Long.parseLong(key.substring(1, yloc)); ret[1] = Long.parseLong(key.substring(yloc + 1, zloc)); ret[2] = Long.parseLong(key.substring(zloc + 1, key.length())); } catch (NumberFormatException nfe) { throw new ServiceException("Unable to parse " + key); } catch (StringIndexOutOfBoundsException sobe) { throw new ServiceException("Unable to parse " + key); } return ret; }
/** * @param namePfx * @param overlayXml * @param dataXml * @param response * @return * @throws ServiceException */ protected static byte[] createZippedKML( String namePfx, String formatExtension, byte[] overlayXml, Resource dataXml) throws ServiceException { ByteArrayOutputStream out = new ByteArrayOutputStream(); try { writeZippedKML(namePfx, formatExtension, overlayXml, dataXml, out); } catch (IOException ioe) { throw new ServiceException("Encountered problem writing zip: " + ioe.getMessage()); } return out.toByteArray(); }
/** * * * @param namePfx * @param overlayXml * @param dataXml * @param response * @return * @throws ServiceException */ protected static byte[] createZippedKML( String namePfx , String formatExtension, byte[] overlayXml, Resource dataXml) throws ServiceException { ByteArrayOutputStream out = new ByteArrayOutputStream(); try { writeZippedKML(namePfx, formatExtension, overlayXml, dataXml, out); } catch (IOException ioe) { throw new ServiceException( "Encountered problem writing zip: " + ioe.getMessage()); } return out.toByteArray(); }
gridLoc[2] = Integer.parseInt(split.get("z")); } catch (NumberFormatException nfe) { throw new ServiceException( "Unable to parse number " + nfe.getMessage() + " from " + pathInfo); throw new ServiceException( "Unable to determine requested format based on extension " + fileExtension);
throw new ServiceException("Unable to parse KML request : " + e.getMessage());
throw new ServiceException("Unable to determine requested format, "+ strFormat);
throw new ServiceException("Unable to determine requested format, " + strFormat);
throw new ServiceException("Unable to determine requested format, " + strFormat);
mimeType = MimeType.createFromFormat(strFormat); } catch (MimeException me) { throw new ServiceException("Unable to determined requested format, " + strFormat);
mimeType = MimeType.createFromFormat(strFormat); } catch (MimeException me) { throw new ServiceException("Unable to determined requested format, " + strFormat);
throw new ServiceException("Unable to determine requested format, " + strFormat);
log.error(ioe.getMessage()); ioe.printStackTrace(); throw new ServiceException(ioe.getMessage());
} catch (IOException ioe) { log.error(ioe); throw new ServiceException(ioe.getMessage());