Geospatial mailing list archives

geospatial@odoo-community.org

Avatar

Re: Projection and Default Extent details

by
Camptocamp SA, Yannick Payot
- 27/04/2020 12:43:25
Hello Magnus,

Welcome, this mailing list is indeed the right place.

1/ The default projection is EPSG:3857 (EPSG:900913 is the same but the name is deprecated)
2/ The extent is the Openlayers extent format. https://openlayers.org/en/v3.20.1/apidoc/ol.extent.html (which is not much more helpful)
As map is automatically centered on the features you created.
The simplest way to get an idea of the extent you want might be to
- add a centered geometry where you want your extent
- reload the page
- get the result from this.source.getExtent()

3/ You would have to transform your decimal degree to the projection.
4/ vector layer (geometries aka features) can have a different projection than the raster layer (map background like osm)
The projection must be defined on the field in Python file.

Additionally, you might also want to configure the zoom level.

Yannick Vaucher
Business Solutions Architect

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 30
Office: +41 21 619 10 10


On Thu, 16 Apr 2020 at 07:12, Magnus Kriel <Magnus.Kriel@solnet.co.nz> wrote:
Hi all,

I searched the web for answers but could'n find any help. Hope this is the right place.

I'm trying to develop an app for our customer using the base_geoengine module.
When opening a map view, the default view is Europe somewhere. I can see the default extent is set to ('-123164.85222423, 5574694.9538936, 1578017.6490538, 6186191.1800898'). This must form 2 corners of a rectangle I presume so I tried many things to get New Zealand to show up but didn't succeed.

Can someone explain:
1 - what coordinate system is that?
2 - what each element is (bottom x,bottom y, top x, top y)?
3 - How can I use normal decimal degrees?
4 - If the map view uses a projection of EPSG:900913 must the vector layers also use EPSG:900913?

I have tried an extent of India using this but also failed:


Thanks,


Magnus Kriel

Software Developer, Solnet


Attention: This email may contain information intended for the sole use of the original recipient. Please respect this when sharing or disclosing this email's contents with any third party. If you believe you have received this email in error, please delete it and notify the sender or postmaster@solnetsolutions.co.nz as soon as possible. The content of this email does not necessarily reflect the views of Solnet Solutions Ltd.

_______________________________________________
Mailing-List: https://odoo-community.org/groups/geospatial-48
Post to: mailto:geospatial@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

Reference