* Adds a record to the in-memory store with the given position and time
and id.

@param lat
latitude
@param lon
longitude
@param time
time in epoch ms
@param t
object
@param id
identifier
542113
public void add(double lat, double lon, long time, T t, R id) {
        add(lat, lon, time, t, of(id));
    }
289380
function storeGeoshape(index, type, id, shape) {
  switch (type) {
    case 'geoBoundingBox':
      index.addBoundingBox(id,
        shape.bottom,
        shape.left,
        shape.top,
        shape.right
      );
      break;
    case 'geoDistance':
      index.addCircle(id, shape.lat, shape.lon, shape.distance);
      break;
    case 'geoDistanceRange':
      index.addAnnulus(id, shape.lat, shape.lon, shape.to, shape.from);
      break;
    case 'geoPolygon':
      index.addPolygon(id, shape);
      break;
    default:
      break;
  }
}
783204
public void add(Info<T, R> info) {
        String hash = GeoHash.encodeHash(info.lat(), info.lon());

        addToMap(mapByGeoHash, info, hash);
        addToMapById(mapById, info, hash);
    }
633458
public void touchPost(final long postId, final TimeZone tz) throws SQLException {
      if(postId < 1L) {
         throw new SQLException("The post id must be specified for update");
      }

      long modifiedTimestamp = System.currentTimeMillis();

      int offset = tz.getOffset(modifiedTimestamp);
      Connection conn = null;
      PreparedStatement stmt = null;
      Timer.Context ctx = metrics.updatePostTimer.time();
      try {
         conn = connectionSupplier.getConnection();
         stmt = conn.prepareStatement(updatePostModifiedSQL);
         stmt.setTimestamp(1, new Timestamp(modifiedTimestamp));
         stmt.setTimestamp(2, new Timestamp(modifiedTimestamp - offset));
         stmt.setLong(3, postId);
         stmt.executeUpdate();
      } finally {
         ctx.stop();
         SQLUtil.closeQuietly(conn, stmt);
      }
   }
