Re: [josm-dev] WMSPlugin Update

2010-09-02 Thread Ian Dees
2010/9/2 Ian Dees 

> 2010/9/2 Iván Sánchez Ortega 
>
>> El día Thursday 02 September 2010 05:32:25, Ian Dees dijo:
>> > Let me know if anyone has any problems.
>>
>> Hhhhmmm. It fails for http://orto.wms.itacyl.es/WMS? (a orthoimage WMS we
>> can
>> use to trace on top of).
>>
>> Console output says "[Fatal Error] capabilities_1_1_1.dtd:1:58: No more
>> pseudo
>> attributes are allowed.". And the GetCapabilities document seems allright
>> to
>> me: http://orto.wms.itacyl.es/WMS?request=GetCapabilities
>>
>>
> Yikes, that's some crazy-looking XML they give back. I've never seen a
> DOCTYPE specified like that. I imagine the XML parser is trying to do
> something with that and failing. I'll have to debug a bit when I get back in
> front of the code.
>

I just pushed a new version of the plugin that should solve most of these
problems. Can you try your URLs again after updating?
___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-02 Thread Ian Dees
Both of these issues should be fixed now.

For (1), I removed most of the validity checks for the URL.
For (2), I fixed the projection checks to match what Dirk suggested.

Let me know if you find anything else.

On Thu, Sep 2, 2010 at 5:34 AM, Jean-Guilhem Cailton wrote:

> Hi,
>
> 1) How could a MapServer-style WMS URL that includes a map=... parameter be
> specified ?
>
>
> Like, for an example from
> http://wiki.openstreetmap.org/wiki/WikiProject_Haiti/Imagery_and_data_sources:
>
>
> http://maps.nypl.org/mapserv?map=/var/lib/maps/src/relief/haiti.map&layers=geoeye&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=geoeye&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&;
>
> where "
> http://maps.nypl.org/mapserv?map=/var/lib/maps/src/relief/haiti.map&"; has
> a role equivalent to "http://sample.com/wms?";
>
>
> 2) If I try http://onearth.jpl.nasa.gov/wms.cgi?, I get "That layer does
> not support any of JOSMs projections, so you can not use it. This message
> will not show again", whether JOSM is in epsg:4326 or Mercator epsg:3857.
>
> (Usually, for me, Landsat wms was working transparently in both
> projections, which is nice).
>
>
> This is with version 22937 of wmsplugin, which I get after updating to
> josm-latest and updating the plugins twice.
>
> Thanks,
>
> Jean-Guilhem
>
>
> Le 02/09/2010 05:32, Ian Dees a écrit :
>
>> I checked in the changes a few minutes ago and released the plugin to
>> dist.
>> Let me know if anyone has any problems.
>>
>> On Tue, Aug 31, 2010 at 11:26 PM, Ian Dees  wrote:
>>
>>
>>
>>> Hi list,
>>>
>>> I've made some changes to the wmsplugin so that discovering available
>>> layers at a particular WMS URL is a lot easier. What's the best way to
>>> have
>>> people test this and then get it published so that an update gets pushed
>>> out
>>> to users?
>>>
>>> Thanks!
>>> Ian
>>>
>>>
>>>
>> ___
>>
>> josm-dev mailing list
>> josm-dev@openstreetmap.org
>> http://lists.openstreetmap.org/listinfo/josm-dev
>>
>>
>>
>>
>
>
>
___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-02 Thread Dirk Stöcker

On Thu, 2 Sep 2010, Dirk Stöcker wrote:


On Wed, 1 Sep 2010, Ian Dees wrote:


 I checked in the changes a few minutes ago and released the plugin to
 dist.
 Let me know if anyone has any problems.


Your supported projections check is to easy. The projections containing 
preferences have much more projections.


For these projections you need to call getPreferencesFromCode() and when this 
succeeds, then that code is supported. For the others toCode() is correct.


   private boolean isProjSupported(String crs) {
   for (Projection proj : Projection.allProjections) {
   if (proj instanceof ProjectionSubPrefs) {
   return ((ProjectionSubPrefs) proj).getPreferencesFromCode(crs) 
== null;
   } else {
   return proj.toCode().equals(crs);
   }
   }
   return false;
   }

Shouldn't that be

