JSONObject jsonDoc = doc.getJSONObject();
String schemaName = jsonDoc.optString("nunaliit_schema");
if( null != schemaName ) {
boolean containsGeometry = JSONSupport.containsKey(jsonDoc, "nunaliit_geom");
SchemaExportInfo exportInfo = schemaCache.getExportInfo(schemaName);
if( null != exportInfo || containsGeometry ){
jsonWriter.object();
jsonWriter.key("type");
jsonWriter.value("Feature");
jsonWriter.key("id");
jsonWriter.value(doc.getId());
jsonWriter.key("properties");
jsonWriter.object();
if( null != exportInfo ){
for(SchemaExportProperty exportProperty : exportInfo.getProperties()){
Object value = exportProperty.select(jsonDoc);
if( null != value ) {
jsonWriter.key(exportProperty.getLabel());
jsonWriter.value(value);
}