What happened to the ESRI file in the mapping toolbox projection files in 2020b PR?

4 vues (au cours des 30 derniers jours)
Thomas Watson
Thomas Watson le 19 Juin 2020
Commenté : Kelly Kearney le 19 Juin 2020
Prior to 2020b PR, there was an 'esri' file inside MATLAB\R20xx\toolbox\map\mapproj\projdata\proj that was used by 3rd party code like shaperead2 https://github.com/gdherbert/MatLab_Shaperead2
This file was read in as a sort of lookup table for what projection to use on the .prj file's WKT PROJCS field. E.g., if a .prj file's WKT had PROJCS["WGS 84 / UTM zone 10S", it would be associated with "<32710> +proj=utm +zone=10 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs no_defs <>" from the ESRI file, and the various attributes would be parsed out (+proj, +zone, etc) and used to construct an mstruct.
As of 2020b PR, the ESRI file seem to have been removed, and shaperead2 fails to work as it required that ESRI file.
I've tried looking for any mapping toolbox related functions that might have been added to fill the gap, such as something that reads from the new proj.db SQLite database and possibly does an alias to projection lookup, but I haven't found anything.
What do I have to do moving forward to get this to work in 2020b and on?

Réponses (2)

Kelly Kearney
Kelly Kearney le 19 Juin 2020
I'm not sure if this will work for your use case, but I wrote my shapeprjread function to parse certain projected shapefiles. It's somewhat limited, given that I don't myself work with ArcGIS and therefore have never gotten a full list of the possible projections, so it only supports the following projection so far (column 1 = .proj file projection name, column 2 = Mapping Toolbox projection name):
'Transverse_Mercator' 'tranmerc'
'Albers' 'eqaconicstd'
'Albers Conical Equal Area' 'eqaconicstd'
'Lambert_Azimuthal_Equal_Area' 'eqaazim'
But I've found that this covers the vast majority of projected shapefiles I need to read in. And it doesn't require any external ESRI-based dependencies.
If I get some time, I may take a look at that proj.db database to see if it might fill in some of the remaining gaps...
  1 commentaire
Kelly Kearney
Kelly Kearney le 19 Juin 2020
As a followup, if you get the error "Need to add this projection to the list", that's a really fast fix. It means that the prjread function read in all the necessary info, but I just hadn't encountered that projection name yet, so need to add a translation to the table shown above. Just let me know what the new projection name is and I'll add it.

Connectez-vous pour commenter.

Steven Lord
Steven Lord le 19 Juin 2020
Please do not ask questions about the prerelease here on Answers. Send those questions / feedback to Technical Support using the telephone icon in the upper-right corner of this page.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by