本文整理汇总了Java中com.axiomalaska.ioos.sos.GeomHelper类的典型用法代码示例。如果您正苦于以下问题:Java GeomHelper类的具体用法?Java GeomHelper怎么用?Java GeomHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GeomHelper类属于com.axiomalaska.ioos.sos包,在下文中一共展示了GeomHelper类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testObservationRetriever
import com.axiomalaska.ioos.sos.GeomHelper; //导入依赖的package包/类
@Test
public void testObservationRetriever() {
ObservationRetriever observationRetriever = new DatabaseObservationRetriever();
DatabaseSosStation dbStation = new DatabaseSosStation();
dbStation.setDatabaseId("1");
DatabaseSosSensor dbSensor = new DatabaseSosSensor();
dbSensor.setDatabaseId("1");
dbSensor.setStation(dbStation);
dbSensor.setLocation(GeomHelper.createLatLngPoint(62.0, -140.0)); //location isn't checked in equals but must not be null
DatabasePhenomenon dbPhenomenon = new DatabasePhenomenon();
dbPhenomenon.setDatabaseId("9");
DateTime startDate = new DateTime(2014, 2, 1, 0, 0, DateTimeZone.UTC);
List<ObservationCollection> observationCollections = observationRetriever.getObservationCollection(dbSensor, dbPhenomenon,
new DateTime(2014, 2, 1, 0, 0, DateTimeZone.UTC));
assertNotNull(observationCollections);
assertFalse(observationCollections.isEmpty());
for (ObservationCollection observationCollection : observationCollections) {
assertEquals(dbSensor, observationCollection.getSensor());
assertEquals(dbPhenomenon, observationCollection.getPhenomenon());
for (DateTime obsDate : observationCollection.getObservationValues().keySet()) {
assertTrue("Start date (" + startDate + ") should be before obsDate (" + obsDate + ")",
startDate.isBefore(obsDate));
}
}
}
示例2: testObservationRetriever
import com.axiomalaska.ioos.sos.GeomHelper; //导入依赖的package包/类
@Test
public void testObservationRetriever() {
ObservationRetriever observationRetriever = new DatabaseObservationRetriever();
DatabaseSosStation dbStation = new DatabaseSosStation();
dbStation.setDatabaseId("1");
DatabaseSosSensor dbSensor = new DatabaseSosSensor();
dbSensor.setDatabaseId("1");
dbSensor.setStation(dbStation);
dbSensor.setLocation(GeomHelper.createLatLngPoint(62.0, -140.0));
DatabasePhenomenon dbPhenomenon = new DatabasePhenomenon();
dbPhenomenon.setDatabaseId("9");
dbPhenomenon.setTag("air_temperature");
DateTime startDate = new DateTime(2014, 2, 1, 0, 0, DateTimeZone.UTC);
List<ObservationCollection> observationCollections = observationRetriever.getObservationCollection(dbSensor, dbPhenomenon,
new DateTime(2014, 2, 1, 0, 0, DateTimeZone.UTC));
assertNotNull(observationCollections);
assertFalse(observationCollections.isEmpty());
for (ObservationCollection observationCollection : observationCollections) {
assertEquals(dbSensor, observationCollection.getSensor());
assertEquals(dbPhenomenon, observationCollection.getPhenomenon());
for (DateTime obsDate : observationCollection.getObservationValues().keySet()) {
assertTrue("Start date (" + startDate + ") should be before obsDate (" + obsDate + ")",
startDate.isBefore(obsDate));
}
}
}
示例3: createArcticValley
import com.axiomalaska.ioos.sos.GeomHelper; //导入依赖的package包/类
private SosStation createArcticValley(SosSource source) throws UnitCreationException{
SosStation arcticValley = new SosStation();
arcticValley.setAsset(new StationAsset(STATION_AUTHORITY,"arctic_valley"));
arcticValley.setFeatureOfInterestName("At station:Arctic Valley Ridge of source: CNFAIC");
arcticValley.setLocation(GeomHelper.createLatLngPoint(61.24, -149.51));
arcticValley.setSource(source);
arcticValley.setSponsor("Alyeska Resort, Bear Tooth, Broken Tooth Brewing");
arcticValley.setSensors(getSensors(arcticValley));
arcticValley.setLongName("http://www.cnfaic.org/wx/wx_arctic.php");
arcticValley.setShortName("Arctic Valley Ridge");
arcticValley.setPlatformType("FIXED MET STATION");
HistoryEventImp deployment = new HistoryEventImp();
deployment.setName("deployment_start");
deployment.setDate(1980, 12, 12);
deployment.setDescription("When the station was first deployed");
deployment.setDocumentationUrl("http://www.cnfaic.org/wx/wx_arctic.php");
arcticValley.addHistoryEvent(deployment);
return arcticValley;
}
示例4: createFresnoRidge
import com.axiomalaska.ioos.sos.GeomHelper; //导入依赖的package包/类
private SosStation createFresnoRidge(SosSource source) throws UnitCreationException{
SosStation fresnoRidge = new SosStation();
fresnoRidge.setAsset(new StationAsset(STATION_AUTHORITY,"fresno2"));
fresnoRidge
.setFeatureOfInterestName("At station: Fresno Ridge (Near Summit Lake) of source: CNFAIC");
fresnoRidge.setLocation(GeomHelper.createLatLngPoint(60.6869, -149.5095));
fresnoRidge.setSource(source);
fresnoRidge.setSponsor("Alyeska Resort, Bear Tooth, Broken Tooth Brewing");
fresnoRidge.setSensors(getSensors(fresnoRidge));
fresnoRidge.setLongName("http://www.cnfaic.org/wx/wx_summit.php");
fresnoRidge.setShortName("Fresno Ridge (Near Summit Lake)");
fresnoRidge.setPlatformType("FIXED MET STATION");
fresnoRidge.setWmoId("wmofresno2");
return fresnoRidge;
}
示例5: createSamplingFeature
import com.axiomalaska.ioos.sos.GeomHelper; //导入依赖的package包/类
protected SamplingFeature createSamplingFeature(String featureIdentifier, double lat, double lng, double height)
throws InvalidSridException {
SamplingFeature samplingFeature = new SamplingFeature(new CodeWithAuthority(featureIdentifier));
Point point = GeomHelper.createLatLngPoint(lat, lng, height);
samplingFeature.setGeometry(point);
return samplingFeature;
}
示例6: createMarmotRidge
import com.axiomalaska.ioos.sos.GeomHelper; //导入依赖的package包/类
private SosStation createMarmotRidge(SosSource source) throws UnitCreationException{
SosStation marmot = new SosStation();
marmot.setAsset(new StationAsset(STATION_AUTHORITY,"marmot"));
marmot.setFeatureOfInterestName("At station: Marmot Ridge in Hatcher Pass of source: CNFAIC");
marmot.setLocation(GeomHelper.createLatLngPoint(61.7804, -149.2582));
marmot.setSource(source);
marmot.setSponsor("Alyeska Resort, Bear Tooth, Broken Tooth Brewing");
marmot.setSensors(getSensors(marmot));
marmot.setLongName("http://www.cnfaic.org/wx/wx_marmot.php");
marmot.setShortName("Marmot Ridge in Hatcher Pass");
marmot.setPlatformType("FIXED MET STATION");
HistoryEventImp deployment = new HistoryEventImp();
deployment.setName("deployment_start");
deployment.setDate(1980, 7, 2);
deployment.setDescription("When the station was first deployed");
deployment.setDocumentationUrl("http://www.cnfaic.org/wx/wx_marmot.php");
marmot.addHistoryEvent(deployment);
HistoryEventImp nonreponsive = new HistoryEventImp();
nonreponsive.setName("service_stopped");
nonreponsive.setDate(2000, 2, 4);
nonreponsive.setDescription("Not receiving readings");
nonreponsive.setDocumentationUrl("http://www.cnfaic.org/wx/wx_marmot.php");
marmot.addHistoryEvent(nonreponsive);
HistoryEventImp serviceFixed = new HistoryEventImp();
serviceFixed.setName("service_fixed");
serviceFixed.setDate(2000, 6, 4);
serviceFixed.setDescription("fixed station");
serviceFixed.setDocumentationUrl("http://www.cnfaic.org/wx/wx_marmot.php");
marmot.addHistoryEvent(serviceFixed);
return marmot;
}
示例7: createSunburstRidge
import com.axiomalaska.ioos.sos.GeomHelper; //导入依赖的package包/类
private SosStation createSunburstRidge(SosSource source) throws UnitCreationException{
SosStation sunburstRidge = new SosStation();
sunburstRidge.setAsset(new StationAsset(STATION_AUTHORITY,"sunburst"));
sunburstRidge
.setFeatureOfInterestName("At station: Sunburst Ridge of source: CNFAIC");
sunburstRidge.setLocation(GeomHelper.createLatLngPoint(60.7559, -149.1772));
sunburstRidge.setSource(source);
sunburstRidge.setSensors(getSensors(sunburstRidge));
sunburstRidge.setLongName("http://www.cnfaic.org/wx/wx_sunburst.php");
sunburstRidge.setShortName("Sunburst Ridge");
sunburstRidge.setPlatformType("FIXED MET STATION");
DocumentMemberImp homeWebPage = new DocumentMemberImp();
homeWebPage.setName("Home");
homeWebPage.setArcrole("urn:ogc:def:role:webPage");
homeWebPage.setDescription("The home page of the station");
homeWebPage.setFormat("text/html");
homeWebPage.setOnlineResource("http://www.cnfaic.org/wx/wx_site.php?site=sunburst");
sunburstRidge.addDocumentMember(homeWebPage);
DocumentMemberImp southwebcamPage = new DocumentMemberImp();
southwebcamPage.setName("southcam");
southwebcamPage.setArcrole("urn:ogc:def:role:webPage");
southwebcamPage.setDescription("A webcam from the station");
southwebcamPage.setFormat("text/html");
southwebcamPage.setOnlineResource("http://www.whitewinter.net/Skiinfo/webcams/Sunburstlive/over.php");
sunburstRidge.addDocumentMember(southwebcamPage);
return sunburstRidge;
}
示例8: createSensor
import com.axiomalaska.ioos.sos.GeomHelper; //导入依赖的package包/类
private static void createSensor(int i, CF.FeatureType featureType, Offering hNetworkOffering, Procedure networkProcedure,
Offering hStationOffering, Procedure stationProcedure, StationAsset station, SamplingFeature samplingFeature,
FeatureOfInterest hStationFeature, Point stationPoint, Phenomenon phen,
OmObservableProperty omObsProp, ObservableProperty obsProp, String unit, ObservationType obsType, ProcedureDescriptionFormat pdf,
Map<String,Codespace> codespaceCache, Map<String,Unit> unitCache, Session session) throws OwsExceptionReport {
String phenShortName = getPhenomenonShortId(phen.getId());
final SimpleIo airTempSimpleIo = new SimpleIo(phenShortName, phen.getId(), unit);
final SensorAsset sensor = new SensorAsset(TEST, Integer.toString(i), phenShortName);
final String sensorSml = IoosTestDataSmlGenerator.createSensorSensorMl(sensor.getAssetId(),
"Test station " + i + " " + phen.getName() + " sensor",
"Test station " + i + " " + phen.getName() + " sensor",
"Station number " + i + " " + phen.getName() + " sensor",
CollectionHelper.list(airTempSimpleIo));
//TODO switch to manually build System instead of making xml
//TODO decode xml
Object decodedXml = CodingHelper.decodeXmlObject(sensorSml);
org.n52.sos.ogc.sensorML.System sensorSystem = new org.n52.sos.ogc.sensorML.System();
sensorSystem.setIdentifier(sensor.getAssetId());
sensorSystem.setParentProcedures(CollectionHelper.list(station.getAssetId()));
final Procedure sensorProcedure = insertProcedure(sensorSystem, pdf, sensorSml, session);
Set<ObservationConstellation> obsConsts = new HashSet<ObservationConstellation>();
Set<ObservationConstellation> sensorObsConsts = new HashSet<ObservationConstellation>();
// when offering and procedure are same hiddenChild is false, otherwise true
ObservationConstellation sensorForNetworkOffering = obsConstDAO.checkOrInsertObservationConstellation(
sensorProcedure, obsProp, hNetworkOffering, true, session);
obsConsts.add(sensorForNetworkOffering);
sensorObsConsts.add(sensorForNetworkOffering);
obsConsts.add(obsConstDAO.checkOrInsertObservationConstellation(stationProcedure,
obsProp, hNetworkOffering, true, session));
obsConsts.add(obsConstDAO.checkOrInsertObservationConstellation(networkProcedure,
obsProp, hNetworkOffering, false, session));
ObservationConstellation sensorForStationOffering = obsConstDAO.checkOrInsertObservationConstellation(
sensorProcedure, obsProp, hStationOffering, true, session);
obsConsts.add(sensorForStationOffering);
sensorObsConsts.add(sensorForStationOffering);
obsConsts.add(obsConstDAO.checkOrInsertObservationConstellation(stationProcedure,
obsProp, hStationOffering, false, session));
//set measurement types on sesnor obs consts
for (ObservationConstellation obsConst : sensorObsConsts) {
obsConst.setObservationType(obsType);
session.save(obsConst);
}
//create OmObservationConstellation for OmObservations
OmObservationConstellation omObsConst = new OmObservationConstellation();
omObsConst.setProcedure(sensorSystem);
omObsConst.setObservableProperty(omObsProp);
omObsConst.setFeatureOfInterest(samplingFeature);
//add values
DateTime obsEndTime = new DateTime(DateTimeZone.UTC).withMillisOfSecond(0).withSecondOfMinute(0).withMinuteOfHour(0);
if (featureType.equals(CF.FeatureType.timeSeriesProfile)) {
for (int h = 0; h < NUM_HEIGHTS_PER_PROFILE; h++) {
Geometry foiGeom = GeomHelper.createLatLngPoint(stationPoint.getY(), stationPoint.getX(), 0 - 5.0 * h);
String foiId;
try {
foiId = IoosSosUtil.createObservationFeatureOfInterestId(station, stationPoint, sensor, stationPoint, foiGeom);
} catch (UnsupportedGeometryTypeException e) {
throw new NoApplicableCodeException().causedBy(e);
}
SamplingFeature profileFeature = new SamplingFeature(new CodeWithAuthority(foiId));
profileFeature.setGeometry(foiGeom);
FeatureOfInterest hProfileFeature = featureOfInterestDAO.checkOrInsertFeatureOfInterest(profileFeature, session);
insertObservation(sensorObsConsts, omObsConst, obsEndTime, hProfileFeature, unit, codespaceCache, unitCache, session);
}
} else {
//normal time series
insertObservation(sensorObsConsts, omObsConst, obsEndTime, hStationFeature, unit, codespaceCache, unitCache, session);
}
}
示例9: createSeattleRidge
import com.axiomalaska.ioos.sos.GeomHelper; //导入依赖的package包/类
private SosStation createSeattleRidge(SosSource source) throws UnitCreationException{
SosStation seattleRidge = new SosStation();
seattleRidge.setAsset(new StationAsset(STATION_AUTHORITY,"seattle"));
seattleRidge
.setFeatureOfInterestName("At station: Seattle Ridge of source: CNFAIC");
seattleRidge.setLocation(GeomHelper.createLatLngPoint(60.8338, -149.1593));
seattleRidge.setSource(source);
seattleRidge.setSensors(getSensors(seattleRidge));
seattleRidge.setSponsor("Alyeska Resort, Bear Tooth, Broken Tooth Brewing");
seattleRidge.setLongName("http://www.cnfaic.org/wx/wx_seattle.php");
seattleRidge.setShortName("Seattle Ridge");
seattleRidge.setPlatformType("FIXED MET STATION");
seattleRidge.setWmoId("wmo1977");
HistoryEventImp deployment = new HistoryEventImp();
deployment.setName("deployment_start");
deployment.setDate(1980, 7, 2);
deployment.setDescription("When the station was first deployed");
deployment.setDocumentationUrl("http://www.cnfaic.org/wx/wx_site.php?site=seattle");
seattleRidge.addHistoryEvent(deployment);
HistoryEventImp nonreponsive = new HistoryEventImp();
nonreponsive.setName("service_stopped");
nonreponsive.setDate(2000, 2, 4);
nonreponsive.setDescription("Not receiving readings");
nonreponsive.setDocumentationUrl("http://www.cnfaic.org/wx/wx_site.php?site=seattle");
seattleRidge.addHistoryEvent(nonreponsive);
HistoryEventImp serviceFixed = new HistoryEventImp();
serviceFixed.setName("service_fixed");
serviceFixed.setDate(2000, 6, 4);
serviceFixed.setDescription("fixed station");
serviceFixed.setDocumentationUrl("http://www.cnfaic.org/wx/wx_site.php?site=seattle");
seattleRidge.addHistoryEvent(serviceFixed);
DocumentMemberImp homeWebPage = new DocumentMemberImp();
homeWebPage.setName("Home");
homeWebPage.setArcrole("urn:ogc:def:role:webPage");
homeWebPage.setDescription("The home page of the station");
homeWebPage.setFormat("text/html");
homeWebPage.setOnlineResource("http://www.cnfaic.org/wx/wx_site.php?site=seattle");
seattleRidge.addDocumentMember(homeWebPage);
DocumentMemberImp southwebcamPage = new DocumentMemberImp();
southwebcamPage.setName("southcam");
southwebcamPage.setArcrole("urn:ogc:def:role:webPage");
southwebcamPage.setDescription("A south facing webcam from the station");
southwebcamPage.setFormat("text/html");
southwebcamPage.setOnlineResource("http://www.cnfaic.org/wx/camraw/seattle_one.jpg");
seattleRidge.addDocumentMember(southwebcamPage);
DocumentMemberImp westWebcamPage = new DocumentMemberImp();
westWebcamPage.setName("westcam");
westWebcamPage.setArcrole("urn:ogc:def:role:webPage");
westWebcamPage.setDescription("A west facing webcam from the station");
westWebcamPage.setFormat("text/html");
westWebcamPage.setOnlineResource("http://www.cnfaic.org/wx/camraw/seattle_two.jpg");
seattleRidge.addDocumentMember(westWebcamPage);
return seattleRidge;
}