308557
function( key, geojson, layerId, callback ){
    var self = this; 
    var info = {},
      count = 0;
      error = null;
      
      info.name = geojson.name ;
      info.updated_at = geojson.updated_at;
      info.expires_at = geojson.expires_at;
      info.retrieved_at = geojson.retrieved_at;
      info.status = geojson.status;
      info.format = geojson.format;
      info.sha = geojson.sha;
      info.info = geojson.info;
   
      var table = key+':'+layerId;

      var feature = (geojson[0]) ? geojson[0].features[0] : geojson.features[0];
      
      var types = {
        'esriGeometryPolyline': 'LineString',
        'esriGeometryPoint': 'Point',
        'esriGeometryPolygon': 'Polygon'
      };

      if (!feature){
        feature = { geometry: { type: geojson.geomType || types[geojson.info.geometryType] } };
      }

      self._createTable( table, self._buildSchemaFromFeature(feature), true, function(err, result){
        if (err){
          callback(err, false);
          return;
        }

        // insert each feature
        if ( geojson.length ){
          geojson = geojson[0];
        }
        geojson.features.forEach(function(feature, i){
          self._query(self._insertFeature(table, feature, i), function(err){ 
            if (err) {
              self.log.error(err); 
            }
          });
        });

        // TODO Why not use an update query here? 
        self._query( 'delete from "'+self.infoTable+'" where id=\''+table+':info\'', function(err,res){
          self._query( 'insert into "'+self.infoTable+'" values (\''+table+':info\',\''+JSON.stringify(info).replace(/'/g,'')+'\')', function(err, result){
            callback(err, true);
          });
        });
      });     
    
  }
698962
def add_lat_lon(self, lat, lon, precision=1e7):
        """"""
        self._ef["GPS"][piexif.GPSIFD.GPSLatitudeRef] = "N" if lat > 0 else "S"
        self._ef["GPS"][piexif.GPSIFD.GPSLongitudeRef] = "E" if lon > 0 else "W"
        self._ef["GPS"][piexif.GPSIFD.GPSLongitude] = decimal_to_dms(
            abs(lon), int(precision))
        self._ef["GPS"][piexif.GPSIFD.GPSLatitude] = decimal_to_dms(
            abs(lat), int(precision))
1337928
public Datapoint addStringValue(long time, String value) {
        initialValues();
        checkType(TsdbConstants.TYPE_STRING);

        values.add(Lists.<JsonNode> newArrayList(new LongNode(time), new TextNode(value)));
        return this;
    }
689231
public void addRecord(String key,
                          int i) throws TarMalformatException, IOException {
        addRecord(key, Integer.toString(i));
    }
690091
public void add(
            ASN1ObjectIdentifier oid,
            String value) {
        ASN1EncodableVector v = new ASN1EncodableVector();
        v.add(oid);
        v.add(new DERPrintableString(value));
        add(new DERSet(new DERSequence(v)));
    }
223462
function pointSender(lat, lng) {
      /**
       * Sends the point, then calls the callback after a delay
       * @param {function} callback Called when complete
       */
      return function(callback) {
        console.log('Visiting point ' + lat/COORD_FACTOR + ', ' +
            lng/COORD_FACTOR);
        call.write({
          latitude: lat,
          longitude: lng
        });
        _.delay(callback, _.random(500, 1500));
      };
    }
1153558
function (position) {
    var lat = position.coords.latitude;
    var lng = position.coords.longitude;
    geo_codeLatLng(lat, lng);
}
110328
public static void checkLatLong(double lat, double lon) {
		checkArgument(lon <= 181.0, "longitude out of range " + lon);
		checkArgument(lon > -180.0, "longitude out of range " + lon);
		checkArgument(lat <= 91.0, "latitude out of range " + lat);
		checkArgument(lat > -90.0, "latitude out of range " + lat);
	}
624813
def add_to_map(map_obj, lat, lon, date_time, key, cluster_obj):
        """"""
        text = "Event {0} at {1}".format(key, date_time.split()[1])
        folium.Marker([lat, lon], popup=text).add_to(cluster_obj)
456340
def _write_lat_lon(data_out_nc, rivid_lat_lon_z_file):
        
        # only add if user adds
        if rivid_lat_lon_z_file and os.path.exists(rivid_lat_lon_z_file):
            # get list of COMIDS
            lookup_table = np.loadtxt(
                rivid_lat_lon_z_file,
                delimiter=",",
                usecols=(0, 1, 2),
                skiprows=1,
                dtype={
                    'names': ('rivid', 'lat', 'lon'),
                    'formats': ('i8', 'f8', 'f8'),
                },
            )

            # Get relevant arrays while we update them
            nc_rivids = data_out_nc.variables['rivid'][:]
            lats = data_out_nc.variables['lat'][:]
            lons = data_out_nc.variables['lon'][:]

            lat_min = None
            lat_max = None
            lon_min = None
            lon_max = None

            # Process each row in the lookup table
            for nc_index, nc_rivid in enumerate(nc_rivids):
                try:
                    lookup_index = \
                        np.where(lookup_table['rivid'] == nc_rivid)[0][0]
                except Exception:
                    raise Exception('rivid {0} misssing in '
                                    'comid_lat_lon_z file'.format(nc_rivid))

                lat = float(lookup_table['lat'][lookup_index])
                lats[nc_index] = lat
                if lat_min is None or lat < lat_min:
                    lat_min = lat
                if lat_max is None or lat > lat_max:
                    lat_max = lat

                lon = float(lookup_table['lon'][lookup_index])
                lons[nc_index] = lon
                if lon_min is None or lon < lon_min:
                    lon_min = lon
                if lon_max is None or lon > lon_max:
                    lon_max = lon

            # Overwrite netCDF variable values
            data_out_nc.variables['lat'][:] = lats
            data_out_nc.variables['lon'][:] = lons

            # Update metadata
            if lat_min is not None:
                data_out_nc.geospatial_lat_min = lat_min
            if lat_max is not None:
                data_out_nc.geospatial_lat_max = lat_max
            if lon_min is not None:
                data_out_nc.geospatial_lon_min = lon_min
            if lon_max is not None:
                data_out_nc.geospatial_lon_max = lon_max
        else:
            print('No comid_lat_lon_z file. Not adding values ...')
78801
LatLong findNodeByID(long id) {
        try {
            this.pStmtNodesR.setLong(1, id);

            ResultSet rs = this.pStmtNodesR.executeQuery();
            if (rs.next()) {
                double lat = rs.getDouble(1);
                double lon = rs.getDouble(2);

                return new LatLong(lat, lon);
            }
            rs.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }

        return null;
    }
997032
public static void addGpsLogDataPoint( Connection connection, OmsGeopaparazziProject3To4Converter.GpsPoint point,
            long gpslogId ) throws Exception {
        Date timestamp = ETimeUtilities.INSTANCE.TIME_FORMATTER_LOCAL.parse(point.utctime);

        String insertSQL = "INSERT INTO " + TableDescriptions.TABLE_GPSLOG_DATA + "(" + //
                TableDescriptions.GpsLogsDataTableFields.COLUMN_ID.getFieldName() + ", " + //
                TableDescriptions.GpsLogsDataTableFields.COLUMN_LOGID.getFieldName() + ", " + //
                TableDescriptions.GpsLogsDataTableFields.COLUMN_DATA_LON.getFieldName() + ", " + //
                TableDescriptions.GpsLogsDataTableFields.COLUMN_DATA_LAT.getFieldName() + ", " + //
                TableDescriptions.GpsLogsDataTableFields.COLUMN_DATA_ALTIM.getFieldName() + ", " + //
                TableDescriptions.GpsLogsDataTableFields.COLUMN_DATA_TS.getFieldName() + //
                ") VALUES" + "(?,?,?,?,?,?)";
        try (PreparedStatement writeStatement = connection.prepareStatement(insertSQL)) {
            writeStatement.setLong(1, point.id);
            writeStatement.setLong(2, gpslogId);
            writeStatement.setDouble(3, point.lon);
            writeStatement.setDouble(4, point.lat);
            writeStatement.setDouble(5, point.altim);
            writeStatement.setLong(6, timestamp.getTime());

            writeStatement.executeUpdate();
        }
    }
1187412
public void getFeature(int lat, int lon) {
    info("*** GetFeature: lat={0} lon={1}", lat, lon);

    Point request = Point.newBuilder().setLatitude(lat).setLongitude(lon).build();

    Feature feature;
    try {
      feature = blockingStub.getFeature(request);
      if (testHelper != null) {
        testHelper.onMessage(feature);
      }
    } catch (StatusRuntimeException e) {
      warning("RPC failed: {0}", e.getStatus());
      if (testHelper != null) {
        testHelper.onRpcError(e);
      }
      return;
    }
    if (RouteGuideUtil.exists(feature)) {
      info("Found feature called \"{0}\" at {1}, {2}",
          feature.getName(),
          RouteGuideUtil.getLatitude(feature.getLocation()),
          RouteGuideUtil.getLongitude(feature.getLocation()));
    } else {
      info("Found no feature at {0}, {1}",
          RouteGuideUtil.getLatitude(feature.getLocation()),
          RouteGuideUtil.getLongitude(feature.getLocation()));
    }
  }