This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from EHJ-52n/develop
Merge with latest developments from EHJ-52n
- Loading branch information
Showing
9 changed files
with
1,044 additions
and
884 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
52n-sos-importer-core/src/main/resources/org/n52/sos/importer/view/position/wms.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#Thu Aug 04 23:13:17 CEST 2011 | ||
wms_url=http\://osmtud.dyndns.org/wms/wms/ | ||
wms_layer=OSMBackground | ||
#wms_url=http\://osmtud.dyndns.org/wms/wms/ | ||
#wms_layer=OSMBackground | ||
wms_url=http\://129.206.228.72/cached/osm | ||
wms_layer=OSM WMS - osm-wms.de |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,495 changes: 751 additions & 744 deletions
1,495
...s-importer-feeder/src/main/java/org/n52/sos/importer/feeder/SensorObservationService.java
Large diffs are not rendered by default.
Oops, something went wrong.
279 changes: 148 additions & 131 deletions
279
52n-sos-importer-feeder/src/main/java/org/n52/sos/importer/feeder/model/Timestamp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,131 +1,148 @@ | ||
/** | ||
* Copyright (C) 2012 | ||
* by 52North Initiative for Geospatial Open Source Software GmbH | ||
* | ||
* Contact: Andreas Wytzisk | ||
* 52 North Initiative for Geospatial Open Source Software GmbH | ||
* Martin-Luther-King-Weg 24 | ||
* 48155 Muenster, Germany | ||
* info@52north.org | ||
* | ||
* This program is free software; you can redistribute and/or modify it under | ||
* the terms of the GNU General Public License version 2 as published by the | ||
* Free Software Foundation. | ||
* | ||
* This program is distributed WITHOUT ANY WARRANTY; even without the implied | ||
* WARRANTY OF MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program (see gnu-gpl v2.txt). If not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA or | ||
* visit the Free Software Foundation web page, http://www.fsf.org. | ||
*/ | ||
package org.n52.sos.importer.feeder.model; | ||
|
||
/** | ||
* @author <a href="mailto:e.h.juerrens@52north.org">Eike Hinderk Jürrens</a> | ||
*/ | ||
public class Timestamp { | ||
|
||
private short year = Short.MIN_VALUE; | ||
private byte month = Byte.MIN_VALUE; | ||
private byte day = Byte.MIN_VALUE; | ||
private byte hour = Byte.MIN_VALUE; | ||
private byte minute = Byte.MIN_VALUE; | ||
private byte seconds = Byte.MIN_VALUE; | ||
private byte timezone = Byte.MIN_VALUE; | ||
|
||
|
||
|
||
@Override | ||
public String toString() { | ||
StringBuffer ts = new StringBuffer(25); // <- yyyy-mm-ddThh:mm:ss+hh:mm | ||
if (year != Short.MIN_VALUE) { | ||
ts.append(year); | ||
if (month != Byte.MIN_VALUE) { | ||
ts.append("-"); | ||
} | ||
} | ||
if (month != Byte.MIN_VALUE) { | ||
ts.append(month<10?"0"+month:month); | ||
if (day != Byte.MIN_VALUE) { | ||
ts.append("-"); | ||
} | ||
} | ||
if (day != Byte.MIN_VALUE) { | ||
ts.append(day<10?"0"+day:day); | ||
} | ||
if ( (year != Short.MIN_VALUE || month != Byte.MIN_VALUE || day != Byte.MIN_VALUE ) | ||
&& (hour != Byte.MIN_VALUE || minute != Byte.MIN_VALUE || seconds != Byte.MIN_VALUE)) { | ||
ts.append("T"); | ||
} | ||
if (hour != Byte.MIN_VALUE) { | ||
ts.append(hour<10?"0"+hour:hour); | ||
if (minute != Byte.MIN_VALUE) { | ||
ts.append(":"); | ||
} | ||
} | ||
if (minute != Byte.MIN_VALUE) { | ||
ts.append( (minute<10?"0"+minute:minute)+":"); | ||
} else if (hour != Byte.MIN_VALUE) { | ||
ts.append("00:"); | ||
} | ||
if (seconds != Byte.MIN_VALUE ) { | ||
ts.append(seconds<10?"0"+seconds:seconds); | ||
} else if (minute != Byte.MIN_VALUE && hour != Byte.MIN_VALUE) { | ||
ts.append("00"); | ||
} | ||
if (timezone != Byte.MIN_VALUE && | ||
(hour != Byte.MIN_VALUE || minute != Byte.MIN_VALUE || seconds != Byte.MIN_VALUE)) { | ||
ts.append(convertTimeZone(timezone)); | ||
} | ||
|
||
return ts.toString(); | ||
} | ||
|
||
private String convertTimeZone(int timeZone) { | ||
if (timeZone >= 0) { | ||
if (timeZone >= 10) { | ||
return "+" + timeZone + ":00"; | ||
} else { | ||
return "+0" + timeZone + ":00"; | ||
} | ||
} else { | ||
if (timeZone <= -10) { | ||
return timeZone + ":00"; | ||
} else { | ||
return "-0" + Math.abs(timeZone) + ":00"; | ||
} | ||
} | ||
} | ||
|
||
public void setYear(short year) { | ||
this.year = year; | ||
} | ||
|
||
public void setMonth(byte month) { | ||
this.month = month; | ||
} | ||
|
||
public void setDay(byte day) { | ||
this.day = day; | ||
} | ||
|
||
public void setHour(byte hour) { | ||
this.hour = hour; | ||
} | ||
|
||
public void setMinute(byte minute) { | ||
this.minute = minute; | ||
} | ||
|
||
public void setSeconds(byte seconds) { | ||
this.seconds = seconds; | ||
} | ||
|
||
public void setTimezone(byte timezone) { | ||
this.timezone = timezone; | ||
} | ||
|
||
} | ||
/** | ||
* Copyright (C) 2012 | ||
* by 52North Initiative for Geospatial Open Source Software GmbH | ||
* | ||
* Contact: Andreas Wytzisk | ||
* 52 North Initiative for Geospatial Open Source Software GmbH | ||
* Martin-Luther-King-Weg 24 | ||
* 48155 Muenster, Germany | ||
* info@52north.org | ||
* | ||
* This program is free software; you can redistribute and/or modify it under | ||
* the terms of the GNU General Public License version 2 as published by the | ||
* Free Software Foundation. | ||
* | ||
* This program is distributed WITHOUT ANY WARRANTY; even without the implied | ||
* WARRANTY OF MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program (see gnu-gpl v2.txt). If not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA or | ||
* visit the Free Software Foundation web page, http://www.fsf.org. | ||
*/ | ||
package org.n52.sos.importer.feeder.model; | ||
|
||
import java.util.Calendar; | ||
import java.util.GregorianCalendar; | ||
|
||
/** | ||
* @author <a href="mailto:e.h.juerrens@52north.org">Eike Hinderk Jürrens</a> | ||
*/ | ||
public class Timestamp { | ||
|
||
private short year = Short.MIN_VALUE; | ||
private byte month = Byte.MIN_VALUE; | ||
private byte day = Byte.MIN_VALUE; | ||
private byte hour = Byte.MIN_VALUE; | ||
private byte minute = Byte.MIN_VALUE; | ||
private byte seconds = Byte.MIN_VALUE; | ||
private byte timezone = Byte.MIN_VALUE; | ||
|
||
|
||
|
||
@Override | ||
public String toString() { | ||
final StringBuffer ts = new StringBuffer(25); // <- yyyy-mm-ddThh:mm:ss+hh:mm | ||
if (year != Short.MIN_VALUE) { | ||
ts.append(year); | ||
if (month != Byte.MIN_VALUE) { | ||
ts.append("-"); | ||
} | ||
} | ||
if (month != Byte.MIN_VALUE) { | ||
ts.append(month<10?"0"+month:month); | ||
if (day != Byte.MIN_VALUE) { | ||
ts.append("-"); | ||
} | ||
} | ||
if (day != Byte.MIN_VALUE) { | ||
ts.append(day<10?"0"+day:day); | ||
} | ||
if ( (year != Short.MIN_VALUE || month != Byte.MIN_VALUE || day != Byte.MIN_VALUE ) | ||
&& (hour != Byte.MIN_VALUE || minute != Byte.MIN_VALUE || seconds != Byte.MIN_VALUE)) { | ||
ts.append("T"); | ||
} | ||
if (hour != Byte.MIN_VALUE) { | ||
ts.append(hour<10?"0"+hour:hour); | ||
if (minute != Byte.MIN_VALUE) { | ||
ts.append(":"); | ||
} | ||
} | ||
if (minute != Byte.MIN_VALUE) { | ||
ts.append( (minute<10?"0"+minute:minute)+":"); | ||
} else if (hour != Byte.MIN_VALUE) { | ||
ts.append("00:"); | ||
} | ||
if (seconds != Byte.MIN_VALUE ) { | ||
ts.append(seconds<10?"0"+seconds:seconds); | ||
} else if (minute != Byte.MIN_VALUE && hour != Byte.MIN_VALUE) { | ||
ts.append("00"); | ||
} | ||
if (timezone != Byte.MIN_VALUE && | ||
(hour != Byte.MIN_VALUE || minute != Byte.MIN_VALUE || seconds != Byte.MIN_VALUE)) { | ||
ts.append(convertTimeZone(timezone)); | ||
} | ||
|
||
return ts.toString(); | ||
} | ||
|
||
private String convertTimeZone(final int timeZone) { | ||
if (timeZone >= 0) { | ||
if (timeZone >= 10) { | ||
return "+" + timeZone + ":00"; | ||
} else { | ||
return "+0" + timeZone + ":00"; | ||
} | ||
} else { | ||
if (timeZone <= -10) { | ||
return timeZone + ":00"; | ||
} else { | ||
return "-0" + Math.abs(timeZone) + ":00"; | ||
} | ||
} | ||
} | ||
|
||
public void setYear(final short year) { | ||
this.year = year; | ||
} | ||
|
||
public void setMonth(final byte month) { | ||
this.month = month; | ||
} | ||
|
||
public void setDay(final byte day) { | ||
this.day = day; | ||
} | ||
|
||
public void setHour(final byte hour) { | ||
this.hour = hour; | ||
} | ||
|
||
public void setMinute(final byte minute) { | ||
this.minute = minute; | ||
} | ||
|
||
public void setSeconds(final byte seconds) { | ||
this.seconds = seconds; | ||
} | ||
|
||
public void setTimezone(final byte timezone) { | ||
this.timezone = timezone; | ||
} | ||
|
||
public Timestamp set(final long dateToSet) | ||
{ | ||
final Calendar cal = new GregorianCalendar(); | ||
cal.setTimeInMillis(dateToSet); | ||
year = (short) cal.get(Calendar.YEAR); | ||
month = (byte) (cal.get(Calendar.MONTH)+1); | ||
day = (byte) cal.get(Calendar.DAY_OF_MONTH); | ||
hour = (byte) cal.get(Calendar.HOUR_OF_DAY); | ||
minute = (byte) cal.get(Calendar.MINUTE); | ||
seconds = (byte) cal.get(Calendar.SECOND); | ||
timezone = (byte) (cal.getTimeZone().getOffset(dateToSet)/3600000); | ||
return this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.