geoportal-data-viewer-app/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/util/OGCUtils.java

44 lines
2.1 KiB
Java

package org.gcube.portlets.user.geoportaldataviewer.client.util;
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
import com.google.gwt.core.client.GWT;
public class OGCUtils {
public static void performWFSQueryOnCentroid(RecordDV record) {
GWT.log("WFS Query for : "+record);
if (record != null) {
// GWT.log("record instanceof ConcessioneDV: " + (record instanceof ConcessioneDV) + " with mongo item id: "
// + record.getItemId());
// GeoportalDataViewerConstants.print("record instanceof ConcessioneDV: "
// +(record instanceof ConcessioneDV));
// if (record instanceof ConcessioneDV) {
// ConcessioneDV concessioneDV = (ConcessioneDV) record;
// Double x = concessioneDV.getCentroidLong();
// Double y = concessioneDV.getCentroidLat();
// GWT.log("X: " + x + ", Y:" + y);
// if (x != null && y != null) {
// Coordinate transfCoord = MapUtils.transformCoordiante(new Coordinate(x, y),
// GeoportalDataViewerConstants.MAP_PROJECTION.EPSG_4326.getName(), GeoportalDataViewerConstants.MAP_PROJECTION.EPSG_3857.getName());
// GeoQuery select = olMapMng.toDataPointQuery(transfCoord, false);
// GWT.log("GeoQuery: " + select);
// // GeoportalDataViewerConstants.print("fireEvent QueryDataEvent");
// ExtentWrapped toExt = new ExtentWrapped(transfCoord.getX(), transfCoord.getY(), transfCoord.getX(),
// transfCoord.getY());
// layerManager.getLayerManagerBus().fireEvent(new QueryDataEvent(select, toExt, record.getItemId(),
// true, GeoportalDataViewerConstants.MapEventType.ADDED_CENTROID_LAYER_TO_MAP));
// } else {
// GeoportalDataViewerConstants.printJs(
// "I cannot select the point one or both coordiantes are null. X: " + x + ", Y:" + y);
// }
// }
}
}
}