Search in sources :

Example 1 with DataSourcePropertiesInterface

use of com.sldeditor.common.datasource.DataSourcePropertiesInterface in project sldeditor by robward-scisys.

the class DataSourceConnectorFileGDB method getDataSourceProperties.

/**
 * Gets the data source properties.
 *
 * @param propertyMap the property map
 * @return the data source properties
 */
/* (non-Javadoc)
     * @see com.sldeditor.datasource.connector.DataSourceConnectorInterface#getDataSourceProperties(java.util.Map)
     */
@Override
public DataSourcePropertiesInterface getDataSourceProperties(Map<String, String> propertyMap) {
    DataSourcePropertiesInterface properties = new DataSourceProperties(this);
    properties.setPropertyMap(propertyMap);
    return properties;
}
Also used : DataSourcePropertiesInterface(com.sldeditor.common.datasource.DataSourcePropertiesInterface) DataSourceProperties(com.sldeditor.common.datasource.impl.DataSourceProperties)

Example 2 with DataSourcePropertiesInterface

use of com.sldeditor.common.datasource.DataSourcePropertiesInterface in project sldeditor by robward-scisys.

the class DataSourceConnectorRasterFile method getDataSourceProperties.

/* (non-Javadoc)
     * @see com.sldeditor.datasource.connector.DataSourceConnectorInterface#getDataSourceProperties()
     */
@Override
public DataSourcePropertiesInterface getDataSourceProperties(Map<String, String> propertyMap) {
    DataSourcePropertiesInterface properties = new DataSourceProperties(this);
    properties.setPropertyMap(propertyMap);
    return properties;
}
Also used : DataSourcePropertiesInterface(com.sldeditor.common.datasource.DataSourcePropertiesInterface) DataSourceProperties(com.sldeditor.common.datasource.impl.DataSourceProperties)

Example 3 with DataSourcePropertiesInterface

use of com.sldeditor.common.datasource.DataSourcePropertiesInterface in project sldeditor by robward-scisys.

the class MXDParser method importLayer.

/**
 * Import layer.
 *
 * @param layer the layer
 * @param outputFormat the output format
 * @return the styled layer descriptor
 */
private SLDDataInterface importLayer(JsonObject layer, SLDOutputFormatEnum outputFormat) {
    StyledLayerDescriptor sld = null;
    String layerName = layer.get("name").getAsString();
    double minScale = layer.get("minScale").getAsDouble();
    double maxScale = layer.get("maxScale").getAsDouble();
    int transparency = layer.get("transparency").getAsInt();
    JsonElement renderElement = layer.get("renderer");
    sld = getRenderer(layerName, minScale, maxScale, transparency, renderElement);
    JsonElement labelRenderArrayElement = layer.get("labelRenderers");
    if (labelRenderArrayElement != null) {
        processLabelRenderer(sld, labelRenderArrayElement.getAsJsonArray(), transparency);
    }
    JsonElement fieldArray = layer.get("fields");
    List<DataSourceFieldInterface> fieldList = processFields(layerName, fieldArray);
    JsonElement dataSourcePropertiesElement = layer.get("dataSource");
    DataSourcePropertiesInterface dataSourceProperties = processDataSource(layerName, dataSourcePropertiesElement);
    String sldContents = SLDWriterFactory.createWriter(outputFormat).encodeSLD(sld);
    StyleWrapper styleWrapper = new StyleWrapper(layerName, layerName);
    SLDDataInterface sldData = new SLDData(styleWrapper, sldContents);
    sldData.setDataSourceProperties(dataSourceProperties);
    sldData.setFieldList(fieldList);
    sldData.setReadOnly(true);
    return sldData;
}
Also used : SLDData(com.sldeditor.common.SLDData) StyledLayerDescriptor(org.geotools.styling.StyledLayerDescriptor) StyleWrapper(com.sldeditor.common.StyleWrapper) SLDDataInterface(com.sldeditor.common.SLDDataInterface) JsonElement(com.google.gson.JsonElement) DataSourceFieldInterface(com.sldeditor.common.datasource.DataSourceFieldInterface) DataSourcePropertiesInterface(com.sldeditor.common.datasource.DataSourcePropertiesInterface)

Example 4 with DataSourcePropertiesInterface

use of com.sldeditor.common.datasource.DataSourcePropertiesInterface in project sldeditor by robward-scisys.

the class DataSourceConnectorArcSDE method getDataSourceProperties.

/**
 * Gets the data source properties.
 *
 * @param propertyMap the property map
 * @return the data source properties
 */
/* (non-Javadoc)
     * @see com.sldeditor.datasource.connector.DataSourceConnectorInterface#getDataSourceProperties(java.util.Map)
     */
@Override
public DataSourcePropertiesInterface getDataSourceProperties(Map<String, String> propertyMap) {
    DataSourcePropertiesInterface properties = new DataSourceProperties(this);
    properties.setPropertyMap(propertyMap);
    return properties;
}
Also used : DataSourcePropertiesInterface(com.sldeditor.common.datasource.DataSourcePropertiesInterface) DataSourceProperties(com.sldeditor.common.datasource.impl.DataSourceProperties)

Example 5 with DataSourcePropertiesInterface

use of com.sldeditor.common.datasource.DataSourcePropertiesInterface in project sldeditor by robward-scisys.

the class DataSourceConnectorPostgres method getDataSourceProperties.

/**
 * Gets the data source properties.
 *
 * @param propertyMap the property map
 * @return the data source properties
 */
/* (non-Javadoc)
     * @see com.sldeditor.datasource.connector.DataSourceConnectorInterface#getDataSourceProperties(java.util.Map)
     */
@Override
public DataSourcePropertiesInterface getDataSourceProperties(Map<String, String> propertyMap) {
    DataSourcePropertiesInterface properties = new DataSourceProperties(this);
    properties.setPropertyMap(propertyMap);
    return properties;
}
Also used : DataSourcePropertiesInterface(com.sldeditor.common.datasource.DataSourcePropertiesInterface) DataSourceProperties(com.sldeditor.common.datasource.impl.DataSourceProperties)

Aggregations

DataSourcePropertiesInterface (com.sldeditor.common.datasource.DataSourcePropertiesInterface)7 DataSourceProperties (com.sldeditor.common.datasource.impl.DataSourceProperties)5 JsonElement (com.google.gson.JsonElement)2 JsonObject (com.google.gson.JsonObject)1 SLDData (com.sldeditor.common.SLDData)1 SLDDataInterface (com.sldeditor.common.SLDDataInterface)1 StyleWrapper (com.sldeditor.common.StyleWrapper)1 DataSourceFieldInterface (com.sldeditor.common.datasource.DataSourceFieldInterface)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 StyledLayerDescriptor (org.geotools.styling.StyledLayerDescriptor)1