PiRSquared17 / morisoliver

Automatically exported from code.google.com/p/morisoliver
0 stars 0 forks source link

Allow export of data by a drawn polygon for selection shape #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently export is a select by the bounding box of the current map view.
In older Java Web Start OLIVER a shape could be drawn that would define the 
export select.  (Data is still selected, not clipped if features fall over the 
line.  Clip is not being asked for).  GeoServer WFS supports using a 
non-rectangular shape as a filter for export.  The application just needs to 
offer this functionality in the UI. 

Original issue reported on code.google.com by Aleda.Fr...@state.ma.us on 24 Feb 2011 at 7:11

GoogleCodeExporter commented 9 years ago
I still don't get the results for long list of vertices and what I see in 
Firebug still confuses me - it doesn't look like a normal XML file.  Why is 
that? Is this what it should look like? 

Original comment by Aleda.Fr...@state.ma.us on 22 Sep 2011 at 2:33

Attachments:

GoogleCodeExporter commented 9 years ago
That's the way I encoded it for myself.  It does look weird, but at the time it 
seemed like the thing to do.  Firebug will probably not help since I've seen 
messages from it indicating that the size of the POST exceeds its limit.

Original comment by cpl...@gmail.com on 22 Sep 2011 at 2:40

GoogleCodeExporter commented 9 years ago
Is there an easy way for you to give me the actual XML request that's being 
posted?  I could try to post it with wget, look at the GeoServer log, and 
possibly get the GeoServer people involved as to why it doesn't work? 

Original comment by Aleda.Fr...@state.ma.us on 22 Sep 2011 at 2:42

GoogleCodeExporter commented 9 years ago

Original comment by cpl...@gmail.com on 22 Sep 2011 at 3:06

Attachments:

GoogleCodeExporter commented 9 years ago
OK, for that lighthouses_request.xml I am getting a GeoServer error message:

What polygon does it represent? (is it a town or county?)

2011-09-22 11:21:37,178 ERROR [geoserver.ows] -
com.vividsolutions.jts.geom.TopologyException: found non-noded intersection 
between LINESTRING ( 308469.00000000006 36166.43999998551, 308461.9699999989 
36293.309999981895 ) and LINESTRING ( 306541.40999999683 36103.18999998458, 
327766.6599999968 38021.80999998283 ) [ (308462.88051299064, 36276.87802512618, 
NaN) ]
        at com.vividsolutions.jts.noding.FastNodingValidator.checkValid(FastNodingValidator.java:109)
        at com.vividsolutions.jts.geomgraph.EdgeNodingValidator.checkValid(EdgeNodingValidator.java:94)
        at com.vividsolutions.jts.geomgraph.EdgeNodingValidator.checkValid(EdgeNodingValidator.java:59)
        at com.vividsolutions.jts.operation.overlay.OverlayOp.computeOverlay(OverlayOp.java:170)
        at com.vividsolutions.jts.operation.overlay.OverlayOp.getResultGeometry(OverlayOp.java:127)
        at com.vividsolutions.jts.operation.overlay.OverlayOp.overlayOp(OverlayOp.java:66)
        at com.vividsolutions.jts.operation.overlay.snap.SnapOverlayOp.getResultGeometry(SnapOverlayOp.java:67)
        at com.vividsolutions.jts.operation.overlay.snap.SnapOverlayOp.overlayOp(SnapOverlayOp.java:24)
        at com.vividsolutions.jts.operation.overlay.snap.SnapIfNeededOverlayOp.getResultGeometry(SnapIfNeededOverlayOp.java:76)
        at com.vividsolutions.jts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(SnapIfNeededOverlayOp.java:25)
        at com.vividsolutions.jts.geom.Geometry.intersection(Geometry.java:1150)
        at org.geotools.arcsde.filter.GeometryEncoderSDE.addSpatialFilter(GeometryEncoderSDE.java:267)
        at org.geotools.arcsde.filter.GeometryEncoderSDE.visit(GeometryEncoderSDE.java:342)
        at org.geotools.filter.spatial.IntersectsImpl.accept(IntersectsImpl.java:66)
        at org.geotools.arcsde.filter.GeometryEncoderSDE.encode(GeometryEncoderSDE.java:177)
        at org.geotools.arcsde.data.ArcSDEQuery$FilterSet.getSpatialFilters(ArcSDEQuery.java:1114)
        at org.geotools.arcsde.data.ArcSDEQuery.calculateResultCount(ArcSDEQuery.java:628)
        at org.geotools.arcsde.data.ArcSDEQuery.calculateResultCount(ArcSDEQuery.java:550)
        at org.geotools.arcsde.data.ArcSdeFeatureSource.getCount(ArcSdeFeatureSource.java:233)
        at org.geotools.arcsde.data.ArcSdeFeatureSource.getCount(ArcSdeFeatureSource.java:218)
        at org.geotools.arcsde.data.ArcSdeFeatureCollection.getCount(ArcSdeFeatureCollection.java:104)
        at org.geotools.data.store.DataFeatureCollection.size(DataFeatureCollection.java:265)
        at org.geotools.data.crs.ReprojectFeatureResults.size(ReprojectFeatureResults.java:120)
        at org.geoserver.wfs.GetFeature.run(GetFeature.java:371)
        at org.geoserver.wfs.DefaultWebFeatureService.getFeature(DefaultWebFeatureService.java:115)
        at sun.reflect.GeneratedMethodAccessor168.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.geoserver.ows.util.EMFLogger.invoke(EMFLogger.java:51)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy20.getFeature(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:599)
        at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:230)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
        at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
        at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
        at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:47)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)

