Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profile from imported geojson fails #12

Closed
landryb opened this issue Aug 10, 2023 · 11 comments
Closed

profile from imported geojson fails #12

landryb opened this issue Aug 10, 2023 · 11 comments

Comments

@landryb
Copy link
Member

landryb commented Aug 10, 2023

i know there's been a plugin added to mapstore upstream in geosolutions-it/MapStore2#9241 so maybe this external extension will get abandoned/deprecated, but in the meantime i've been testing it and it works fine drawing a path.

trying to import a geojson fails though, it's a simple track layer exported from a gpx and converted to geojson by ogr2ogr. The geojson opens fine in QGIS.

{
"type": "FeatureCollection",
"name": "tracks",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ -3.5666038, 48.5669807 ], [ -2.2671762, 48.3337006 ], [ -2.2644037, 48.3312888 ], [ -2.2619289, 48.329049 ] ], [ [ -1.759059, 48.1321608 ], [ -1.7504625, 48.1286136 ], [ -1.727597, 48.121595 ], [ -1.7245246, 48.1207623 ], [ -1.7218638, 48.1199605 ] ] ] } }
]
}
@landryb
Copy link
Member Author

landryb commented Aug 10, 2023

my file was x.geojson, if i name it x.json the error message is different:

The projection of the file(s) you're trying to import is not supported

so the code in https://github.com/georchestra/mapstore2-longitudinal-profile/blob/main/js/extension/enhancers/processFile.js#L26 doesnt accept a geojson extension ?

@landryb
Copy link
Member Author

landryb commented Aug 10, 2023

per https://github.com/georchestra/mapstore2-longitudinal-profile/blob/main/js/extension/epics/setup.js#L75 apparently the only supported projections are the one defined in localConfig.json in the projectionDefs array.

trying with my geojson file converted to EPSG:2154 and named x.json, mapstore2 crashes:

TypeError: t is null
    dt https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/732.6f4cc90b.js:2
    mt https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/732.6f4cc90b.js:2
    le https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/LongitudinalProfileModule.5db2373d.js:1
    Vt https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/LongitudinalProfileModule.5db2373d.js:1
    useFlattenFeatures https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/LongitudinalProfileModule.5db2373d.js:1
    handlers https://georchestra.dev.craig.fr/mapstore/dist/geOrchestra.js?d158d48d3bd1ebf992cd:2
    Yt https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/LongitudinalProfileModule.5db2373d.js:1

@landryb
Copy link
Member Author

landryb commented Aug 10, 2023

guess i'll try first to rebuild the profile extension (as seen in georchestra/mapstore2-cadastrapp#182), pointing the ms2 submodule to what's in ms2-geor 2023.02rc2. Or maybe i'll just give up on this external extension and just use the one shipped in ms2 :)

@jusabatier
Copy link
Collaborator

Can you share how to use the one shipped in Mapstore if you succed ?

Maybe we should use this one as default if it work, and remove this repo ?

@landryb
Copy link
Member Author

landryb commented Aug 10, 2023

i've renamed the LongitudinalProfile section in my localConfig.json to LongitudinalProfileTool, adapted some config names according to https://github.com/geosolutions-it/MapStore2/pull/9253/files#diff-e6f1d3d7c5d7c62ef430ed24846fe12e7fde1d0bae0acef07983599260d7100dR34:

{
  "name":"LongitudinalProfileTool",
    "cfg": {
      "wpsurl":"/geoserver/wps",
      "identifier":"gs:ProfilEnLong",
      "referentials":[
        {
          "layerName":"geor:rgealti_region_5m_mnt_2021",
          "title":"RGE ALTI 5m"
        }
      ],
      "distances":[1,5,10,50,100,500,1000,5000],
      "defaultDistance":100,
      "defaultReferentialName":"RGE ALTI 5m"
     }
 },

i have the new extension icon in the sidebar:
image

but it seems my configuration isnt applied, eg in the params i dont have the list of referentials, and if trying to draw a path the WPS process called is gs:LongitudinalProfile (eg the default in the code) instead of the one i specified. So maybe it needs to be added to the ms2-geor build somewhere so that it can be 'enabled' or configured ?

i've tried and it isnt in the list of available plugins to add in a context (as the PR mentions it isnt enabled by default and can only be added in a context..)

it isnt documented yet either on https://mapstore2.geosolutionsgroup.com/mapstore/docs/api/plugins

@landryb
Copy link
Member Author

landryb commented Aug 10, 2023

coming back to this external extension, rebuilt it locally by changing the mapstore2 submodule to point at geosolutions-it/MapStore2@c4f94e3b7b like 2023.02rc2, loading the EPSG:2154 json file, mapstore still blows hard.

TypeError: t is null
    dt https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/815.32bd662e.js:2
    mt https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/815.32bd662e.js:2
    le https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/LongitudinalProfileModule.4afc400c.js:1
    lr https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/LongitudinalProfileModule.4afc400c.js:1
    useFlattenFeatures https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/LongitudinalProfileModule.4afc400c.js:1
    handlers https://georchestra.dev.craig.fr/mapstore/dist/geOrchestra.js?d158d48d3bd1ebf992cd:2
    ur https://georchestra.dev.craig.fr/mapstore/extensions/LongitudinalProfile/assets/js/LongitudinalProfileModule.4afc400c.js:1

seems to point at https://github.com/georchestra/mapstore2-longitudinal-profile/blob/main/js/extension/enhancers/useFile.js#L18 or around there..

@landryb
Copy link
Member Author

landryb commented Aug 10, 2023

after adding this section https://github.com/geosolutions-it/MapStore2/blob/6a95a9fb293dcabbe320c790a0c322b3512055e1/web/client/configs/pluginsConfig.json#L643 to pluginsConfig.json i can add the ms2 builtin plugin in a context, but the configuration isn't applied (even if saved in the plugin config in the context).

@tdipisa which way should it work ? was the plugin config override properly tested ?

should we drop this external plugin, and move our platforms to use the one coming from ms2 ?

@catmorales
Copy link

catmorales commented Nov 10, 2023

@landryb I dont know if it can help but I've tried recently to use it and I saw in the documentation that the new WPS can be used with the 2.20 geoserver release only (we are in 2.18) :
image

@landryb
Copy link
Member Author

landryb commented Nov 13, 2023

@landryb I dont know if it can help but I've tried recently to use it and I saw in the documentation that the new WPS can be used with the 2.20 geoserver release only (we are in 2.18) : image

i dont think it matters since the wps gs extension itself works fine for this external extension; the above doc is for the plugin that was added to mapstore core (but the code should be the same anyway)

@landryb
Copy link
Member Author

landryb commented Jan 25, 2024

closing this issue because:

@landryb landryb closed this as completed Jan 25, 2024
@catmorales
Copy link

catmorales commented Feb 12, 2024

I'm using this plugin because we are still with a 2.17 geoserver and thevnew front is not available with Julien's WPS . Thank you so much Landry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants