Skip to main content
Question

Access a URL Zip file with shp file in it

  • January 21, 2021
  • 5 replies
  • 186 views

messagemauri
Contributor
Forum|alt.badge.img+6

I have an FME Desktop Workbench 2019, with a Reader transformer that reads a webstie zip file and its shapefile.

reader 

When I run this manually on Desktop it works fine and it can obtain the shapefile and read it.

 

I need to automate this to run daily. When I publish this workbench to FME Server and run it there, I get the following error:

 

49 ESRISHAPE Reader: Dataset `C:\\Users\\FME-SVC\\AppData\\Local\\Temp\\fmeengines\\CAL-FME-GIS_Engine1\\FME_TempFileStore_1611253240189_1116820\\PLA_RTF_SHP.zip' lacks the required extension `shp'

 

error 

What transformer can I use instead of the reader so it can work in FME Server? Or should I download the zip file with HTTPCaller, store it in the server and then attempt to read it from the server? But I need to read the shapefile in the zip file.

 

Is there a process or method anyone is familiar with to automate this in FME Server?

 

Thank you.

5 replies

hkingsbury
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • January 21, 2021

you need to specify the url like so: 

https://static.aer.ca/prd/data/wells/PLA_RTF_SHP.zip[**/*.shp]

It definitely confused me especially as it works without the asterisk on desktop.

Check out @mark2atsafe​ post here

https://community.safe.com/s/question/0D54Q000080hczoSAA/question-of-the-week-reading-and-writing-nested-zipped-shapefiles


messagemauri
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 21, 2021
hkingsbury wrote:

you need to specify the url like so: 

https://static.aer.ca/prd/data/wells/PLA_RTF_SHP.zip[**/*.shp]

It definitely confused me especially as it works without the asterisk on desktop.

Check out @mark2atsafe​ post here

https://community.safe.com/s/question/0D54Q000080hczoSAA/question-of-the-week-reading-and-writing-nested-zipped-shapefiles

Unfortunately, it's still giving me error. Even when I run in on Desktop. 

"Shape Reader: Failed to open dataset 'https://static.aer.ca/prd/data/wells/PLA_RTF_SHP.zip[**/*.shp]' which is neither an existing file nor directory"

 

parameter_error 


rahulsharma
Safer
Forum|alt.badge.img+10
  • Safer
  • January 21, 2021

Hi @messagemauri​ 

I was able to run the workspace pointing to https://static.aer.ca/prd/data/wells/PLA_RTF_SHP.zip using FME Desktop 2019.2 and FME Server 2019.2

see log attached

 

Can you check if you have Windows Long File Path enable?

It is possible when FME Server/Desktop is extracting the file which may be exceeding the character limit of 260. See the article Enable Long file path to resolve the issue.


messagemauri
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 22, 2021
rahulsharma wrote:

Hi @messagemauri​ 

I was able to run the workspace pointing to https://static.aer.ca/prd/data/wells/PLA_RTF_SHP.zip using FME Desktop 2019.2 and FME Server 2019.2

see log attached

 

Can you check if you have Windows Long File Path enable?

It is possible when FME Server/Desktop is extracting the file which may be exceeding the character limit of 260. See the article Enable Long file path to resolve the issue.

Thanks @hkingsbury​ and @rahulsharma​ . Much appreaciated. I 'm still getting the error.

 

So what I did is a workaround by introducing an httpcaller to download the zip file to store it in a folder in FME Server, and then added a FeatureReader to access the zip file in that folder in FME Server which then accesses the shapefile and reads it. Thanks again for your help.

 

solution


hkingsbury
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • January 24, 2021
messagemauri wrote:

Thanks @hkingsbury​ and @rahulsharma​ . Much appreaciated. I 'm still getting the error.

 

So what I did is a workaround by introducing an httpcaller to download the zip file to store it in a folder in FME Server, and then added a FeatureReader to access the zip file in that folder in FME Server which then accesses the shapefile and reads it. Thanks again for your help.

 

solution

A good transformer to use in this case is a TempPathnameCreator. This will create a temporary file name that you can use in the HTTPCaller as a download location and subsequently as a read location for the FeatureReader.

 

The created location will then be deleted at the end of the process


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings