Skip to content

Commit

Permalink
fixed problem with missin geomType
Browse files Browse the repository at this point in the history
  • Loading branch information
svzdvd committed Aug 5, 2010
1 parent 50b90ee commit f4636c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -37,15 +37,15 @@ public void op(Display display, Object target, IProgressMonitor monitor) throws
Neo4jSpatialGeoResource geoResource = (Neo4jSpatialGeoResource) target;
Neo4jSpatialDataStore dataStore = (Neo4jSpatialDataStore) geoResource.service().getDataStore(monitor);
SpatialDatabaseService spatialDatabase = dataStore.getSpatialDatabaseService();
Layer layer = spatialDatabase.getLayer(geoResource.getTypeName());
DefaultLayer layer = (DefaultLayer) spatialDatabase.getLayer(geoResource.getTypeName());

if (layer == null) {
Activator.log("Layer NOT found: " + layer);
Activator.openError(display, "Error creating Network", "Unable to retrieve Layer");
return;
}

Integer geomType = layer.getGeometryType();
Integer geomType = layer.getOrGuessGeometryType();
if (geomType == null) {
Activator.openError(display, "Error creating Network", "Unable to read Layer Geometry Type");
return;
Expand Down
Expand Up @@ -14,7 +14,7 @@
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.swt.widgets.Display;
import org.neo4j.gis.spatial.Constants;
import org.neo4j.gis.spatial.Layer;
import org.neo4j.gis.spatial.DefaultLayer;
import org.neo4j.gis.spatial.SpatialDatabaseRecord;
import org.neo4j.gis.spatial.SpatialDatabaseService;
import org.neo4j.gis.spatial.geotools.data.Neo4jSpatialDataStore;
Expand Down Expand Up @@ -62,9 +62,9 @@ public void onMousePressed(MapMouseEvent evt) {
SpatialDatabaseService spatialDatabase = dataStore.getSpatialDatabaseService();
Transaction tx = spatialDatabase.getDatabase().beginTx();
try {
Layer layer = spatialDatabase.getLayer(getContext().getSelectedLayer().getName());
DefaultLayer layer = (DefaultLayer) spatialDatabase.getLayer(getContext().getSelectedLayer().getName());

Integer geomType = layer.getGeometryType();
Integer geomType = layer.getOrGuessGeometryType();
if (geomType == null) {
Activator.openError(display, "Error creating WayPoint", "Unable to read Layer Geometry Type");
return;
Expand Down

0 comments on commit f4636c4

Please sign in to comment.