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

Correct .split() calls to only split numeric srid for ArcgisRest #12378

Merged
merged 5 commits into from
Jun 16, 2021

Conversation

mike-000
Copy link
Contributor

@mike-000 mike-000 commented Jun 6, 2021

Fixes #12377

Ensuring the split only works for numeric srid has the advantage that the projection code can be set to a custom Arcgis SpatialReference definition (which would contain a :) without it being broken.

@ahocevar
Copy link
Member

ahocevar commented Jun 7, 2021

Currently this pull request only changes whitespace and adds newlines. Did you mean to do something else?

@mike-000
Copy link
Contributor Author

mike-000 commented Jun 7, 2021

My intention was to prevent arbitrarily splitting custom codes which are meaningful to Arcgis but do not have a numeric srid (although they do contain :) https://codesandbox.io/s/arcgis-image-forked-kuo1u?file=/main.js

@murdocha
Copy link

murdocha commented Jun 7, 2021

Does the new regex in this PR update allow a spatial reference param to be something as complex as:

{"wkt":"PROJCS[\"WGS_1984_Web_Mercator_Auxiliary_Sphere\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Mercator_Auxiliary_Sphere\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-71.68417519999998],PARAMETER[\"Standard_Parallel_1\",0.0],PARAMETER[\"Auxiliary_Sphere_Type\",0.0],UNIT[\"Meter\",1.0]]"}

(a WMAS projection with a custom central meridian around Massachusetts, US)
?
That was hard for me to visually make out without testing the code against a string like this...

Currently only a "real" EPSG code can be passed in to the OL code for ImageArcGISRest sources.
That was the initial issue I reported earlier here:
#12377

UPDATE: YES, this does seem to work with a custom projection code as shown in the codesandbox above. The work around referenced in the original issue comments also works, but this PR would also make this work (with much less effort for the next person to attempt this!)

Copy link
Member

@ahocevar ahocevar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mike-000.

@ahocevar ahocevar merged commit a5e596c into openlayers:main Jun 16, 2021
@mike-000 mike-000 deleted the patch-5 branch September 9, 2021 08:38
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

Successfully merging this pull request may close these issues.

Allow custom WKT string projection parameters (BBOXSR and IMAGESR) for ImageArcGISRest sources
3 participants