org.locationtech.jts.io.ParseException Java Examples

The following examples show how to use org.locationtech.jts.io.ParseException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FK2UserGroupSetAdapter.java    From geofence with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Set<UserGroup> unmarshal(GroupList inSet) throws ParseException {
    if(inSet == null)
        return null;

    Set<UserGroup> ret = new HashSet<UserGroup>();
    for (IdNameBundle in : inSet) {
        System.out.println("Unmarshalling group " + in);

        UserGroup ug = new UserGroup();
        ug.setId(in.getId());
        ug.setName(in.getName());
        ret.add(ug);
    }

    System.out.println("Unmarshalled user has " + ret.size() + " groups");
    return ret;
}
 
Example #2
Source File: FunctionAsWKT.java    From GeoTriples with Apache License 2.0 6 votes vote down vote up
@Override
public Object execute(Object argument, QLTerm qlterm)
		throws SAXException, IOException, ParserConfigurationException, FactoryException,
		MalformedGeometryException, ParseException {
	if (qlterm.equals(QLTerm.ROW_CLASS)){
		Object geom = argument;
		if (geom instanceof  String) {
			return "<http://www.opengis.net/def/crs/EPSG/0/" + Config.EPSG_CODE + "> " + geom;
		}
		else if (geom instanceof  Geometry){
			WKTWriter wkt = new WKTWriter();
			return "<http://www.opengis.net/def/crs/EPSG/0/" + Config.EPSG_CODE + "> " +  (wkt.write((Geometry) geom));
		}
	}
	else if (qlterm.equals(QLTerm.SHP_CLASS) && argument instanceof org.gdal.ogr.Geometry) {
		org.gdal.ogr.Geometry gdalgeom=(org.gdal.ogr.Geometry )argument;

		return "<http://www.opengis.net/def/crs/EPSG/0/" + Config.EPSG_CODE + "> " + gdalgeom.ExportToWkt();
	}

	Geometry geometry = computeGeometry(argument, qlterm);
	return GTransormationFunctions.asWKT((Geometry) geometry, CRS.decode("EPSG:" + Config.EPSG_CODE));
}
 
Example #3
Source File: ShapeConverter.java    From snap-desktop with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Object parse(String text) throws ConversionException {
    try {
        Geometry geometry = new WKTReader(geometryFactory).read(text);
        if (geometry instanceof LineString) {
            LineString lineString = (LineString) geometry;
            // todo
            return null;
        } else if (geometry instanceof Polygon) {
            Polygon polygon = (Polygon) geometry;
            // todo
            return null;
        } else {
            throw new ConversionException("Failed to parse shape geometry WKT.");
        }
    } catch (ParseException e) {
        throw new ConversionException("Failed to parse shape geometry WKT.", e);
    }
}
 
Example #4
Source File: FK2UserGroupSetAdapter2.java    From geofence with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ArrayList<Long> marshal(Set<UserGroup> inSet) throws ParseException {
    if(inSet == null)
        return null;

    System.out.println("Marshalling " + inSet.size() + " groups");

    ArrayList<Long> ret = new ArrayList<Long>(inSet.size());
    for (UserGroup ug : inSet) {
        if (ug != null) {
            ret.add(ug.getId());
            System.out.println("Added group " + ug.getId());
        }
    }

    return ret;
}
 
Example #5
Source File: GeoUtils.java    From elasticsearch-plugin-geoshape with MIT License 6 votes vote down vote up
public static String exportWkbTo(BytesRef wkb, InternalGeoShape.OutputFormat output_format, GeoJsonWriter geoJsonWriter)
        throws ParseException {
    switch (output_format) {
        case WKT:
            Geometry geom = new WKBReader().read(wkb.bytes);
            return new WKTWriter().write(geom);
        case WKB:
            return WKBWriter.toHex(wkb.bytes);
        default:
            Geometry geo = new WKBReader().read(wkb.bytes);
            return geoJsonWriter.write(geo);
    }
}
 
