[GeoNetwork-devel] GeoNetwork 2.10 mapviewer and OSM

Hi

I’m working to allow OSM layers in the map viewers of the html5ui interface. The search map and big map seem fine, but the map viewer in the editor has some issues if the extents contains latitudes 90 or -90, seem values not allowed in mercator projection (when transformed from 4326 to mercator return invalid values).

Not sure what can be best solution, was checking to change the latitudes in ExtentMap.readFeature to -89.99/89.99 and then works ok, but that means changing the values introduced by the user.

Any ideas on how to manage this?

Regards,
Jose García


GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on GeoServer and GeoNetwork. Visit http://geocat.net for details.


Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net

On Wed, Oct 16, 2013 at 10:01 AM, Jose Garcia <jose.garcia@anonymised.com>wrote:

Hi

I'm working to allow OSM layers in the map viewers of the html5ui
interface. The search map and big map seem fine, but the map viewer in the
editor has some issues if the extents contains latitudes 90 or -90, seem
values not allowed in mercator projection (when transformed from 4326 to
mercator return invalid values).

Mercator cannot show values near 90 or -90 because the ordinate y becomes
infinity at the poles.

From openlayers doc:

"most spherical mercator maps use an extent of the world from -180 to 180
longitude, and from -85.0511 to 85.0511 latitude. Because the mercator
projection stretches to infinity as you approach the poles, a cutoff
in the north-south
direction is required, and this particular cutoff results in a perfect
square of projected meters. As you can see from the maxExtent parameter
sent in the constructor of the layer, the coordinates stretch from
-20037508.34 to 20037508.34 in each direction."

Not sure what can be best solution, was checking to change the latitudes in

ExtentMap.readFeature to -89.99/89.99 and then works ok, but that means
changing the values introduced by the user.

Any ideas on how to manage this?

* Limit the map extent to -85.0511 to 85.0511 latitude
* Use another projection. This implies that then you cannot use OSM.

Regards,
Juan Luis.

Hi Juan

Thanks for feedback. I’m going to commit to allow wmc config in the mapviewer and also OSM, but disabled by default. Users can enable it if they are aware of this issue for the map editor. Maybe other solution, but will be for 2.10.3 is to use always in the editor a map in 4326 and make configurable the map viewer only.

Regards,
Jose García

···

On Wed, Oct 16, 2013 at 10:17 AM, Juan Luis Rodríguez Ponce <juanluisrp@anonymised.com> wrote:


GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on GeoServer and GeoNetwork. Visit http://geocat.net for details.


Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net

On Wed, Oct 16, 2013 at 10:01 AM, Jose Garcia <jose.garcia@anonymised.com> wrote:

Hi

I’m working to allow OSM layers in the map viewers of the html5ui interface. The search map and big map seem fine, but the map viewer in the editor has some issues if the extents contains latitudes 90 or -90, seem values not allowed in mercator projection (when transformed from 4326 to mercator return invalid values).

Mercator cannot show values near 90 or -90 because the ordinate y becomes infinity at the poles.

From openlayers doc:

“most spherical mercator maps use an extent of the world from -180 to 180 longitude, and from -85.0511 to 85.0511 latitude. Because the mercator projection stretches to infinity as you approach the poles, a cutoff in the north-south direction is required, and this particular cutoff results in a perfect square of projected meters. As you can see from the maxExtent parameter sent in the constructor of the layer, the coordinates stretch from -20037508.34 to 20037508.34 in each direction.”

Not sure what can be best solution, was checking to change the latitudes in ExtentMap.readFeature to -89.99/89.99 and then works ok, but that means changing the values introduced by the user.

Any ideas on how to manage this?

  • Limit the map extent to -85.0511 to 85.0511 latitude
  • Use another projection. This implies that then you cannot use OSM.

Regards,
Juan Luis.

Hi,

Actually, you can deal with it pretty easly.

Run :
(new OpenLayers.Bounds(-180, -90, 180, 90)).transform(new OpenLayers.Projection(‘EPSG:4326’), new OpenLayers.Projection(‘EPSG:900913’));
in a simple OL exemple, you will see the result BBOX is good.

But when you have proj4j definition of EPSG:900913, then it fails cause it cannot compute near the pole.

