Package com.simplegeo.client.types

Examples of com.simplegeo.client.types.Record


    double lat = 47.046962;
    String layer = "casey.testing.layer";
    String testPropertyKey = "name";
    String testPropertyValue = "Testing Storage";
    try {
      Record record = new Record("simplegeo-boulder", layer, "Feature", lon, lat);
      HashMap<String, Object> properties = new HashMap<String, Object>();
      properties.put(testPropertyKey, testPropertyValue);
      record.setProperties(properties);
      client.addOrUpdateRecord(record);
     
      Assert.assertEquals(layer, record.getLayer());
      Assert.assertEquals(lat, record.getGeometry().getPoint().getLat(), 0d);
      Assert.assertEquals(lon, record.getGeometry().getPoint().getLon(), 0d);
      Assert.assertEquals(testPropertyValue, record.getProperties().get(testPropertyKey));
     
    } catch (JSONException e) {
      Assert.fail(e.getMessage());
    } catch (IOException e) {
      Assert.fail(e.getMessage());
View Full Code Here


    double lat = 47.046962;
    String layer = "casey.testing.layer";
    String testPropertyKey = "name";
    String testPropertyValue = "Testing Storage";
    try {
      Record record1 = new Record("testRecordId1", layer, "Feature", lon, lat);
      HashMap<String, Object> properties = new HashMap<String, Object>();
      properties.put(testPropertyKey, testPropertyValue);
      record1.setProperties(properties);
     
      Record record2 = new Record("testRecordId2", layer, "Feature", lon, lat);
      record2.setProperties(properties);
     
      ArrayList<Record> records = new ArrayList<Record>();
      records.add(record1);
      records.add(record2);
     
View Full Code Here

  @Test
  public void testGetRecordSync() {
    try {
      String jsonString = client.getRecord("casey.testing.layer", "simplegeo-boulder");
      Record record = Record.fromJSONString(jsonString);
     
      Assert.assertEquals("simplegeo-boulder", record.getRecordId());
    } catch (IOException e) {
      Assert.fail(e.getMessage());     
    } catch (JSONException e) {
      Assert.fail(e.getMessage());     
    }
View Full Code Here

TOP

Related Classes of com.simplegeo.client.types.Record

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.