Example #6
Source File: FunctionTouches.java    From GeoTriples with Apache License 2.0 6 votes vote down vote up
@Override
public List<? extends Object> execute(List<? extends Object> arguments, List<? extends QLTerm> qlterms)
		throws SAXException, IOException, ParserConfigurationException, FactoryException,
		MalformedGeometryException, ParseException {
	List<String> valueList = new ArrayList<>();
	log.debug("Executing FunctionTouches...");

	Geometry geometry1 = computeGeometry(arguments.get(0), qlterms.get(0));
	Geometry geometry2 = computeGeometry(arguments.get(1), qlterms.get(1));
	if (log.isTraceEnabled()) {
		log.trace("FunctionTouches: geometry0: " + geometry1);
		log.trace("FunctionTouches: geometry0: " + geometry2);
	}
	String result = GTransormationFunctions.touches(geometry1, geometry2);
	log.trace("FunctionTouches: Result: " + result);
	valueList.add(result);
	return valueList;
}
 
Example #7
Source File: ExplicitSpatialQuery.java    From geowave with Apache License 2.0 6 votes vote down vote up
@Override
public void fromBinary(final byte[] bytes) {
  final ByteBuffer buf = ByteBuffer.wrap(bytes);
  compareOp = CompareOperation.values()[VarintUtils.readUnsignedInt(buf)];
  nonSpatialCompareOp = BasicQueryCompareOperation.values()[VarintUtils.readUnsignedInt(buf)];

  final int crsBinaryLength = VarintUtils.readUnsignedInt(buf);
  final int superBinaryLength = VarintUtils.readUnsignedInt(buf);
  final byte[] crsBinary = ByteArrayUtils.safeRead(buf, crsBinaryLength);
  crsCode = crsBinary.length > 0 ? StringUtils.stringFromBinary(crsBinary) : null;
  final byte[] superBinary = ByteArrayUtils.safeRead(buf, superBinaryLength);
  super.fromBinary(superBinary);
  try {
    queryGeometry = new TWKBReader().read(buf);
  } catch (final ParseException e) {
    LOGGER.warn("Unable to read query geometry as well-known binary", e);
  }
}
 
Example #8
Source File: InsertObservationRequestEncoderTest.java    From arctic-sea with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldEncodeInsertObservationRequest() throws EncodingException, InvalidSridException, ParseException, DecodingException {
    InsertObservationRequest request = createInsertObservationRequest();

    XmlObject encodedRequest = encoder.create(request);

    XmlHelper.validateDocument(encodedRequest);
    assertThat(encodedRequest, Matchers.notNullValue());
    assertThat(encodedRequest, Matchers.instanceOf(InsertObservationDocument.class));
    InsertObservationType insertObservation = ((InsertObservationDocument) encodedRequest).getInsertObservation();
    assertThat(insertObservation.getOfferingArray(), Matchers.notNullValue());
    assertThat(insertObservation.getOfferingArray().length, Is.is(1));
    assertThat(insertObservation.getOfferingArray(0), Is.is(OFFERING_ID));
    assertThat(insertObservation.getObservationArray(), Matchers.notNullValue());
    assertThat(insertObservation.getObservationArray().length, Is.is(1));
    // no check for observation values, because that MUST be part of OmEncoderv20Test
}
 
Example #9
Source File: SpatialiteWKBReader.java    From hortonmachine with GNU General Public License v3.0 5 votes vote down vote up
private GeometryCollection readGeometryCollection() throws IOException, ParseException {
    int numGeom = dis.readInt();
    Geometry[] geoms = new Geometry[numGeom];
    for( int i = 0; i < numGeom; i++ ) {
        geoms[i] = readGeometry();
    }
    return factory.createGeometryCollection(geoms);
}
 
Example #10
Source File: FK2UserGroupSetAdapter2.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Set<UserGroup> unmarshal(ArrayList<Long> inSet) throws ParseException {
    if(inSet == null)
        return null;

    Set<UserGroup> ret = new HashSet<UserGroup>();
    for (Long in : inSet) {
        UserGroup ug = new UserGroup();
        ug.setId(in);
        ret.add(ug);
    }

    return ret;
}
 
Example #11
Source File: GeometryAdapter.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public G unmarshal(String val) throws ParseException {
    WKTReader wktReader = new WKTReader();

    Geometry the_geom = wktReader.read(val);
    if (the_geom.getSRID() == 0)
        the_geom.setSRID(4326);

    try {
        return (G) the_geom;
    } catch (ClassCastException e) {
        throw new ParseException("WKT val is a " + the_geom.getClass().getName());
    }
}
 
Example #12
Source File: FunctionDisjoint.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
@Override
public List<? extends Object> execute(
		List<? extends Object> arguments,List<? extends QLTerm> qlterms) throws SAXException, IOException, ParserConfigurationException, FactoryException, MalformedGeometryException, ParseException {
	List<String> valueList = new ArrayList<>();
	
	Geometry geometry1 = computeGeometry(arguments.get(0), qlterms.get(0));
	Geometry geometry2 = computeGeometry(arguments.get(1), qlterms.get(1));
	valueList.add(GTransormationFunctions.disjoint(geometry1, geometry2));
	return valueList;
}
 
Example #13
Source File: RuleReaderServiceImplTest.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
protected MultiPolygon buildMultiPolygon(String multip) {
    try {
        WKTReader reader = new WKTReader();
        MultiPolygon mp = (MultiPolygon) reader.read(multip);
        mp.setSRID(4326);
        return mp;
    } catch (ParseException ex) {
        throw new RuntimeException("Unexpected exception: " + ex.getMessage(), ex);
    }
}
 
Example #14
Source File: AbstractFunction.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
protected Geometry computeGeometry(Object object, QLTerm term) throws SAXException, IOException,
		ParserConfigurationException, NoSuchAuthorityCodeException, FactoryException, MalformedGeometryException, ParseException {

	if (!term.equals(QLTerm.SHP_CLASS) && cache.containsKey(object)) {
		return cache.get(object);
	}
	switch (term) {
	case SHP_CLASS:
		return (Geometry) object;
	case ROW_CLASS:
		Geometry result = computeGeometry((String) object, term);
		return result;
	case XPATH_CLASS:
		Geometry result1 = computeGeometry((String) object, term);
		cache.put(object, result1);
		return result1;
	case CSV_CLASS:
		Geometry result2 = computeGeometry((String) object, term);
		cache.put(object, result2);
		return result2;
	case JSONPATH_CLASS:
		Geometry result3 = computeGeometry((String) object, term);
		cache.put(object, result3);
		return result3;
	default:
		throw new MalformedGeometryException("GeoTriples cannot recognize this type of geometry");
	}

}
 
Example #15
Source File: PolygonAdapter.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
@Override
public String marshal(Polygon the_geom) throws ParseException {
    if (the_geom != null) {
        WKTWriter wktWriter = new WKTWriter();
        if (the_geom.getSRID() == 0)
            the_geom.setSRID(4326);

        return wktWriter.write(the_geom);
    } else {
        throw new ParseException("Polygon obj is null.");
    }
}
 
Example #16
Source File: TWKBReader.java    From geowave with Apache License 2.0 5 votes vote down vote up
public Geometry read(final ByteBuffer input) throws ParseException {
  try {
    final byte typeAndPrecision = input.get();
    final byte type = (byte) (typeAndPrecision & 0x0F);
    final int basePrecision = TWKBUtils.zigZagDecode((typeAndPrecision & 0xF0) >> 4);
    final byte metadata = input.get();
    PrecisionReader precision;
    if ((metadata & TWKBUtils.EXTENDED_DIMENSIONS) != 0) {
      final byte extendedDimensions = input.get();
      precision = new ExtendedPrecisionReader(basePrecision, extendedDimensions);
    } else {
      precision = new PrecisionReader(basePrecision);
    }
    switch (type) {
      case TWKBUtils.POINT_TYPE:
        return readPoint(precision, metadata, input);
      case TWKBUtils.LINESTRING_TYPE:
        return readLineString(precision, metadata, input);
      case TWKBUtils.POLYGON_TYPE:
        return readPolygon(precision, metadata, input);
      case TWKBUtils.MULTIPOINT_TYPE:
        return readMultiPoint(precision, metadata, input);
      case TWKBUtils.MULTILINESTRING_TYPE:
        return readMultiLineString(precision, metadata, input);
      case TWKBUtils.MULTIPOLYGON_TYPE:
        return readMultiPolygon(precision, metadata, input);
      case TWKBUtils.GEOMETRYCOLLECTION_TYPE:
        return readGeometryCollection(input, metadata);
    }
    return null;
  } catch (final IOException e) {
    throw new ParseException("Error reading TWKB geometry.", e);
  }
}
 
Example #17
Source File: FunctionIs3D.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
@Override
public Object execute(Object argument, QLTerm qlterm) throws SAXException, IOException, ParserConfigurationException, FactoryException, MalformedGeometryException, ParseException {

	if(qlterm.equals(QLTerm.SHP_CLASS) && argument instanceof org.gdal.ogr.Geometry ){
		org.gdal.ogr.Geometry gdalgeom=(org.gdal.ogr.Geometry )argument;

		 return (String.valueOf(gdalgeom.GetCoordinateDimension()==3));
	}

	Geometry geometry = computeGeometry(argument, qlterm);
	return GTransormationFunctions.is3D((Geometry) geometry);
}
 
Example #18
Source File: TestGeometrySerialization.java    From presto with Apache License 2.0 5 votes vote down vote up
private static Geometry createJtsGeometry(String wkt)
{
    try {
        return new WKTReader().read(wkt);
    }
    catch (ParseException e) {
        throw new RuntimeException(e);
    }
}
 
Example #19
Source File: FK2UserAdapter.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
@Override
public GSUser unmarshal(IdNameBundle in) throws ParseException {

        GSUser ret = new GSUser();
        ret.setId(in.getId());
        ret.setName(in.getName());
        return ret;
}
 
Example #20
Source File: GeometryUtility.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the wkt from multi polygon.
 *
 * @param multiPoly
 *            the multi poly
 * @return the string
 * @throws ParseException
 *             the parse exception
 */
public String createWKTFromMultiPolygon(MultiPolygon multiPoly) throws ParseException
{
    if (multiPoly.getSRID() == 0)
    {
        multiPoly.setSRID(4326);
    }

    return this.multiPolAdapter.marshal(multiPoly);
}
 
Example #21
Source File: FunctionLength.java    From GeoTriples with Apache License 2.0 5 votes vote down vote up
@Override
public List<? extends Object> execute(
		List<? extends Object> arguments,List<? extends QLTerm> qlterms) throws SAXException, IOException, ParserConfigurationException, FactoryException, MalformedGeometryException, ParseException {
	List<String> valueList = new ArrayList<>();
	
	Geometry geometry = computeGeometry(arguments.get(0), qlterms.get(0));
	valueList.add(GTransormationFunctions.length(
			(Geometry) geometry));
	return valueList;
}
 
Example #22
Source File: SpatialiteWKBReader.java    From hortonmachine with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Reads a single {@link Geometry} in WKB format from a byte array.
 *
 * @param bytes the byte array to read from
 * @return the geometry read
 * @throws ParseException if the WKB is ill-formed
 */
public Geometry read( byte[] bytes ) throws ParseException {
    // possibly reuse the ByteArrayInStream?
    // don't throw IOExceptions, since we are not doing any I/O
    try {
        return read(new ByteArrayInStream(bytes));
    } catch (IOException ex) {
        throw new RuntimeException("Unexpected IOException caught: " + ex.getMessage());
    }
}
 
Example #23
Source File: H2IndexingAbstractGeoSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * Check distributed query.
 *
 * @throws ParseException If failed.
 */
private void checkDistributedQuery() throws ParseException {
    IgniteCache<Integer, Enemy> c1 = grid(0).cache("enemy");
    IgniteCache<Integer, EnemyCamp> c2 = grid(0).cache("camp");

    final Geometry lethalArea = new WKTReader().read("POLYGON((30 30, 30 70, 70 70, 70 30, 30 30))");

    int expectedEnemies = 0;

    for (Cache.Entry<Integer, Enemy> e : c1) {
        final Integer campID = e.getValue().campId;

        if (30 <= campID && campID < ENEMYCAMP_SAMPLES_COUNT) {
            final EnemyCamp camp = c2.get(campID);

            if (lethalArea.covers(camp.coords))
                expectedEnemies++;
        }
    }

    final SqlFieldsQuery query = new SqlFieldsQuery("select e._val, c._val from \"enemy\".Enemy e, " +
        "\"camp\".EnemyCamp c where e.campId = c._key and c.coords && ?").setArgs(lethalArea);

    List<List<?>> result = c1.query(query.setDistributedJoins(true)).getAll();

    assertEquals(expectedEnemies, result.size());
}
 
Example #24
Source File: FK2UserAdapter.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
@Override
public IdNameBundle marshal(GSUser u) throws ParseException {
    IdNameBundle in = new IdNameBundle();
    if (u != null) {
        in.setId(u.getId());
        in.setName(u.getName());
    }
    return in;
}
 
Example #25
Source File: JtsAdapterIssue27Test.java    From mapbox-vector-tile-java with Apache License 2.0 5 votes vote down vote up
public static void testLineStringMisssingEndSegments() throws IOException, ParseException {
    final File wktFile = new File("src/test/resources/wkt/github_issue_27_01_multilinestring.wkt");
    final File outputFile = new File("linestring.mvt");
    final GeometryFactory gf = new GeometryFactory();
    final WKTReader reader = new WKTReader(gf);
    final MvtLayerParams mvtLayerParams = MvtLayerParams.DEFAULT;

    try(FileReader fileReader = new FileReader(wktFile)) {
        final Geometry wktGeom = reader.read(fileReader);
        final Envelope env = new Envelope(545014.05D, 545043.15D, 6867178.74D, 6867219.47D);
        final TileGeomResult tileGeom = JtsAdapter.createTileGeom(wktGeom, env, gf, mvtLayerParams, g -> true);

        final MvtLayerProps mvtLayerProps = new MvtLayerProps();
        final VectorTile.Tile.Builder tileBuilder = VectorTile.Tile.newBuilder();
        final VectorTile.Tile.Layer.Builder layerBuilder = MvtLayerBuild.newLayerBuilder("myLayerName", mvtLayerParams);
        final List<VectorTile.Tile.Feature> features = JtsAdapter.toFeatures(tileGeom.mvtGeoms, mvtLayerProps, new UserDataIgnoreConverter());
        layerBuilder.addAllFeatures(features);
        MvtLayerBuild.writeProps(layerBuilder, mvtLayerProps);
        tileBuilder.addLayers(layerBuilder);

        final VectorTile.Tile mvt = tileBuilder.build();
        try {
            Files.write(outputFile.toPath(), mvt.toByteArray());
        } catch (IOException e) {
            LoggerFactory.getLogger(JtsAdapterIssue27Test.class).error(e.getMessage(), e);
        }

        // Examine geometry output, will be a bit screwed but observe line segments are present
        final JtsMvt jtsMvt = MvtReader.loadMvt(outputFile, gf, new TagIgnoreConverter());
    }
}
 
Example #26
Source File: RESTRuleServiceImpl.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
protected LayerDetails detailsFromInput(RESTInputRule in) {
    RESTLayerConstraints constraints = in.getConstraints();
    if (constraints != null) {
        LayerDetails details = new LayerDetails();

        if (constraints.getAllowedStyles() != null) {
            details.setAllowedStyles(new HashSet(constraints.getAllowedStyles()));
        }
        if (constraints.getAttributes() != null) {
            details.setAttributes(new HashSet(constraints.getAttributes()));
        }
        details.setCqlFilterRead(constraints.getCqlFilterRead());
        details.setCqlFilterWrite(constraints.getCqlFilterWrite());
        details.setDefaultStyle(constraints.getDefaultStyle());
        if (constraints.getRestrictedAreaWkt() != null) {
            WKTReader reader = new WKTReader();
            Geometry g;
            try {
                g = reader.read(constraints.getRestrictedAreaWkt());
            } catch (ParseException ex) {
                throw new BadRequestRestEx("Error parsing WKT:" + ex.getMessage());
            }
            details.setArea((MultiPolygon) g);
        }

        details.setType(constraints.getType());

        return details;
    } else {
        return null;
    }
}
 