if (proj instanceof ProjectionSubPrefs) {
if(((ProjectionSubPrefs) proj).getPreferencesFromCode(crs) == null)
return true;
} else {
if(proj.toCode().equals(crs))
return true;
}

or otherwise you always test the first entry only.

Ciao
--
http://www.dstoecker.eu/ (PGP key available)___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-02 Thread Jean-Guilhem Cailton

Hi,

1) How could a MapServer-style WMS URL that includes a map=... parameter 
be specified ?



Like, for an example from 
http://wiki.openstreetmap.org/wiki/WikiProject_Haiti/Imagery_and_data_sources 
:


 
http://maps.nypl.org/mapserv?map=/var/lib/maps/src/relief/haiti.map&layers=geoeye&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=geoeye&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image/jpeg&SRS=EPSG:4326&;

where 
"http://maps.nypl.org/mapserv?map=/var/lib/maps/src/relief/haiti.map&"; 
has a role equivalent to "http://sample.com/wms?";



2) If I try http://onearth.jpl.nasa.gov/wms.cgi?, I get "That layer does 
not support any of JOSMs projections, so you can not use it. This 
message will not show again", whether JOSM is in epsg:4326 or Mercator 
epsg:3857.


(Usually, for me, Landsat wms was working transparently in both 
projections, which is nice).



This is with version 22937 of wmsplugin, which I get after updating to 
josm-latest and updating the plugins twice.


Thanks,

Jean-Guilhem


Le 02/09/2010 05:32, Ian Dees a écrit :

I checked in the changes a few minutes ago and released the plugin to dist.
Let me know if anyone has any problems.

On Tue, Aug 31, 2010 at 11:26 PM, Ian Dees  wrote:

   

Hi list,

I've made some changes to the wmsplugin so that discovering available
layers at a particular WMS URL is a lot easier. What's the best way to have
people test this and then get it published so that an update gets pushed out
to users?

Thanks!
Ian

 

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


   




___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-02 Thread Dirk Stöcker

On Wed, 1 Sep 2010, Ian Dees wrote:


I checked in the changes a few minutes ago and released the plugin to dist.
Let me know if anyone has any problems.


Your supported projections check is to easy. The projections containing 
preferences have much more projections.


For these projections you need to call getPreferencesFromCode() and when 
this succeeds, then that code is supported. For the others toCode() is 
correct.


Ciao
--
http://www.dstoecker.eu/ (PGP key available)


___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-02 Thread Petr Dlouhý

Hi,

this looks nice. I have some problems/feature requests:

1) There should be configure button for yet-added WMS services.

2) It doesn't allow me to select layers saying it does not support any of
JOSMs projection (tested on 
and )

3) It has problems with encoding (in case of
<).

On Thu, 02 Sep 2010 05:32:25 +0200, Ian Dees  wrote:

I checked in the changes a few minutes ago and released the plugin to  
dist.

Let me know if anyone has any problems.

On Tue, Aug 31, 2010 at 11:26 PM, Ian Dees  wrote:

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev



--
Petr Dlouhý

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-01 Thread Ian Dees
I checked in the changes a few minutes ago and released the plugin to dist.
Let me know if anyone has any problems.

On Tue, Aug 31, 2010 at 11:26 PM, Ian Dees  wrote:

> Hi list,
>
> I've made some changes to the wmsplugin so that discovering available
> layers at a particular WMS URL is a lot easier. What's the best way to have
> people test this and then get it published so that an update gets pushed out
> to users?
>
> Thanks!
> Ian
>
___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-01 Thread Ian Dees
2010/9/1 Iván Sánchez Ortega 

> El día Wednesday 01 September 2010 18:25:51, Dirk Stöcker dijo:
> > No it uses EPSG:4326 when Mercator is selected. The distortion resulting
> > from that is very low due to the tile mechanism and working at high zoom
> > levels.
> >
> > This "silently assume Mercator is EPSG:4326" should also exist in the
> > future (except the WMS server has Mercator support, which is ignored ATM
> > - very few have).
>
> If I've understood the code correctly, this is done in
>
> http://trac.openstreetmap.org/browser/applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java,
> lines 71-83
>
> Please please please tell me that won't be broken with the update :-)
>
>
Don't worry, I'm only modifying the code that shows the "Add Layer" dialog
in Preferences :) Other code remains untouched.

