DOI-USGS / fort-pymdwizard

The MetadataWizard is a useful tool designed to facilitate FGDC metadata creation for spatial and non-spatial data sets. It is a cross-platform desktop application built using an open-source Python architecture.
https://usgs.github.io/fort-pymdwizard/
Other
62 stars 21 forks source link

Auto-populating spatial reference #150

Open pberkowitz-kfs opened 2 years ago

pberkowitz-kfs commented 2 years ago

Email sdmapps@usgs.gov if you wish to contact the USGS Science Data Management (SDM) team’s application support inbox directly with bugs or feature requests. Otherwise, use the template below.

When I browse to a spatial dataset to try to bring in the spatial reference system, I get the following message in a popup window: "Problem encountered extracting bounding coordinates. Problem encountered extracting spatial reference."

From Spatial tab, click and open any shapefile. My co-worker tried this procedure for a TIFF file and received the same message.

We expected the MW to load the spatial reference info from the file we browsed to (either a SHP file or TIFF).

OS: Windows 10 MW version 2.0.7

aritchie-usgs commented 2 years ago

I encounter the same problem trying to extract spatial reference from a 13GB COG geotiff. Wondering if the problem is related to either the size (BIGTIFF) or the format (COG).

problem was reproduced on a local copy of a 13GB COG GeoTiff I made as part of an emergency data release, available here:

https://cmgp-sfm-public-read-bucket.s3.us-west-2.amazonaws.com/aritchie/2020_CZU_Fire/USGS_PCMSC_RSCC_CZU_20201104-05_ortho_NAD83_2011_UTM10_COG.tif

Joshdpaul commented 1 year ago

I am having the same issue. Windows 10, MetadataWizard 2.0.7.

The tool failed to load a simple bounding box shapefile only 1KB in size. Thinking that my projection may be the issue (Alaska Albers), I also tried with a reprojected version of the shapefile in WGS84. Result was the same. Both files are in the zip attached here if anyone wants to test them.

box.zip

tnorkin commented 1 year ago

@Joshdpaul, In the cases we've seen where the Metadata Wizard can't parse geospatial files, there's often something going on with the gdal python library on the user's machine. It only shows up for some users and we think it has to do with environment settings.

First, if your version of the Metadata Wizard was installed prior to June 2022, I'd recommend getting the most recent version from the releases page and reinstalling. There have been some recent minor updates that have solved the issue for some users.

If reinstalling the Wizard doesn't work for you, I'd recommend taking a look at your environment settings as the next step. If there's anything relating to an instance of gdal that's external to the Wizard, I'd recommend taking a look and possibly removing that setting. If a user has more than one copy of gdal installed (the Metadata Wizard contains its own copy of gdal), it's possible that the application is pointing to the wrong copy.

If you'd like additional support, please contact us at ask-sdm@usgs.gov and we can take a closer look at the errors you're running into.

Joshdpaul commented 1 year ago

@tnorkin ,

Thank you very much for the response, your advice led me in the right direction. I checked my Windows system variables and both the GDAL_PATH and PROJ_LIB variables were referencing a PostGreSQL package installed in one of my conda environments. After deleting both of these system variables and restarting, the shapefile import in the Metadata Wizard now works as expected.

tnorkin commented 1 year ago

@Joshdpaul, Excellent, thanks for letting us know it worked out, and also which updates you made to fix the issue.