org.geotools.styling.ExternalGraphic Maven / Gradle / Ivy
Show all versions of gt-main Show documentation
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2008, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
package org.geotools.styling;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
/**
* Holds a reference to an external graphics file with a URL to its location and its expected MIME
* type. Knowing the MIME type in advance allows stylers to select best-supported formats from a
* list of external graphics.
*
*
*
*
The details of this object are taken from the OGC Styled-Layer Descriptor
* Report (OGC 02-070) version 1.0.0.:
*
*
* <xsd:element name="ExternalGraphic">
* <xsd:annotation>
* <xsd:documentation>
* An "ExternalGraphic" gives a reference to an external raster or
* vector graphical object.
* </xsd:documentation>
* </xsd:annotation>
* <xsd:complexType>
* <xsd:sequence>
* <xsd:element ref="sld:OnlineResource"/>
* <xsd:element ref="sld:Format"/>
* </xsd:sequence>
* </xsd:complexType>
* </xsd:element>
*
*
* Renderers can use this information when displaying styled features, though it must be
* remembered that not all renderers will be able to fully represent strokes as set out by this
* interface. For example, opacity may not be supported.
*
*
Notes:
*
*
* - The graphical parameters and their values are derived from SVG/CSS2 standards with names
* and semantics which are as close as possible.
*
*
* @author James Macgill, CCG
* @version $Id$
*/
public interface ExternalGraphic extends org.opengis.style.ExternalGraphic, Symbol {
public static final ExternalGraphic[] EXTERNAL_GRAPHICS_EMPTY = new ExternalGraphic[0];
/**
* Converts a URI in a string to the location URL
*
* @param uri the uri of the external graphic
*/
public void setURI(String uri);
/**
* Returns the un-parsed URI for the mark (useful if the uri is using transformations or
* relative locations)
*/
public String getURI();
/**
* Provides the URL for where the external graphic resource can be located.
*
* This method will be replaced by getOnlineResource().getLinkage() in 2.6.x
*
* @return The URL of the ExternalGraphic
* @throws MalformedURLException If the url held in the ExternalGraphic is malformed.
*/
URL getLocation() throws MalformedURLException;
/**
* Provides the URL for where the external graphic resource can be located.
*
* @param url The URL of the ExternalGraphic
*/
void setLocation(URL url);
/**
* Provides the format of the external graphic.
*
* @param format The format of the external graphic. Reported as its MIME type in a String
* object.
*/
void setFormat(String format);
/**
* Custom properties; renderer may consult these values when drawing graphic.
*
*
The default GeoTools renderer uses the following:
*
*
* - radius: 50
*
- circle color: #000066
*
- bar height:150
*
- bar color:"#000000
*
- bar uncertainty:50
*
- bar uncertainty width:5
*
- bar uncertainty color:"#999999
*
- pointer length:100
*
- pointer color: #FF0000
*
- pointer direction: 21
*
- wedge width: 25
*
- wedge color: #9999FF"
*
*/
public void setCustomProperties(Map properties);
/**
* Custom user supplied properties available when working with an external graphic.
*
* @return properties
*/
public Map getCustomProperties();
}