當前位置: 首頁>>代碼示例>>Java>>正文


Java NGWVectorLayer.insert方法代碼示例

本文整理匯總了Java中com.nextgis.maplib.map.NGWVectorLayer.insert方法的典型用法代碼示例。如果您正苦於以下問題:Java NGWVectorLayer.insert方法的具體用法?Java NGWVectorLayer.insert怎麽用?Java NGWVectorLayer.insert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.nextgis.maplib.map.NGWVectorLayer的用法示例。


在下文中一共展示了NGWVectorLayer.insert方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: saveMark

import com.nextgis.maplib.map.NGWVectorLayer; //導入方法依賴的package包/類
public static String saveMark(Uri uri, String session, int id, String name, long timestamp, GeoPoint point) {
    NGWVectorLayer markLayer = (NGWVectorLayer) MapBase.getInstance().getLayerByPathName(LoggerApplication.TABLE_MARK);
    if (markLayer != null) {
        String uniqueId = UUID.randomUUID().toString();
        ContentValues cv = new ContentValues();
        cv.put(LoggerApplication.FIELD_UNIQUE_ID, uniqueId);
        cv.put(LoggerApplication.FIELD_SESSION, session);
        cv.put(LoggerApplication.FIELD_MARK_ID, id);
        cv.put(LoggerApplication.FIELD_NAME, name);
        cv.put(LoggerApplication.FIELD_TIMESTAMP, timestamp * 1d);
        cv.put(LoggerApplication.FIELD_DATETIME, timestamp);
        try {
            cv.put(FIELD_GEOM, point.toBlob());
        } catch (IOException e) {
            e.printStackTrace();
        }

        markLayer.insert(uri, cv);
        return uniqueId;
    }

    return null;
}
 
開發者ID:nextgis,項目名稱:nextgislogger,代碼行數:24,代碼來源:BaseEngine.java

示例2: saveData

import com.nextgis.maplib.map.NGWVectorLayer; //導入方法依賴的package包/類
@Override
public void saveData(ArrayList<InfoItem> items, String markId) {
	NGWVectorLayer cellLayer = (NGWVectorLayer) MapBase.getInstance().getLayerByPathName(LoggerApplication.TABLE_CELL);
	if (cellLayer != null) {
		ContentValues cv = new ContentValues();
		for (InfoItem item : items) {
			cv.clear();
			cv.put(LoggerApplication.FIELD_MARK, markId);
			cv.put(LoggerConstants.HEADER_GEN, (String) item.getColumn(LoggerConstants.HEADER_GEN).getValue());
			cv.put(LoggerConstants.HEADER_TYPE, (String) item.getColumn(LoggerConstants.HEADER_TYPE).getValue());
			cv.put(LoggerConstants.HEADER_ACTIVE, (String) item.getColumn(LoggerConstants.HEADER_ACTIVE).getValue());
			cv.put(LoggerConstants.HEADER_MCC, (String) item.getColumn(LoggerConstants.HEADER_MCC).getValue());
			cv.put(LoggerConstants.HEADER_MNC, (String) item.getColumn(LoggerConstants.HEADER_MNC).getValue());
			cv.put(LoggerConstants.HEADER_LAC, (String) item.getColumn(LoggerConstants.HEADER_LAC).getValue());
			cv.put(LoggerConstants.HEADER_CID, (String) item.getColumn(LoggerConstants.HEADER_CID).getValue());
			cv.put(LoggerConstants.HEADER_PSC, (String) item.getColumn(LoggerConstants.HEADER_PSC).getValue());
			cv.put(LoggerConstants.HEADER_POWER, (String) item.getColumn(LoggerConstants.HEADER_POWER).getValue());
               cv.put(Constants.FIELD_GEOM, LoggerApplication.getNullGeometry());

			cellLayer.insert(mUri, cv);
		}
	}
}
 
開發者ID:nextgis,項目名稱:nextgislogger,代碼行數:24,代碼來源:CellEngine.java

示例3: saveData

import com.nextgis.maplib.map.NGWVectorLayer; //導入方法依賴的package包/類
@Override
public void saveData(ArrayList<InfoItem> items, String markId) {
    NGWVectorLayer externalLayer = (NGWVectorLayer) MapBase.getInstance().getLayerByPathName(LoggerApplication.TABLE_EXTERNAL);
    if (externalLayer != null) {
        ContentValues cv = new ContentValues();
        cv.put(LoggerApplication.FIELD_MARK, markId);

        String data = "";
        for (InfoItem item : items)
            data += item.getColumns().get(0).getValue() + LoggerConstants.CSV_SEPARATOR;

        cv.put(LoggerApplication.FIELD_DATA, data);
        cv.put(Constants.FIELD_GEOM, LoggerApplication.getNullGeometry());

        externalLayer.insert(mUri, cv);
    }
}
 
開發者ID:nextgis,項目名稱:nextgislogger,代碼行數:18,代碼來源:ArduinoEngine.java

示例4: startSession

