Hi, It was you who did also the difficult parts, I have just edited an old script that you have made sometimes.
Script works as supposed. I can draw the geometry that I want to use in a spatial query on a map, run the script, copy-paste the result into the SQL window of the DB query plugin send the query to Oracle. What I usually need is this "SDO_ANYINTERACT" (means the same as Intersects) or "SDO_WITHIN_DISTANCE". I made a template script for each, attached them to EZ Buttons and I have a quite usable and effective tool now. I have also made a variant that takes a geometry from a map and writes a REST command that can be used for seeding/reseeding/truncating GeoWebCache caches. Like in the Oracle case, the base of the command is always the same but some spatial attributes must be filled in. For GWC REST requests all I need to do is to pick up the bounding box limits. With this code the script that was an Oracle spatial query helper becomes a REST seed request builder for an integrated GeoWebCache of Geoserver. htmlFrame.addText("curl -x proxy.com:800 -v -k -u username:password -XPOST -H \"Content-type: application/json\" -d \"{'seedRequest':{'name':'seed_layer','bounds':{'coords':{ 'double':['" +env.getMinX()+"','" +env.getMinY()+"','" +env.getMaxX()+"','" +env.getMaxY() +"']}},'srs':{'number':4326},'zoomStart':8,'zoomStop':11,'format':'image\\/png','type':'seed','threadCount':4}}}\" \"http://localhost:8080/geoserver/gwc/rest/seed/seed_layer.json\"" ); -Jukka Rahkonen- Michael Michaud wrote: > Hi Jukka, > > You really did the most difficult part : > > { > import com.vividsolutions.jts.geom.*; > import com.vividsolutions.jump.feature.*; > import com.vividsolutions.jump.geom.EnvelopeUtil; > import com.vividsolutions.jump.workbench.model.*; > > htmlFrame = wc.workbench.frame.outputFrame; > htmlFrame.createNewDocument(); > htmlFrame.setTitle("BBOX Output"); > fc = > wc.getLayerNamePanel().getSelectedLayers()[0].getFeatureCollectionWrapper() > ; > for (Iterator i = fc.getFeatures().iterator(); i.hasNext();) { > Feature feature = (Feature) i.next(); > Geometry geometry = feature.getGeometry(); > Envelope env = geometry.getEnvelopeInternal(); > htmlFrame.addText("SELECT * \n" > +"FROM ORACLE_TABLE ot \n" > +"WHERE sdo_anyinteract (ot.geoloc,SDO_GEOMETRY('" > + geometry > +"',SRID))='TRUE';" > ); > } > wc.workbench.frame.flash(htmlFrame); > htmlFrame.surface(); > } > > ------------------------------------------------------------------------------ > Android apps run on BlackBerry 10 > Introducing the new BlackBerry 10.2.1 Runtime for Android apps. > Now with support for Jelly Bean, Bluetooth, Mapview and more. > Get your Android app in front of a whole new audience. Start now. > http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktr > k > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel ------------------------------------------------------------------------------ Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel