Hi,

Actually I thought that there would be no need to for parsing because the 
method in the link seemed to support BBOX as it is. But perhaps it is not 
native JTS method but some GeoTools method built upon it?
Another link from the same source:
http://docs.geotools.org/stable/javadocs/org/opengis/geometry/BoundingBox.html

Parsing WMS BBOX to polygon should not be difficult for a programmer. This is 
how I have been building WKT polygons with SQL after splitting BBOX parameters 
into separate fields (xmin, ymin, xmax, ymax)

select 'POLYGON (('||BBOX_XMIN || '  ' || BBOX_YMIN||','
||BBOX_XMIN || '  ' || BBOX_YMAX||','
||BBOX_XMAX || '  ' || BBOX_YMAX||','
||BBOX_XMAX || '  ' || BBOX_YMIN||','
||BBOX_XMIN || '  ' || BBOX_YMIN||'))'
from BBOX

I have three other ideas for making the utility even more usable:
1) X and Y in BBOX can mean easting and northing or vice versa depending on the 
coordinate reference system. The utility could have a selection "Consider that 
coordinates are in northing-easting order". The default should be 
easting-northing.
2) Find BBOX parameter from the long lines of the raw WMS server logs. One line 
may look like
127.0.0.1 - - [04/Sep/2009:11:22:19 +0300] "GET 
/cgi-bin/mapserv.exe?map=c:\\ms4w\\osm.map&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=783&HEIGHT=627&LAYERS=default&TRANSPARENT=TRUE&FORMAT=image%2Fpng&BBOX=3379680.3596462687,6672344.5722924275,3402683.352219573,6690764.593165304&SRS=epsg:2393&STYLES=
 HTTP/1.1" 200 749141
3) Parse also some other WMS parameters from the request and place them as 
attributes of the OpenJUMP polygons in the result layer. Most useful would be 
LAYERS, WIDTH and HEIGHT.

Parameters in WMS request can be in any order. For recognizing them utility 
should investige the parameter name (KEYWORD=) and remember, that parameter 
value ends ends either to "&" craracter or to newline if it happens to be the 
last one.
Just parsing text file with plain bounding boxes 
BBOX=360736,7151616,373024,7163904 into polygons would immediately be an useful 
tool for real world needs and such tool does not exist in any GIS program I 
know. Thus it would match fine with OpenJUMP itself: lightweight, clever and 
useful.

-Jukka-




________________________________________
Lähettäjä: Landon Blake [sunburned.surve...@gmail.com]
Lähetetty: 17. tammikuuta 2013 18:25
Vastaanottaja: OpenJump develop and use
Aihe: Re: [JPP-Devel] How to convert WMS BBOX into polygon feature?

Hmmmm. Should be too hard to process that. If we whip up a plug-in
that parses that data in a text file and adds an OJ layer, will that
work?

Landon

On Wed, Jan 16, 2013 at 6:57 AM, Rahkonen Jukka
<jukka.rahko...@mmmtike.fi> wrote:
> Hi,
>
> Here comes a sample.
>
> -Jukka-
>
> Landon Blake wrote:
>>
>> Jukka:
>>
>> Do you get the list of Bounding Boxes in a text file or similar format? Can 
>> you
>> send me a sample.
>>
>> I may be able to help.
>>
>> Landon
>>
>> On Wed, Jan 16, 2013 at 2:46 AM, Rahkonen Jukka
>> <jukka.rahko...@mmmtike.fi> wrote:
>> > Hi,
>> >
>> > I would like to do some analysis of  WMS server log by converting the
>> recorded BBOX parameters (BBOX=360736,7151616,373024,7163904) into
>> polygons.  I guess it would be rather an easy task for an OJ programmer
>> because JTS has a function for that.
>> >
>> > http://docs.geotools.org/stable/javadocs/org/geotools/geometry/jts/JTS
>> >
>> .html#toGeometry%28org.opengis.geometry.BoundingBox,%20com.vividsol
>> uti
>> > ons.jts.geom.GeometryFactory%29
>> >
>> > Do you agree?  Is anybody there willing to have a try with Beanshell or
>> something?  I have managed to do the conversion with Spatialite and SQL by
>> importing the BBOXes into database as a text file first I it would be a bit 
>> faster
>> to use just OJ.
>> >
>> > -Jukka Rahkonen-
>> >
>> > ----------------------------------------------------------------------
>> > -------- Master Java SE, Java EE, Eclipse, Spring, Hibernate,
>> > JavaScript, jQuery and much more. Keep your Java skills current with
>> > LearnJavaNow -
>> > 200+ hours of step-by-step video tutorials by Java experts.
>> > SALE $49.99 this month only -- learn more at:
>> > http://p.sf.net/sfu/learnmore_122612
>> > _______________________________________________
>> > Jump-pilot-devel mailing list
>> > Jump-pilot-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>
>> ------------------------------------------------------------------------------
>> Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and
>> much more. Keep your Java skills current with LearnJavaNow -
>> 200+ hours of step-by-step video tutorials by Java experts.
>> SALE $49.99 this month only -- learn more at:
>> http://p.sf.net/sfu/learnmore_122612
>> _______________________________________________
>> Jump-pilot-devel mailing list
>> Jump-pilot-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
> ------------------------------------------------------------------------------
> Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
> and much more. Keep your Java skills current with LearnJavaNow -
> 200+ hours of step-by-step video tutorials by Java experts.
> SALE $49.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122612
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to