koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
101 stars 32 forks source link

Labels in ArcGIS Dashboard with transformed coordinates #181

Open kamil-novak opened 4 years ago

kamil-novak commented 4 years ago

Hello @rgwozdz, Can I ask you one more question about this issue. After using your workaround is all right. But now I have noticed that in ArcGIS Dashboards (web version) I can't display labels for Koop feature layer with this workaround. When I cancel this workaround, labels are displayed. This issue is only in Dashboard application. Other interfaces (Map Viewer 3.x or 4.x, application in JS API 4.x) are OK. Is there any solution for this? Thanks

Originally posted by @wellbloud-cz in https://github.com/koopjs/FeatureServer/issues/169#issuecomment-626639785

81560849-81c68200-9392-11ea-81fb-eb011a25d1f5

keithfraley commented 4 years ago

This is an issue with using labels of portal items in db

On Wed, May 13, 2020, 5:23 AM wellbloud-cz notifications@github.com wrote:

Hello @rgwozdz https://github.com/rgwozdz, Can I ask you one more question about this issue. After using your workaround is all right. But now I have noticed that in ArcGIS Dashboards (web version) I can't display labels for Koop feature layer with this workaround. When I cancel this workaround, labels are displayed. This issue is only in Dashboard application. Other interfaces (Map Viewer 3.x or 4.x, application in JS API 4.x) are OK. Is there any solution for this? Thanks

*Originally posted by @wellbloud-cz https://github.com/wellbloud-cz in

169 (comment)

https://github.com/koopjs/FeatureServer/issues/169#issuecomment-626639785*

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/koopjs/FeatureServer/issues/181, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6LCVCV7YRFP7NBSQCCXL3RRJYJXANCNFSM4M7TYIDA .

kamil-novak commented 4 years ago

Sorry, I don't understand it. Could you explain it me? It seems that it is really related to workaround for coordinates transformation (as I described). Thanks.

rgwozdz commented 4 years ago

@wellbloud-cz can you refresh me regarding which workaround you are doing, and why. I think it's because you're data needs to be served in a particular projection, but can you provide the details?

keithfraley commented 4 years ago

A koop feature service that is saved with proper labeling as an item in the portal does not render those saved labels in dashboard. The work around is to slightly change something about the item (size or color of label maybe) and NOT save back as item, save the webmap, now the koop feature service rendering and labels are save at a map level, and they will work. There is an issue with opsdb rendering koop feature service labels that are stored as an item in the portal.

Regards Keith

On Tue, May 19, 2020 at 9:04 AM Rich Gwozdz notifications@github.com wrote:

@wellbloud-cz https://github.com/wellbloud-cz can you refresh me regarding which workaround you are doing, and why. I think it's because you're data needs to be served in a particular projection, but can you provide the details?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/koopjs/FeatureServer/issues/181#issuecomment-630840525, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6LCVDR7GXOJTX6QJC3AA3RSKGV5ANCNFSM4M7TYIDA .

kamil-novak commented 4 years ago

A koop feature service that is saved with proper labeling as an item in the portal does not render those saved labels in dashboard. The work around is to slightly change something about the item (size or color of label maybe) and NOT save back as item, save the webmap, now the koop feature service rendering and labels are save at a map level, and they will work. There is an issue with opsdb rendering koop feature service labels that are stored as an item in the portal. Regards Keith On Tue, May 19, 2020 at 9:04 AM Rich Gwozdz @.***> wrote: @wellbloud-cz https://github.com/wellbloud-cz can you refresh me regarding which workaround you are doing, and why. I think it's because you're data needs to be served in a particular projection, but can you provide the details? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#181 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6LCVDR7GXOJTX6QJC3AA3RSKGV5ANCNFSM4M7TYIDA .

Thanks for your explanation. I tried to do your workaround in the past, but it doesn't go to success. Regards Kamil

kamil-novak commented 4 years ago

@wellbloud-cz can you refresh me regarding which workaround you are doing, and why. I think it's because you're data needs to be served in a particular projection, but can you provide the details?

It was workaround for reprojecting data to WGS84 using proj4 using pseudocode below:

// fetch data from source

// reproject data to WGS84 using proj4

if (req.query.outSR === 5514 || req.query.outSR === 102067) {
  req.query.outSR = `PROJCS["S-JTSK / Krovak East North",GEOGCS["S-JTSK",DATUM["System_Jednotne_Trigonometricke_Site_Katastralni",SPHEROID["Bessel 1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],TOWGS84[589,76,480,0,0,0,0],AUTHORITY["EPSG","6156"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4156"]],PROJECTION["Krovak"],PARAMETER["latitude_of_center",49.5],PARAMETER["longitude_of_center",24.83333333333333],PARAMETER["azimuth",30.28813972222222],PARAMETER["pseudo_standard_parallel_1",78.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","5514"]]`
}

// Check for spatial query in your specific project
const { geometry = {}, inSR } = req.query
const { spatialReference: { latestWkid, wkid } = {} } = geometry
const geomFilterSRs = [latestWkid, wkid, inSR]
if (geomFilterSRs.includes(102067) || geomFilterSRs.includes(5514)) {
  delete req.query.geometry.spatialReference
  req.query.inSR = `PROJCS["S-JTSK / Krovak East North",GEOGCS["S-JTSK",DATUM["System_Jednotne_Trigonometricke_Site_Katastralni",SPHEROID["Bessel 1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],TOWGS84[589,76,480,0,0,0,0],AUTHORITY["EPSG","6156"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4156"]],PROJECTION["Krovak"],PARAMETER["latitude_of_center",49.5],PARAMETER["longitude_of_center",24.83333333333333],PARAMETER["azimuth",30.28813972222222],PARAMETER["pseudo_standard_parallel_1",78.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","5514"]]`
}

When I remove this pseudocode from Koop, I can display labels in Dashboard. Kamil

rgwozdz commented 4 years ago

@wellbloud-cz This sounds like a limitation of Dashboard. Perhaps Dashboard has issues with data served in non-standard projections? Have you tried adding data (in projection 5514/102067) to dashboard from a non-Koop source? Curious if labels work in that scenario.

kamil-novak commented 4 years ago

Other feature services from ArcGIS Server (in projection 5514/102067) are OK: Image 001

rgwozdz commented 4 years ago

Can you share the URL to the Dashboard?

kamil-novak commented 4 years ago

Here is URL to the Dashboard: http://mestomost.maps.arcgis.com/apps/opsdashboard/index.html#/9e522cb6f8374c30bb76f11d551a9205

rgwozdz commented 4 years ago

Nothing loads, is that what you are seeing? Looking at the network tab, Portal calls are returning: Item does not exist or is inaccessible.

kamil-novak commented 4 years ago

Sorry for my delay. It was issue with DNS. Now, it would be OK. Dashboard is avaiable here https://arcg.is/0Kizza