本文整理了Java中net.fortuna.ical4j.model.property.Geo
类的一些代码示例,展示了Geo
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geo
类的具体详情如下:
包路径:net.fortuna.ical4j.model.property.Geo
类名称:Geo
[英]$Id$
Created: [Apr 6, 2004]
Defines a GEO iCalendar component property.
4.8.1.6 Geographic Position
Property Name: GEO
Purpose: This property specifies information related to the global
position for the activity specified by a calendar component.
Value Type: FLOAT. The value MUST be two SEMICOLON separated FLOAT
values.
Property Parameters: Non-standard property parameters can be
specified on this property.
Conformance: This property can be specified in "VEVENT" or "VTODO"
calendar components.
Description: The property value specifies latitude and longitude, in
that order (i.e., "LAT LON" ordering). The longitude represents the
location east or west of the prime meridian as a positive or negative
real number, respectively. The longitude and latitude values MAY be
specified up to six decimal places, which will allow for accuracy to
within one meter of geographical position. Receiving applications
MUST accept values of this precision and MAY truncate values of
greater precision.
Values for latitude and longitude shall be expressed as decimal
fractions of degrees. Whole degrees of latitude shall be represented
by a two-digit decimal number ranging from 0 through 90. Whole
degrees of longitude shall be represented by a decimal number ranging
from 0 through 180. When a decimal fraction of a degree is specified,
it shall be separated from the whole number of degrees by a decimal
point.
Latitudes north of the equator shall be specified by a plus sign (+),
or by the absence of a minus sign (-), preceding the digits
designating degrees. Latitudes south of the Equator shall be
designated by a minus sign (-) preceding the digits designating
degrees. A point on the Equator shall be assigned to the Northern
Hemisphere.
Longitudes east of the prime meridian shall be specified by a plus
sign (+), or by the absence of a minus sign (-), preceding the digits
designating degrees. Longitudes west of the meridian shall be
designated by minus sign (-) preceding the digits designating
degrees. A point on the prime meridian shall be assigned to the
Eastern Hemisphere. A point on the 180th meridian shall be assigned
to the Western Hemisphere. One exception to this last convention is
permitted. For the special condition of describing a band of latitude
around the earth, the East Bounding Coordinate data element shall be
assigned the value +180 (180) degrees.
Any spatial address with a latitude of +90 (90) or -90 degrees will
specify the position at the North or South Pole, respectively. The
component for longitude may have any legal value.
With the exception of the special condition described above, this
form is specified in Department of Commerce, 1986, Representation of
geographic point locations for information interchange (Federal
Information Processing Standard 70-1): Washington, Department of
Commerce, National Institute of Standards and Technology.
The simple formula for converting degrees-minutes-seconds into
decimal degrees is:
decimal = degrees + minutes/60 + seconds/3600.
Format Definition: The property is defined by the following notation:
geo = "GEO" geoparam ":" geovalue CRLF
geoparam = *(";" xparam)
geovalue = float ";" float
;Latitude and Longitude components
Example: The following is an example of this property:
GEO:37.386013;-122.082932
[中]$Id$
创建:[2004年4月6日]
定义地理iCalendar组件特性。
4.8.1.6 Geographic Position
Property Name: GEO
Purpose: This property specifies information related to the global
position for the activity specified by a calendar component.
Value Type: FLOAT. The value MUST be two SEMICOLON separated FLOAT
values.
Property Parameters: Non-standard property parameters can be
specified on this property.
Conformance: This property can be specified in "VEVENT" or "VTODO"
calendar components.
Description: The property value specifies latitude and longitude, in
that order (i.e., "LAT LON" ordering). The longitude represents the
location east or west of the prime meridian as a positive or negative
real number, respectively. The longitude and latitude values MAY be
specified up to six decimal places, which will allow for accuracy to
within one meter of geographical position. Receiving applications
MUST accept values of this precision and MAY truncate values of
greater precision.
Values for latitude and longitude shall be expressed as decimal
fractions of degrees. Whole degrees of latitude shall be represented
by a two-digit decimal number ranging from 0 through 90. Whole
degrees of longitude shall be represented by a decimal number ranging
from 0 through 180. When a decimal fraction of a degree is specified,
it shall be separated from the whole number of degrees by a decimal
point.
Latitudes north of the equator shall be specified by a plus sign (+),
or by the absence of a minus sign (-), preceding the digits
designating degrees. Latitudes south of the Equator shall be
designated by a minus sign (-) preceding the digits designating
degrees. A point on the Equator shall be assigned to the Northern
Hemisphere.
Longitudes east of the prime meridian shall be specified by a plus
sign (+), or by the absence of a minus sign (-), preceding the digits
designating degrees. Longitudes west of the meridian shall be
designated by minus sign (-) preceding the digits designating
degrees. A point on the prime meridian shall be assigned to the
Eastern Hemisphere. A point on the 180th meridian shall be assigned
to the Western Hemisphere. One exception to this last convention is
permitted. For the special condition of describing a band of latitude
around the earth, the East Bounding Coordinate data element shall be
assigned the value +180 (180) degrees.
Any spatial address with a latitude of +90 (90) or -90 degrees will
specify the position at the North or South Pole, respectively. The
component for longitude may have any legal value.
With the exception of the special condition described above, this
form is specified in Department of Commerce, 1986, Representation of
geographic point locations for information interchange (Federal
Information Processing Standard 70-1): Washington, Department of
Commerce, National Institute of Standards and Technology.
The simple formula for converting degrees-minutes-seconds into
decimal degrees is:
decimal = degrees + minutes/60 + seconds/3600.
Format Definition: The property is defined by the following notation:
geo = "GEO" geoparam ":" geovalue CRLF
geoparam = *(";" xparam)
geovalue = float ";" float
;Latitude and Longitude components
Example: The following is an example of this property:
GEO:37.386013;-122.082932
代码示例来源:origin: org.bedework/bw-ical4j-cl
/**
* {@inheritDoc}
*/
public final String getValue() {
return String.valueOf(getLatitude()) + ";"
+ String.valueOf(getLongitude());
}
代码示例来源:origin: ical4j/ical4j
public Property createProperty(final ParameterList parameters, final String value)
throws IOException, URISyntaxException, ParseException {
return new Geo(parameters, value);
}
代码示例来源:origin: org.mnode.ical4j/ical4j
/**
* Creates a new instance by parsing the specified string representation.
*
* @param value a geo value
*/
public Geo(final String value) {
super(GEO, new Factory());
setValue(value);
}
代码示例来源:origin: ical4j/ical4j
/**
* Creates a new instance by parsing the specified string representation.
*
* @param value a geo value
*/
public Geo(final String value) {
super(GEO, new Factory());
setValue(value);
}
代码示例来源:origin: ical4j/ical4j
/**
* {@inheritDoc}
*/
public final String getValue() {
return String.valueOf(getLatitude()) + ";"
+ String.valueOf(getLongitude());
}
代码示例来源:origin: ical4j/ical4j
public Property createProperty() {
return new Geo();
}
}
代码示例来源:origin: org.bedework/bw-ical4j-cl
/**
* Creates a new instance by parsing the specified string representation.
* @param value a geo value
*/
public Geo(final String value) {
super(GEO, PropertyFactoryImpl.getInstance());
setValue(value);
}
代码示例来源:origin: org.mnode.ical4j/ical4j
/**
* {@inheritDoc}
*/
public final String getValue() {
return String.valueOf(getLatitude()) + ";"
+ String.valueOf(getLongitude());
}
代码示例来源:origin: org.bedework/bw-ical4j-cl
public Property createProperty(final String name,
final ParameterList parameters, final String value)
throws IOException, URISyntaxException, ParseException {
return new Geo(parameters, value);
}
代码示例来源:origin: net.oneandone.ical4j/ical4j
/**
* Creates a new instance by parsing the specified string representation.
*
* @param value a geo value
*/
public Geo(final String value) {
super(GEO, PropertyFactoryImpl.getInstance());
setValue(value);
}
代码示例来源:origin: org.bedework.ical4j/ical4j
/**
* {@inheritDoc}
*/
public final String getValue() {
return String.valueOf(getLatitude()) + ";"
+ String.valueOf(getLongitude());
}
代码示例来源:origin: net.oneandone.ical4j/ical4j
public Property createProperty(final ParameterList parameters, final String value)
throws IOException, URISyntaxException, ParseException {
return new Geo(parameters, value);
}
代码示例来源:origin: org.bedework.ical4j/ical4j
/**
* @param aList a list of parameters for this component
* @param aValue a value string for this component
*/
public Geo(final ParameterList aList, final String aValue) {
super(GEO, aList, PropertyFactoryImpl.getInstance());
setValue(aValue);
}
代码示例来源:origin: net.oneandone.ical4j/ical4j
/**
* {@inheritDoc}
*/
public final String getValue() {
return String.valueOf(getLatitude()) + ";"
+ String.valueOf(getLongitude());
}
代码示例来源:origin: org.mnode.ical4j/ical4j
public Property createProperty() {
return new Geo();
}
}
代码示例来源:origin: ical4j/ical4j
/**
* @param aList a list of parameters for this component
* @param aValue a value string for this component
*/
public Geo(final ParameterList aList, final String aValue) {
super(GEO, aList, new Factory());
setValue(aValue);
}
代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-ical
@Override
public void emitValue(final JsonGenerator jgen,
final Property prop) throws Throwable {
final Geo p = (Geo)prop;
jgen.writeStartArray();
jgen.writeNumber(p.getLatitude());
jgen.writeNumber(p.getLongitude());
jgen.writeEndArray();
}
}
代码示例来源:origin: org.bedework.ical4j/ical4j
public Property createProperty() {
return new Geo();
}
}
代码示例来源:origin: org.mnode.ical4j/ical4j
/**
* @param aList a list of parameters for this component
* @param aValue a value string for this component
*/
public Geo(final ParameterList aList, final String aValue) {
super(GEO, aList, new Factory());
setValue(aValue);
}
代码示例来源:origin: apache/marmotta
private void createLocation(Resource uri, URI prop, Geo geo) throws RDFHandlerException, RDFParseException {
Resource r_location = createBNode();
Resource t_adr = createURI(NS_GEO + "Point");
URI p_type = createURI(NS_RDF + "type");
rdfHandler.handleStatement(createStatement(r_location,p_type,t_adr));
URI p_latitute = createURI(NS_GEO+"latitude");
URI p_longitude = createURI(NS_GEO+"longitude");
URI t_decimal = createURI("http://www.w3.org/2001/XMLSchema#double");
if(geo.getLatitude() != null) {
Literal v_latitude = createLiteral(geo.getLatitude().toPlainString(),null,t_decimal);
rdfHandler.handleStatement(createStatement(r_location,p_latitute,v_latitude));
}
if(geo.getLongitude() != null) {
Literal v_longitude = createLiteral(geo.getLongitude().toPlainString(), null, t_decimal);
rdfHandler.handleStatement(createStatement(r_location,p_longitude,v_longitude));
}
rdfHandler.handleStatement(createStatement(uri,prop,r_location));
}
内容来源于网络,如有侵权,请联系作者删除!