Modify

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#11572 closed defect (fixed)

Arcgis REST projection and bbox issues

Reported by: A_Pirard Owned by: wiktorn
Priority: normal Milestone: 15.08
Component: Core imagery Version:
Keywords: WMS Cc:

Description

What steps will reproduce the problem?

This layer definition
wms[21]:http://geoservices.wallonie.be/arcgis/rest/services/TOPOGRAPHIE/PICC/MapServer/export?&f=image&format=png8&dpi=90&transparent=True&SRS={proj}&bboxSR=3857&imageSR=3857&bbox={bbox}&size={width},{height}&layers=hide:11,22

produces pictures like this (https://www.osm.org/#map=16/50.54496/5.60156):
http://geoservices.wallonie.be/arcgis/rest/services/TOPOGRAPHIE/PICC/MapServer/export?&f=image&format=png8&dpi=90&transparent=True&SRS=EPSG:3857&bboxSR=3857&imageSR=3857&bbox=622922.4272812,6541196.9170170,623945.2884098,6542219.7781455&size=500,500&layers=hide:11,22

Note: &SRS= is only a dummy to show which SRS JOSM chose for the request, EPSG:3857, *SR= are set accordingly.

With the following similar definition, however (other server)
wms[21]:http://geoservices.wallonie.be/arcgis/rest/services/IGN/LIMITES_ADMINISTRATIVES/MapServer/export?&f=image&format=png8&dpi=90&transparent=True&SRS={proj}&bboxSR=4326&imageSR=4326&bbox={bbox}&size={width},{height}&layers=show:0,2,3

JOSM chooses proj=EPSG:4326
and produces the attached bad image: middle line boundary shrinked and repeated.
Furthermore, if I force the request to use EPSG:3857 as folows:
wms[21]:http://geoservices.wallonie.be/arcgis/rest/services/IGN/LIMITES_ADMINISTRATIVES/MapServer/export?&f=image&format=png8&dpi=90&transparent=True&SRS=EPSG:3857&bboxSR=3857&imageSR=3857&bbox={bbox}&size={width},{height}&layers=show:0,2,3
JOSM insists on using a 4326 bbox:
INFO: Grabbing WMS http://geoservices.wallonie.be/arcgis/rest/services/IGN/LIMITES_ADMINISTRATIVES/MapServer/export?&f=image&format=png8&dpi=90&transparent=True&SRS=EPSG:3857&bboxSR=3857&imageSR=3857&bbox=5.6035138,50.5428163,5.6092084,50.5464351&size=500,500&layers=show:0,2,3
(and there is no image)

The server seems to work correctly.

This is is a correct picture:
http://geoservices.wallonie.be/arcgis/rest/services/IGN/LIMITES_ADMINISTRATIVES/MapServer/export?dpi=96&transparent=true&format=png32&bbox=623143.0003956892%2C6540870.250346748%2C624204.7584916232%2C6541465.0259730425&bboxSR=102100&imageSR=102100&size=889%2C498&f=image

And I get a correct display when using WMS served by a Mapproxy configuration:
wms:http://localhost:8080/service?&TRANSPARENT=TRUE&FORMAT=image/png8&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=SPW_boundary&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}

I attached the contents of the cache + details for both tests.

What's going on behind that?
It looks like the vertical ratio is incorrect, but what about choosing the wrong {proj}?
Am I goofing somehow?
Any workaround or fix?

Thanks

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2015-05-08 01:31:23
Last Changed Author: stoecker
Revision: 8339
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Relative URL: ^/trunk
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2015-05-07 17:30:43 +0200 (Thu, 07 May 2015)
Last Changed Rev: 8339

Identification: JOSM/1.5 (8339 en) Linux Mint 13 Maya
Memory Usage: 254 MB / 1267 MB (138 MB allocated, but free)
Java version: 1.7.0_65, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: openjdk-7-jre:amd64-7u71-2.5.3-0ubuntu0.12.04.1
VM arguments: [-Djosm.restart=true, -Djava.net.useSystemProxies=true]

Plugins:
- AddrInterpolation (31241)
- FixAddresses (31241)
- OpeningHoursEditor (31241)
- PicLayer (31241)
- RoadSigns (31241)
- areaselector
- download_along (31241)
- editgpx (31241)
- geotools (31126)
- importvec (31241)
- jts (31126)
- log4j (31231)
- mirrored_download (31241)
- opendata (31241)
- osmarender (31241)
- reltoolbox (31241)
- reverter (31241)
- scripting (30710)
- tagging-preset-tester (31241)
- turnrestrictions (31241)
- utilsplugin2 (31241)
- waydownloader (31241)

Last errors/warnings:
- E: java.io.FileNotFoundException: no/home/p/.josm/Traffic rules BE.xml (No such file or directory)
- E: no/home/p/.josm/Traffic rules BE.xml
- W: Detected deprecated 'canvas{background-color}' in '/home/p/.josm/Papou.css' which will be removed shortly. Use 'fill-color' instead.
- W: Detected deprecated 'canvas{background-color}' in '/home/p/.josm/cadastre.css' which will be removed shortly. Use 'fill-color' instead.
- E: org.openstreetmap.josm.plugins.PluginException: An error occurred in plugin areaselector. Cause: java.lang.reflect.InvocationTargetException. Cause: java.lang.NoClassDefFoundError: org/apache/log4j/ConsoleAppender. Cause: java.lang.ClassNotFoundException: org.apache.log4j.ConsoleAppender

Attachments (4)

ArcGIS-0.png (4.3 KB ) - added by A_Pirard 10 years ago.
ArcGIS-1.png (66.6 KB ) - added by A_Pirard 10 years ago.
wms.3857.zip (2.6 KB ) - added by A_Pirard 10 years ago.
wms.4326.zip (11.9 KB ) - added by A_Pirard 10 years ago.

Download all attachments as: .zip

Change History (13)

by A_Pirard, 10 years ago

Attachment: ArcGIS-0.png added

by A_Pirard, 10 years ago

Attachment: ArcGIS-1.png added

by A_Pirard, 10 years ago

Attachment: wms.3857.zip added

by A_Pirard, 10 years ago

Attachment: wms.4326.zip added

comment:1 by wiktorn, 10 years ago

Indeed JOSM when quering WMS server for map doesn't always asks for same DPI on height and width. Some servers do correctly rescale in such situation, but others do not. I'm trying to get this to work this month.

The problem with projections is that currently, if you set projection in JOSM to EPSG:3857 and it is not supported by WMS server, it will try to query using EPSG:4326, though it will not change the size of the bbox.

comment:2 by wiktorn, 10 years ago

Owner: changed from team to wiktorn
Status: newassigned

comment:3 by wiktorn, 10 years ago

Component: CoreCore imagery
Keywords: WMS added; template_report removed

comment:4 by A_Pirard, 10 years ago

Thanks (a lot!) for taking care of this (and the rest!).

Please note that these are Arcgis servers and may not react exactly like WMS.
And that we are two steps away from supporting Arcgis export (like you want to support Argis WMTS, thanks !!!).
I may open another ticket for that if you ask.

The problem with projections is that currently, if you set projection in JOSM to EPSG:3857 and it is not supported by WMS server, it will try to query using EPSG:4326, though it will not change the size of the bbox

I was told that ArcGIS supports all projections.

Indeed JOSM when quering WMS server for map doesn't always asks for same DPI on height and width. Some servers do correctly rescale in such situation, but others do not.

To help you solve these points, I manually made up the following, working requests using 3857 on the failing server and anisotropically enlarging the image horizontally or vertically.

http://geoservices.wallonie.be/arcgis/rest/services/IGN/LIMITES_ADMINISTRATIVES/MapServer/export?&f=image&format=png8&dpi=90&transparent=True&SRS=EPSG:3857&bboxSR=3857&imageSR=3857&bbox=622922.4272812,6541196.9170170,623945.2884098,6542219.7781455&size=500,500
622922.4272812,6541196.9170170,
623945.2884098,6542219.7781455
extending xhigh: 2*623945.2884098-622922.4272812=624968.1495384=624968.1495384
http://geoservices.wallonie.be/arcgis/rest/services/IGN/LIMITES_ADMINISTRATIVES/MapServer/export?&f=image&format=png8&dpi=90&transparent=True&SRS=EPSG:3857&bboxSR=3857&imageSR=3857&bbox=622922.4272812,6541196.9170170,624968.1495384,6542219.7781455&size=1000,500

extending ylow: 2*6541196.9170170−6542219.7781455=6540174.0558885
http://geoservices.wallonie.be/arcgis/rest/services/IGN/LIMITES_ADMINISTRATIVES/MapServer/export?&f=image&format=png8&dpi=90&transparent=True&SRS=EPSG:3857&bboxSR=3857&imageSR=3857&bbox=622922.4272812,6540174.0558885,623945.2884098,6542219.7781455&size=500,1000

Hoping this will help

comment:5 by wiktorn, 9 years ago

Resolution: fixed
Status: assignedclosed

In 8526/josm:

Introduce WMS layer based on TMS. (closes: #11255)

HEADS UP: After this patch you need to manually remove JAX-B generated file/class: org/w3/_2001/xmlschema/Adapter1.java to compile the tree again.

  • create AbstractTileSourceLayer based on TMSLayer as a base for TMS, WMS and (future) WMTS layers, (addresses #11459)
  • WMS layer now uses JCS Caching (closes: #7363)
  • introduce new conversion methods in TileSource, that convert both X and Y (lat and lon) in one call. This is necessary for other than PseudoMercator projections
    • introduce TileXY class that represents X and Y indexes of tile in tile matrix/space
    • mark old conversion methods as deprecated
    • refactor JMapViewer and JOSM to new methods
    • change use of Coordinate class to ICoordinate where appropiate
  • extract CachedAttributionBingAerialTileSource to separate file
  • create TemplatedWMSTileSource that provides the WMS Layer with square (according to current projection) tiles (closes: #11572, closes: #7682, addresses: #5454)
  • implemented precaching imagery along GPX track for AbstractTileSourceLayer, so now it work for both - WMS and TMS (closes: #9154)
  • implemented common righ-click menu on map view, as well on layer list (closes #3591)
  • create separate build commands for JMapViewer classes to easily spot, when josm classes are used within JMapViewer
  • remove unnecessary classes of previous WMS implementation - GeorefImage, wms-cache.xsd (and JAXB task from build), WMSCache, WMSRequest, WMSGrabber, HTMLGrabber, WMSException

comment:6 by Don-vip, 9 years ago

Milestone: 15.07

comment:7 by A_Pirard, 9 years ago

Hi, am I supposed to see the solution in 8571?
When I use EPSG:3857 for the requests, the test case displays all-right AND IT'S GREAT !!!
With EPSG:4326, nothing displays. No problem as there us no reason to use it, I'm just being complete.
Small inconvenience: I see no longer a trace of the HTTP requests in sysout/syserr.

THANKS !!!

comment:8 by wiktorn, 9 years ago

Because in your URL you use EPSG:3857, see this part

bboxSR=3857&imageSR=3857

If you want to use different projection, you need to specify different projection here. And it should be aligned with your current projection set in JOSM. I haven't tested this, but this might be way to go with this servers.

comment:9 by Don-vip, 9 years ago

Milestone: 15.0715.08

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain wiktorn.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.