@@ -75,7 +75,7 @@ public Object eval(IContextualizationScope scope, Object... parameters) {
7575 @ Override
7676 public List <IObjectArtifact > instantiate (IObservable semantics , IContextualizationScope scope ) throws KlabException {
7777 List <IObjectArtifact > ret = new ArrayList <>();
78- String tilesfile = "klab.engine/src/main/resources/components/org.integratedmodelling.geospace/openbuildings/tiles.geojson" ;
78+ String tilesfile = "../../ klab.engine/src/main/resources/components/org.integratedmodelling.geospace/openbuildings/tiles.geojson" ;
7979
8080 Geometry contextGeometry = ((Shape ) contextSubject .getScale ().getSpace ().getShape ()).getJTSGeometry ();
8181
@@ -105,8 +105,8 @@ public List<IObjectArtifact> instantiate(IObservable semantics, IContextualizati
105105 // Get properties (attributes)
106106 System .out .println ("Properties:" );
107107 for (Property property : feature .getProperties ()) {
108- if (property .getName ().equals ("tile_url" )) {
109- downloadableFiles .add (tilesfile );
108+ if (property .getName ().toString (). equals ("tile_url" )) {
109+ downloadableFiles .add (property . getValue (). toString () );
110110 }
111111 }
112112 }
@@ -133,15 +133,16 @@ public List<IObjectArtifact> instantiate(IObservable semantics, IContextualizati
133133 double lat = Double .parseDouble (record .get (0 ));
134134 double lon = Double .parseDouble (record .get (1 ));
135135
136- if (!contextGeometry .contains (Shape .makePoint (lat , lon ))) { // TODO check coordinates
136+ if (!contextGeometry .contains (Shape .makePoint (lon , lat ))) { // TODO check coordinates
137137 continue ;
138138 }
139139 IMetadata metadata = new Metadata ();
140140 metadata .put ("confidence" , Double .parseDouble (record .get (3 )));
141141 metadata .put ("area_in_meters" , Double .parseDouble (record .get (2 )));
142142 String geometryWkt = record .get (4 );
143143
144- Shape buildingShape = Shape .create (geometryWkt , Projection .create ("EPSG:3857" ));
144+ Shape buildingShape = Shape .create (geometryWkt , Projection .create (Projection .DEFAULT_PROJECTION_CODE ));
145+ //buildingShape = buildingShape.transform(Projection.create(Projection.DEFAULT_PROJECTION_CODE));
145146 String id = CamelCase .toLowerCase (Observables .INSTANCE .getDisplayName (semantics ), '-' ) + "_" + n ++;
146147 ISubject subject = (ISubject ) scope .newObservation (semantics , id , getScale (buildingShape , contextSubject ), metadata );
147148
0 commit comments