I just wanted to make sure that my new GetCapabilities-based layer list (not
JOSM's layer list) would do the right thing when deciding whether or not to
warn the user about projection incompatibilities.
___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-01 Thread Iván Sánchez Ortega
El día Wednesday 01 September 2010 18:25:51, Dirk Stöcker dijo:
> No it uses EPSG:4326 when Mercator is selected. The distortion resulting
> from that is very low due to the tile mechanism and working at high zoom
> levels.
>
> This "silently assume Mercator is EPSG:4326" should also exist in the
> future (except the WMS server has Mercator support, which is ignored ATM
> - very few have).

If I've understood the code correctly, this is done in 
http://trac.openstreetmap.org/browser/applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java
 , 
lines 71-83

Please please please tell me that won't be broken with the update :-)

Best,
-- 
Iván Sánchez Ortega 

Un ordenador no es una televisión ni un microondas: es una herramienta 
compleja.

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-01 Thread Dirk Stöcker

On Wed, 1 Sep 2010, Ian Dees wrote:


Unless the plugin is stretching or reprojecting the image locally somehow,
the WMS plugin will have to send the GetMap WMS request with an SRS set to
whatever the projection is in JOSM (which causes the server to send back an
image in the right projection). If JOSM has projection set to Mercator, it
will build the URL with EPSG:3857. ... I think.


No it uses EPSG:4326 when Mercator is selected. The distortion resulting 
from that is very low due to the tile mechanism and working at high zoom 
levels.


This "silently assume Mercator is EPSG:4326" should also exist in the 
future (except the WMS server has Mercator support, which is ignored ATM 
- very few have).


Ciao
--
http://www.dstoecker.eu/ (PGP key available)


___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-01 Thread Ian Dees
2010/9/1 Iván Sánchez Ortega 

> El día Wednesday 01 September 2010 17:20:53, Ian Dees dijo:
> > My update does check the available CRS from GetCapabilities for each
> layer
> > and will flag a layer as unusable if it doesn't match the current
> > projection set in JOSM's preferences.
>
> Wait a second there.
>
> So what if I query a epsg:4326 WMS but JOSM's display is set to EPSG:3857
> AKA
> spherical mercator?
>
> AFAIK, JOSM handles this transparently right now... and I wouldn't like to
> see
> that broken.


Unless the plugin is stretching or reprojecting the image locally somehow,
the WMS plugin will have to send the GetMap WMS request with an SRS set to
whatever the projection is in JOSM (which causes the server to send back an
image in the right projection). If JOSM has projection set to Mercator, it
will build the URL with EPSG:3857. ... I think.

Currently, my change to the plugin gives a warning when any of the WMS
layers selected do not support the currently-selected JOSM projection.

The suggestion was to prompt the user to switch JOSM to a projection that
was supported by the WMS server instead of blindly trying to load the GetMap
request (and failing with a red image on the map).
___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-01 Thread Iván Sánchez Ortega
El día Wednesday 01 September 2010 17:20:53, Ian Dees dijo:
> My update does check the available CRS from GetCapabilities for each layer
> and will flag a layer as unusable if it doesn't match the current
> projection set in JOSM's preferences.

Wait a second there.

So what if I query a epsg:4326 WMS but JOSM's display is set to EPSG:3857 AKA 
spherical mercator?

AFAIK, JOSM handles this transparently right now... and I wouldn't like to see 
that broken.

-- 
Iván Sánchez Ortega 

Un ordenador no es una televisión ni un microondas: es una herramienta 
compleja.

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] WMSPlugin Update

2010-09-01 Thread Dirk Stöcker

On Tue, 31 Aug 2010, Ian Dees wrote:


I've made some changes to the wmsplugin so that discovering available layers
at a particular WMS URL is a lot easier. What's the best way to have people
test this and then get it published so that an update gets pushed out to
users?


Depending on the degree of stability:
- check in code and release a new plugin
or
- supply a patch as trac ticket

Ciao
--
http://www.dstoecker.eu/ (PGP key available)


___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


[josm-dev] WMSPlugin Update

2010-08-31 Thread Ian Dees
>
> Hi list,

>
I've made some changes to the wmsplugin so that discovering available layers
at a particular WMS URL is a lot easier. What's the best way to have people
test this and then get it published so that an update gets pushed out to
users?

>
Thanks!
Ian
___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev