Skip to content

Commit

Permalink
fix polygon selection issue + version up for release
Browse files Browse the repository at this point in the history
  • Loading branch information
moovida committed Jan 15, 2021
1 parent 2197b7f commit 3ddd713
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 14 additions & 7 deletions lib/eu/hydrologis/smash/models/tools/geometryeditor_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,16 @@ class GeometryEditManager {
// create the touch point and buffer in the current layer prj
var touchBufferLayerPrj =
GeometryUtilities.fromEnvelope(env, makeCircle: false);
touchBufferLayerPrj.setSRID(srid);
var touchPointLayerPrj = GeometryFactory.defaultPrecision()
.createPoint(Coordinate(point.longitude, point.latitude));
SmashPrj.transformGeometry(
SmashPrj.EPSG4326, dataPrj, touchBufferLayerPrj);
SmashPrj.transformGeometry(
SmashPrj.EPSG4326, dataPrj, touchPointLayerPrj);

touchPointLayerPrj.setSRID(srid);
if (srid != SmashPrj.EPSG4326_INT) {
SmashPrj.transformGeometry(
SmashPrj.EPSG4326, dataPrj, touchBufferLayerPrj);
SmashPrj.transformGeometry(
SmashPrj.EPSG4326, dataPrj, touchPointLayerPrj);
}
var tableName = vLayer.getName();
var sqlName = SqlName(tableName);
var gc = await db.getGeometryColumnsForTable(sqlName);
Expand All @@ -334,8 +337,12 @@ class GeometryEditManager {
checkEnv = touchBufferLayerPrj.getEnvelopeInternal();
checkGeom = touchBufferLayerPrj;
}
var geomsIntersected = await db.getGeometriesIn(sqlName,
envelope: checkEnv, userDataField: primaryKey);
var geomsIntersected = await db.getGeometriesIn(
sqlName,
intersectionGeometry: checkGeom,
// envelope: checkEnv,
userDataField: primaryKey,
);

if (geomsIntersected.isNotEmpty) {
// find touching
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: smash
description: The Smart Mobile Application for Surveyor's Happyness.

version: 1.6.3+52 # we keep the build number growing to have it properly handled in android
version: 1.6.3+53 # we keep the build number growing to have it properly handled in android

environment:
sdk: ">=2.2.2 <3.0.0"
Expand Down

0 comments on commit 3ddd713

Please sign in to comment.