Example #27
Source File: InsertObservationRequestEncoderTest.java    From arctic-sea with Apache License 2.0 5 votes vote down vote up
private InsertObservationRequest createInsertObservationRequest() throws InvalidSridException, ParseException {
    SamplingFeature samplingFeature =
            new SamplingFeature(new CodeWithAuthority("test-feature-uri"));
    samplingFeature.setName(new CodeType("test-feature-name"));
    samplingFeature.setSampledFeatures(Arrays.asList(new SamplingFeature(
            new CodeWithAuthority("test-parent-feature-uri"))));
    samplingFeature.setGeometry(JTSHelper.createGeometryFromWKT("POINT(52.0 42.0)", 4326));

    PhysicalSystem procedure = new PhysicalSystem();
    procedure.setIdentifier("test-procedure");

    OmObservationConstellation observationConstellation = new OmObservationConstellation();
    observationConstellation.setGmlId("o1");
    observationConstellation.setObservationType(OmConstants.OBS_TYPE_MEASUREMENT);
    observationConstellation.setObservableProperty(new OmObservableProperty("test-property"));
    observationConstellation.setFeatureOfInterest(samplingFeature);
    observationConstellation.setProcedure(procedure);

    TimeInstant time = new TimeInstant(new Date(0));
    QuantityValue quantity = new QuantityValue(23.0, "test-uom");

    ObservationValue<?> value = new SingleObservationValue<>(time, quantity);

    OmObservation omObservation = new OmObservation();
    omObservation.setObservationConstellation(observationConstellation);
    omObservation.setResultTime(time);
    omObservation.setValue(value);

    InsertObservationRequest request = new InsertObservationRequest("SOS", "2.0.0");
    request.setOfferings(Arrays.asList(OFFERING_ID));
    request.addObservation(omObservation);
    return request;
}
 
Example #28
Source File: RasterFootprintStatistics.java    From geowave with Apache License 2.0 5 votes vote down vote up
@Override
public void fromBinary(final byte[] bytes) {
  final ByteBuffer buf = super.binaryBuffer(bytes);
  final byte[] payload = buf.array();
  if (payload.length > 0) {
    try {
      footprint = new TWKBReader().read(payload);
    } catch (final ParseException e) {
      LOGGER.warn("Unable to parse WKB", e);
    }
  } else {
    footprint = null;
  }
}
 
Example #29
Source File: TrajectoryObservationTypeEncoderTest.java    From arctic-sea with Apache License 2.0 5 votes vote down vote up
private OmObservation getCategoricalObservation() throws EncodingException, ParseException, DecodingException, XmlException, IOException {
    MultiObservationValues<List<TimeLocationValueTriple>> multiObservationValues = new MultiObservationValues<List<TimeLocationValueTriple>>();
    TLVTValue tlvtValue = new TLVTValue();
    tlvtValue.addValue(getTimeLocationValueTriple(new CategoryValue("test_1", "test_voc")));
    tlvtValue.addValue(getTimeLocationValueTriple(new CategoryValue("test_1", "test_voc")));
    tlvtValue.addValue(getTimeLocationValueTriple(new CategoryValue("test_3", "test_voc")));
    tlvtValue.addValue(getTimeLocationValueTriple(new CategoryValue("test_4", "test_voc")));
    multiObservationValues.setValue(tlvtValue);
    OmObservation observation = createObservation();
    observation.setValue(multiObservationValues);
    return observation;
}
 
Example #30
Source File: TrajectoryObservationTypeEncoderTest.java    From arctic-sea with Apache License 2.0 5 votes vote down vote up
private OmObservation getCountObservation() throws EncodingException, ParseException, DecodingException, XmlException, IOException {
    MultiObservationValues<List<TimeLocationValueTriple>> multiObservationValues = new MultiObservationValues<List<TimeLocationValueTriple>>();
    TLVTValue tlvtValue = new TLVTValue();
    tlvtValue.addValue(getTimeLocationValueTriple(new CountValue(15)));
    tlvtValue.addValue(getTimeLocationValueTriple(new CountValue(16)));
    tlvtValue.addValue(getTimeLocationValueTriple(new CountValue(17)));
    tlvtValue.addValue(getTimeLocationValueTriple(new CountValue(18)));
    multiObservationValues.setValue(tlvtValue);
    OmObservation observation = createObservation();
    observation.setValue(multiObservationValues);
    return observation;
}