[Oskari-user] Coordinate tool implementation

Mäkinen Sami (MML) sami.makinen at maanmittauslaitos.fi
Tue Aug 14 06:57:30 PDT 2018


Hi,

Here's the bundle documentation for the functionality: http://www.oskari.org/api/bundles#1.47.0/mapping/coordinatetool

So what you need to do is update the configuration of that bundle in the database. You need to change the config column in portti_view_bundle_seq for the view (appsetup). You can do this manually or with an Flyway-migration script for your application (http://oskari.org/documentation/backend/upgrading).

For manually updating you can run something like this on your database:

update portti_view_bundle_seq set config='{ ... this is the json to configure supported projections ... }' where bundle_id = (select id from portti_bundle where name = 'coordinatetool') and view_id = [the id of the appsetup you want to update]

You can check the current config of any Oskari instance by calling it's GetAppSetup action route. For example in paikkatietoikkuna (PTI): https://kartta.paikkatietoikkuna.fi/action?action_route=GetAppSetup

The coordinatetool bundle config in PTI is:
{"isReverseGeocode":true,"reverseGeocodingIds":"WHAT3WORDS_CHANNEL","supportedProjections":["EPSG:3067","NLSFI:etrs_gk","NLSFI:ykj","EPSG:4258","LATLON:kkj","EPSG:3046","EPSG:3048","EPSG:3873","EPSG:3874","EPSG:3875","EPSG:3876","EPSG:3877","EPSG:3878","EPSG:3879","EPSG:3880","EPSG:3881","EPSG:3882","EPSG:3883","EPSG:3884","EPSG:3885"],"showEmergencyCallMessage":true,"projectionShowFormat":{"decimals":3,"format":"metric","EPSG:4258":{"decimals":3,"format":"degrees"},"LATLON:kkj":{"decimals":3,"format":"degrees"},"EPSG:3067":{"decimals":0}}}

Note that not all of the projections are recognized by GeoTools so you will need to add a dependency on your webapp if you want to use the exact same ones as in PTI: https://github.com/nls-oskari/kartta.paikkatietoikkuna.fi/blob/master/webapp-map/pom.xml#L40-L44


You also need to add this to Oskari-ext.properties:

# Used by Coordinates action route
projection.library.class=fi.nls.oskari.NLSFIPointTransformer

If you don't need any of the non-numeric coordinatesystems you can probably just modify the database and skip adding the dependency and properties config.

Also if you want to use a Flyway migration to update the config (helps updating users personalized views if they are available in your setup). Here's an example from paikkatietoikkuna for migrating configuration for coordinatetool bundle: https://github.com/nls-oskari/kartta.paikkatietoikkuna.fi/blob/master/server-extension/src/main/java/flyway/paikkis/V2_4__fix_coordinatetool_decimals_for_3067_projection.java

           Sami

Lähettäjä: Oskari-user [mailto:oskari-user-bounces at lists.osgeo.org] Puolesta Keijo Kangas
Lähetetty: 14. elokuuta 2018 15:38
Vastaanottaja: Oskari-user at lists.osgeo.org
Aihe: [Oskari-user] Coordinate tool implementation

Hello, I am interested to know how can I set multiple coordinate system selection to coordinate tool at the Oskari map view. For example paikkatietoikkuna.fi has multiple coordinate systems to choose from.


Keijo Kangas
+358 40 480 9035
Sovelluskehittäjä
www.kuntotekniikka.fi<http://www.kuntotekniikka.fi/>
www.facebook.com/kuntotekniikka<http://www.facebook.com/kuntotekniikka>

[kt]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/oskari-user/attachments/20180814/d2b88f5a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 9013 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/oskari-user/attachments/20180814/d2b88f5a/attachment-0001.png>


More information about the Oskari-user mailing list