import com.nextgis.maplib.map.NGWVectorLayer; //導入方法依賴的package包/類
private String startSession(String name, String userName, String deviceInfo) {
    NGWVectorLayer sessionLayer = (NGWVectorLayer) MapBase.getInstance().getLayerByPathName(LoggerApplication.TABLE_SESSION);
    if (sessionLayer != null) {
        String id = UUID.randomUUID().toString();
        ContentValues cv = new ContentValues();
        cv.put(LoggerApplication.FIELD_NAME, name);
        cv.put(LoggerApplication.FIELD_USER, userName);
        cv.put(LoggerApplication.FIELD_DEVICE_INFO, deviceInfo);
        cv.put(LoggerApplication.FIELD_UNIQUE_ID, id);
        cv.put(Constants.FIELD_GEOM, LoggerApplication.getNullGeometry());

        sessionLayer.insert(mUri, cv);
        return id;
    }

    return null;
}
 
開發者ID:nextgis,項目名稱:nextgislogger,代碼行數:18,代碼來源:MainActivity.java

示例5: saveData

import com.nextgis.maplib.map.NGWVectorLayer; //導入方法依賴的package包/類
@Override
public void saveData(ArrayList<InfoItem> items, String markId) {
    NGWVectorLayer sensorLayer = (NGWVectorLayer) MapBase.getInstance().getLayerByPathName(LoggerApplication.TABLE_SENSOR);
    if (sensorLayer != null) {
        ContentValues cv = new ContentValues();
        cv.put(LoggerApplication.FIELD_MARK, markId);

        for (InfoItem item : items) {
            if (item.getColumn(HEADER_ACC_X) != null) {
                cv.put(HEADER_ACC_X, item.getColumn(HEADER_ACC_X).getValue() + "");
                cv.put(HEADER_ACC_Y, item.getColumn(HEADER_ACC_Y).getValue() + "");
                cv.put(HEADER_ACC_Z, item.getColumn(HEADER_ACC_Z).getValue() + "");
            }

            if (item.getColumn(HEADER_LINEAR_X) != null) {
                cv.put(HEADER_LINEAR_X, item.getColumn(HEADER_LINEAR_X).getValue() + "");
                cv.put(HEADER_LINEAR_Y, item.getColumn(HEADER_LINEAR_Y).getValue() + "");
                cv.put(HEADER_LINEAR_Z, item.getColumn(HEADER_LINEAR_Z).getValue() + "");
            }

            if (item.getColumn(HEADER_AZIMUTH) != null) {
                cv.put(HEADER_AZIMUTH, item.getColumn(HEADER_AZIMUTH).getValue() + "");
                cv.put(HEADER_PITCH, item.getColumn(HEADER_PITCH).getValue() + "");
                cv.put(HEADER_ROLL, item.getColumn(HEADER_ROLL).getValue() + "");
            }

            if (item.getColumn(HEADER_MAGNETIC_X) != null) {
                cv.put(HEADER_MAGNETIC_X, item.getColumn(HEADER_MAGNETIC_X).getValue() + "");
                cv.put(HEADER_MAGNETIC_Y, item.getColumn(HEADER_MAGNETIC_Y).getValue() + "");
                cv.put(HEADER_MAGNETIC_Z, item.getColumn(HEADER_MAGNETIC_Z).getValue() + "");
            }

            if (item.getColumn(HEADER_GYRO_X) != null) {
                cv.put(HEADER_GYRO_X, item.getColumn(HEADER_GYRO_X).getValue() + "");
                cv.put(HEADER_GYRO_Y, item.getColumn(HEADER_GYRO_Y).getValue() + "");
                cv.put(HEADER_GYRO_Z, item.getColumn(HEADER_GYRO_Z).getValue() + "");
            }

            if (item.getColumn(HEADER_GPS_LAT) != null) {
                cv.put(HEADER_GPS_LAT, item.getColumn(HEADER_GPS_LAT).getValue() + "");
                cv.put(HEADER_GPS_LON, item.getColumn(HEADER_GPS_LON).getValue() + "");
                cv.put(HEADER_GPS_ALT, item.getColumn(HEADER_GPS_ALT).getValue() + "");
                cv.put(HEADER_GPS_ACC, item.getColumn(HEADER_GPS_ACC).getValue() + "");
                cv.put(HEADER_GPS_SP, item.getColumn(HEADER_GPS_SP).getValue() + "");
                cv.put(HEADER_GPS_BE, item.getColumn(HEADER_GPS_BE).getValue() + "");
                cv.put(HEADER_GPS_SAT, item.getColumn(HEADER_GPS_SAT).getValue() + "");
                cv.put(HEADER_GPS_TIME, item.getColumn(HEADER_GPS_TIME).getValue() + "");
            }

            if (item.getColumn(HEADER_AUDIO) != null)
                cv.put(HEADER_AUDIO, item.getColumn(HEADER_AUDIO).getValue() + "");
        }

        cv.put(Constants.FIELD_GEOM, LoggerApplication.getNullGeometry());
        sensorLayer.insert(mUri, cv);
    }
}
 
開發者ID:nextgis,項目名稱:nextgislogger,代碼行數:58,代碼來源:SensorEngine.java


注:本文中的com.nextgis.maplib.map.NGWVectorLayer.insert方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。