当前位置: 首页>>代码示例>>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;未经允许,请勿转载。