So there is a trick to disable proj4j computation and use OL one’s even if proj4j projection is defined : set your projection.proj = null;

var p = new OpenLayers.Projection(‘EPSG:900913’));

p.proj = null;

and use p when you reproject your BBOX.

···

On Wed, Oct 16, 2013 at 10:17 AM, Juan Luis Rodríguez Ponce <juanluisrp@anonymised.com> wrote:


October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork


Florent Gravin
Camptocamp - Chambéry
0479444492

On Wed, Oct 16, 2013 at 10:01 AM, Jose Garcia <jose.garcia@anonymised.com> wrote:

Hi

I’m working to allow OSM layers in the map viewers of the html5ui interface. The search map and big map seem fine, but the map viewer in the editor has some issues if the extents contains latitudes 90 or -90, seem values not allowed in mercator projection (when transformed from 4326 to mercator return invalid values).

Mercator cannot show values near 90 or -90 because the ordinate y becomes infinity at the poles.

From openlayers doc:

“most spherical mercator maps use an extent of the world from -180 to 180 longitude, and from -85.0511 to 85.0511 latitude. Because the mercator projection stretches to infinity as you approach the poles, a cutoff in the north-south direction is required, and this particular cutoff results in a perfect square of projected meters. As you can see from the maxExtent parameter sent in the constructor of the layer, the coordinates stretch from -20037508.34 to 20037508.34 in each direction.”

Not sure what can be best solution, was checking to change the latitudes in ExtentMap.readFeature to -89.99/89.99 and then works ok, but that means changing the values introduced by the user.

Any ideas on how to manage this?

  • Limit the map extent to -85.0511 to 85.0511 latitude
  • Use another projection. This implies that then you cannot use OSM.

Regards,
Juan Luis.

Hi Florent

Great! Many thanks, testing it and seem fine.

Regards,
Jose García

···

On Wed, Oct 16, 2013 at 10:39 AM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Actually, you can deal with it pretty easly.

Run :
(new OpenLayers.Bounds(-180, -90, 180, 90)).transform(new OpenLayers.Projection(‘EPSG:4326’), new OpenLayers.Projection(‘EPSG:900913’));
in a simple OL exemple, you will see the result BBOX is good.

But when you have proj4j definition of EPSG:900913, then it fails cause it cannot compute near the pole.

So there is a trick to disable proj4j computation and use OL one’s even if proj4j projection is defined : set your projection.proj = null;

var p = new OpenLayers.Projection(‘EPSG:900913’));

p.proj = null;

and use p when you reproject your BBOX.


GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on GeoServer and GeoNetwork. Visit http://geocat.net for details.


Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net

On Wed, Oct 16, 2013 at 10:17 AM, Juan Luis Rodríguez Ponce <juanluisrp@anonymised.com> wrote:


October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork


Florent Gravin
Camptocamp - Chambéry
0479444492

On Wed, Oct 16, 2013 at 10:01 AM, Jose Garcia <jose.garcia@anonymised.com> wrote:

Hi

I’m working to allow OSM layers in the map viewers of the html5ui interface. The search map and big map seem fine, but the map viewer in the editor has some issues if the extents contains latitudes 90 or -90, seem values not allowed in mercator projection (when transformed from 4326 to mercator return invalid values).

Mercator cannot show values near 90 or -90 because the ordinate y becomes infinity at the poles.

From openlayers doc:

“most spherical mercator maps use an extent of the world from -180 to 180 longitude, and from -85.0511 to 85.0511 latitude. Because the mercator projection stretches to infinity as you approach the poles, a cutoff in the north-south direction is required, and this particular cutoff results in a perfect square of projected meters. As you can see from the maxExtent parameter sent in the constructor of the layer, the coordinates stretch from -20037508.34 to 20037508.34 in each direction.”

Not sure what can be best solution, was checking to change the latitudes in ExtentMap.readFeature to -89.99/89.99 and then works ok, but that means changing the values introduced by the user.

Any ideas on how to manage this?

  • Limit the map extent to -85.0511 to 85.0511 latitude
  • Use another projection. This implies that then you cannot use OSM.

Regards,
Juan Luis.