Original comment by Aleda.Fr...@state.ma.us on 22 Sep 2011 at 3:22

GoogleCodeExporter commented 9 years ago
I could try to plot all the points but it would take a long time.. 

Original comment by Aleda.Fr...@state.ma.us on 22 Sep 2011 at 3:24

GoogleCodeExporter commented 9 years ago
It is well-formed and valid against the schema, at least that's good.

Original comment by Aleda.Fr...@state.ma.us on 22 Sep 2011 at 3:25

GoogleCodeExporter commented 9 years ago
I wonder if we're going to get the message if we try to extract lighthouses by 
other polygons?  I'm wondering if there are certain polys this happens with, 
and what is it about those polys.  I think I am going to have to plot these 
points and see what it draws... If you can tell me which datalayer the polygon 
came from and which polygon it was that would help. 

Original comment by Aleda.Fr...@state.ma.us on 22 Sep 2011 at 3:28

GoogleCodeExporter commented 9 years ago
Please give the latest round a shot.

Committed revision 134.

Original comment by cpl...@gmail.com on 22 Sep 2011 at 7:16

GoogleCodeExporter commented 9 years ago
Well, I guess I may have broken the standard export wizard.  Lucky me.

Original comment by cpl...@gmail.com on 22 Sep 2011 at 8:11

GoogleCodeExporter commented 9 years ago
Sorry, should be betterer now.

Committed revision 138.

Original comment by cpl...@gmail.com on 22 Sep 2011 at 8:20

GoogleCodeExporter commented 9 years ago
Extract of schools by Belchertown in the mwra layer still does not work.  Can 
you give me XML for that or can we discuss by phone Friday?  I feel like we're 
going around on this one, I want to make sure if I need to bring GeoServer in 
that I do it soon. 

Original comment by Aleda.Fr...@state.ma.us on 22 Sep 2011 at 8:52

GoogleCodeExporter commented 9 years ago
Could you send me a permalink?  Those layers don't sound familiar to me.

Original comment by cpl...@gmail.com on 22 Sep 2011 at 8:55

GoogleCodeExporter commented 9 years ago
The rectangular town (Millville) in the middle of the screen in this permalink 
works:

http://maps.massgis.state.ma.us/map_ol_mop/moris.php?lyrs=MWRA%20Towns%20with%20
Water%20or%20Sewer~massgis:GISDATA.MWRASERVICE_POLY|Schools%20-%20Pre-Kindergart
en%20to%20High%20School~massgis:GISDATA.SCHOOLS_PT&bbox=-71.64551704002511,42.00
714565369526,-71.50690047815945,42.06776911171406&coordUnit=dms&measureUnit=m&ba
se=googleSatellite¢er=-7967827.1119752,5166593.1142928&zoom=7

The town (Belchertown) in the middle of the screen in this permalink doesn't 
work:

http://maps.massgis.state.ma.us/map_ol_mop/moris.php?lyrs=MWRA%20Towns%20with%20
Water%20or%20Sewer~massgis:GISDATA.MWRASERVICE_POLY|Schools%20-%20Pre-Kindergart
en%20to%20High%20School~massgis:GISDATA.SCHOOLS_PT&bbox=-72.68290965610757,42.15
630529188659,-72.1284434086485,42.39788215438714&coordUnit=dms&measureUnit=m&bas
e=googleSatellite¢er=-8060163.0421268,5202594.954609&zoom=5

To start simple, both are "1 polygon" towns.  The second has more vertices than 
the other.  I'd like to submit the XML For the one with more vertices to 
GeoServer directly to see any error.  Also would like to see the request that 
gathered the vertices to give. 

When I say doesn't work - both give me a .zip file but the shapefile is missing 
from Belchertown's zip.

Original comment by Aleda.Fr...@state.ma.us on 23 Sep 2011 at 1:26

GoogleCodeExporter commented 9 years ago
It's a little too early in the morning to trumpet progress, but I think we may 
have it.

I neglected to include a namespace attr in the xml, and once I did that, both 
of your sample requests failed.  Which was good, sort of.

So I compared the extract-by-polygon query w/ a normal 
extract-by-bbox-from-the-wizard query.  Long story short(er), GeoServer must be 
using gml version 3 instead of 2 which is what I was using until my last commit.

Now I actually see hits in the features-found columns as well as .shp's in the 
.zip.

Please give it a whirl.

Original comment by cpl...@gmail.com on 23 Sep 2011 at 2:22

GoogleCodeExporter commented 9 years ago
Arrgh. I updated the code and I still get Millville OK but not Belchertown.
I always got hits in the features found column.  Just with certain polys I did 
not get the .shp. 

From the wiki:  We support WMS 1.1.1 and WFS 1.0.0 (returns GML 2.x) and WFS 
1.1.0 (returns GML 3.x)

Original comment by Aleda.Fr...@state.ma.us on 23 Sep 2011 at 3:03

GoogleCodeExporter commented 9 years ago
That doesn't make any sense.  Here is what I see on my end (on my dev box) for 
Belchertown.

Original comment by cpl...@gmail.com on 23 Sep 2011 at 3:27

Attachments:

GoogleCodeExporter commented 9 years ago
Aleda, add this near the top of mkzip:

require HTTP::Request;

You can actually put it in place of use Data::Dumper;

Perhaps your version of perl does NOT automatically include support for the lib 
that I need to do the POST request.

Original comment by cpl...@gmail.com on 23 Sep 2011 at 10:29

GoogleCodeExporter commented 9 years ago
I just saw comment 68.
I tried it:

#!/usr/bin/perl

require HTTP::Request;

use strict;

but I get the blue bar going and going. I don't see a Data::Dumper in any 
version of the script that I have either.

Original comment by Aleda.Fr...@state.ma.us on 26 Sep 2011 at 4:34

GoogleCodeExporter commented 9 years ago
What should I look for in my phpInfo output to see if I have support for the 
lib you use for the POST request? 

Original comment by Aleda.Fr...@state.ma.us on 26 Sep 2011 at 4:36

GoogleCodeExporter commented 9 years ago
When I right-click a highlighted feature in the Query results table and select 
"Launch the data export wizard and restrict area of interest to this feature," 
the data export wizard doesn't launch in Chrome 14, IE 9, or Safari 5.1. This 
only works for me in Firefox.

Original comment by emily.hu...@state.ma.us on 27 Sep 2011 at 6:09

GoogleCodeExporter commented 9 years ago
Committed revision 159.  v. 0.54

You should be in good shape now.

Original comment by cpl...@gmail.com on 27 Sep 2011 at 7:36

GoogleCodeExporter commented 9 years ago
Exporting by a drawn poly doesn't work for me for more complicated polygons. 
The identify works, but the data export wizard finds zero features within the 
polygon I drew (see first attached screenshot). Aleda and I did a little 
digging and it looks like different requests are being sent for simple or more 
complicated polygons. The second and third screenshots show examples of these 
different requests.

Original comment by emily.hu...@state.ma.us on 27 Sep 2011 at 8:41

Attachments:

GoogleCodeExporter commented 9 years ago
I think there is some confusion about the poly & how it relates to the export 
wizard.  The identify tool does not launch the export wizard directly.  The 
only hook it has to the export wizard is if you make your way to a 
feature-details row of a POLYGON and right-click it to launch the wizard.

It looks like you were thinking that a poly or a bbox drawn w/ the identify 
would make its way to constraining the export wizard.  It won't.  At least 
that's what I think you were thinking!  Correct me if I'm wrong.

Original comment by cpl...@gmail.com on 27 Sep 2011 at 9:45

GoogleCodeExporter commented 9 years ago
The At a glance table in the Query results window says, "To use your selected 
area of interest to launch the data export wizard, click here." I thought that 
when I clicked this, the poly I used to identify would be used for the export 
bbox. What happens when I launch the data export wizard from there?

Original comment by emily.hu...@state.ma.us on 28 Sep 2011 at 1:17

GoogleCodeExporter commented 9 years ago
The polygon that corresponds to the feature of the table on which you 
right-clicked is what defined the boundaries of the export data wizard.

That sounded professorial, but it is accurate!

So now that I reread the original issue, the polygon was never supposed to be 
intended as an identify.  Ugh.  OK, I think that it would make most sense to 
throw away the identify aspect of the polygon and instead have it launch the 
wizard.  That would address this issue directly.  Sound OK?

Original comment by cpl...@gmail.com on 28 Sep 2011 at 1:32

GoogleCodeExporter commented 9 years ago
I think I just un-merged issue 16 which is what I thought this issue was 
addressing.

Original comment by cpl...@gmail.com on 28 Sep 2011 at 1:34

GoogleCodeExporter commented 9 years ago

Original comment by cpl...@gmail.com on 28 Sep 2011 at 1:38

GoogleCodeExporter commented 9 years ago
I'm sorry, but I'm still a little confused. I didn't right-click a feature to 
launch the data export wizard, so what is the data export wizard using to 
define the bbox? I've circled what I clicked to launch the data export wizard 
in the identify window (see attached screenshot).

Original comment by emily.hu...@state.ma.us on 28 Sep 2011 at 1:43

Attachments:

GoogleCodeExporter commented 9 years ago
Yay.  I forgot all about that link.  You're right -- that is what that link is 
intended to do.  Yay.  Let me see why it's broken.

That also means we can have our cake and eat it too.  The other issue can stay 
merged w/ this one (my un-merging was completely unsuccessful, anyway).

Original comment by cpl...@gmail.com on 28 Sep 2011 at 1:46

GoogleCodeExporter commented 9 years ago
Issue 16 has been merged into this issue.

Original comment by cpl...@gmail.com on 28 Sep 2011 at 1:47

GoogleCodeExporter commented 9 years ago
Sorry for all the confusion.  I'm apologizing to myself as well.

I went back to make sure that normal bbox queries as well as the normal launch 
of the export wizard continued to work.  I haven't been able to break it.

Committed revision 161.
v. 0.56

Original comment by cpl...@gmail.com on 28 Sep 2011 at 2:53

GoogleCodeExporter commented 9 years ago
One thing that I found a little confusing when I was testing this is that you 
only identify on active layers that are checked on, but you export all layers 
listed in the active data layers. Would it be possible to export only layers 
that are checked on? This could be applied to exporting both through the query 
results and data export wizard.

Original comment by emily.hu...@state.ma.us on 3 Oct 2011 at 5:18

GoogleCodeExporter commented 9 years ago
Done.  Clicking on the import-active-data-layers will import all layers no 
matter their visibility.

v. 0.60

Committed revision 165.

Original comment by cpl...@gmail.com on 6 Oct 2011 at 2:00

GoogleCodeExporter commented 9 years ago
This works for us. Only checked on active data layers are appearing in the data 
export wizard. Tested MORIS v. 0.62 with Chrome 14 on Windows 7.

Original comment by emily.hu...@state.ma.us on 18 Oct 2011 at 6:34