Projection EPSG:4839 Issue

Skip to first unread message

Miroslav Sabo

unread,
May 15, 2021, 6:26:04 AM5/15/21
to mapstore-developers
Dear MapStore Developers,

we have a problem with projection https://epsg.io/4839
It's defined in localConfig.json as follows: 

"projectionDefs": [{
    "code": "EPSG:4839",
    "def": "+proj=lcc +lat_1=48.66666666666666 +lat_2=53.66666666666666 +lat_0=51 +lon_0=10.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
    "extent": [-2548168.31, -1577095.90, 447411.34, 4109159.94],
    "worldExtent": [-16.1, 32.88, 40.18, 84.17 ]
  }]
  .
  .
  .
  "desktop": [
  .
  .
  .
"name": "CRSSelector",
              "cfg": {
                "additionalCRS": {
"EPSG:4839": {
"label": "4839"
}
However, when we load the data from GeoServer via WMS service, data is not at the right coordinates and when we zoom-in/zoom-out the data is moved randomly. 
We suspect that WMS request parameters (BBOX, WIDTH, HEIGHT) may be incorrect.
Also, the 'Open Street Map' background seems to be displayed correctly, but the 'Sentinel 2 Cloudless' is incorrect (please see attached 'sentinell_2_cloudless.PNG)


Could you please advise us if we are doing something wrong? 
Is the definition of projection incorrectly defined? (We have set the properties from https://epsg.io/4839 as suggested here: https://mapstore.readthedocs.io/en/latest/developer-guide/local-config/#projectiondefs-configuration).

I have attached localConfig.json and map.json. 

Thanks for a response. 

Regards
Miroslav Sabo
map.json
invalid_data_epsg_4839.PNG
localConfig.json
valid_data_epsg_3857.PNG
sentinel_2_cloudless.PNG

Mauro Bartolomeoli

unread,
May 17, 2021, 1:55:07 AM5/17/21
to mapstore-...@googlegroups.com
Good morning Miroslav,
I had a quick look at the EPSG:4839 definition here: https://epsg.io/4839

From the description, I understood axes are inverted (y, x) and this should explain your issues.
To fix it you should try to add +axis=neu to the proj4 definition, to take care of the axis inversion.

Let me know if this works for you.

Mauro


--
You received this message because you are subscribed to the Google Groups "mapstore-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-develo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mapstore-developers/d3907a38-15fa-4160-bc1a-3631c7a25726n%40googlegroups.com.


--

Regards,

Mauro Bartolomeoli

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

mobile: +39 393 904 1756
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Miroslav Sabo

unread,
May 17, 2021, 3:21:47 AM5/17/21
to mapstore-developers
Hi Mauro, 

thank you very much for the response.
Your solution works great and the problem with the data displaying seems to be fixed with this modification of projection definition. 
However, the Open Street Map background has now inverted axis (please see osm.PNG). 

Is there any way that this can be fixed by modifying configuration? 

Regards,
Miroslav Sabo

osm.PNG

Mauro Bartolomeoli

unread,
May 17, 2021, 5:57:31 AM5/17/21
to mapstore-...@googlegroups.com
Hi Miroslav,
I believe this is "expected". At least, mouse coordinates are correctly aligned with the OSM map. Can you confirm that also the points rendered by your GeoServer and that I can see on the screenshot are in the right place?

Mauro


Miroslav Sabo

unread,
May 17, 2021, 6:17:08 AM5/17/21
to mapstore-developers
Yes, all points rendered by GeoServer are in the right place. 

This means that I would have to configure map so that this projection is not available for Open Street Map background? 
Is there any other solution possible? 

Thanks. 

Miroslav

Mauro Bartolomeoli

unread,
May 17, 2021, 6:58:26 AM5/17/21
to mapstore-...@googlegroups.com
Hi Miroslav,


Il giorno lun 17 mag 2021 alle ore 12:17 Miroslav Sabo <smi...@gmail.com> ha scritto:
Yes, all points rendered by GeoServer are in the right place. 

This means that I would have to configure map so that this projection is not available for Open Street Map background? 
Is there any other solution possible? 

I did another test, setting axis direction as an openlayers property, instead of a proj4 one, with the following settings:

"projectionDefs": [{
      "code": "EPSG:4839",
      "def": "+proj=lcc +lat_1=48.66666666666666 +lat_2=53.66666666666666 +lat_0=51 +lon_0=10.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
      "extent": [-2548168.31-1577095.90447411.344109159.94],
      "worldExtent": [-16.132.8840.1884.17 ],
      "axisOrientation": "neu"
    }],
 

Let me know if this works better.

Mauro

Miroslav Sabo

unread,
May 17, 2021, 7:40:32 AM5/17/21
to mapstore-developers
Hi Mauro, 

This solution works great!
Thank you very much, you've been really helpful. 

Best Regards,
Miroslav Sabo

Reply all
Reply to author
Forward
0 new messages