I´m using the FeatureColorSetter for create color and fill features, but the output file don´t change. Why?
Thank´s
I´m using the FeatureColorSetter for create color and fill features, but the output file don´t change. Why?
Thank´s
Hi @mr_fme
What kind of geometry are you try to color? To write what format?
Thanks,
Danilo
Hi @mr_fme
What kind of geometry are you try to color? To write what format?
Thanks,
Danilo
https://knowledge.safe.com/questions/73366/how-to-define-shapefile-output-outline-color-and-f.html
Thanks,
Danilo
https://knowledge.safe.com/questions/73366/how-to-define-shapefile-output-outline-color-and-f.html
Thanks,
Danilo
Thank´s for your attention @danilo_fme
Hello FME'ers
In the week that we hosted a webinar all about the Shapefile format, it's appropriate to have a question-of-the-week on the same subject.
Question of the WeekThis week's question came from a user on Live Chat and concerns how to read Shapefiles nested inside multiple folders inside a compressed Zip file.
Q) I have a URL for a “zipped” shapefile. However, the shapefile is actually nested two folders into the zip file.
If I download this file from the browser and set the Shapefile reader dataset to:
/Users/[username]/Downloads/MajorRoads.zip/**/**/*.shp
...then this is read in properly by FME. However when applying a similar logic to a URL:
http://[server]/data/downloads/roads.zip/**/**/*.shp
...then FME fails to read the shapefile. The download begins but errors when trying to create feature types.
Is this the expected behaviour?
A) There are two forms of what we might call "path filtering."
The older style - which you are trying to use - is now obsolete, and won't work with URLs because we can't tell where the URL ends and the path begins.
However, there is a newer style of path filtering that will resolve the issue. Let's see how - and also look at an update for writing nested zipped Shapefiles in 2020.
Placed in the Same Bracket
The new syntax for handling nested zip files relies on using square brackets, namely [ and ].
In the FME documentation, the usage notes for Reading Archive Files explains how this works:
Basically, you put square brackets around the part that represents folders inside the zip file. In the above example, the path you set to read directly from the URL should look like this:
http://[server]/data/downloads/roads.zip[**/**/*.shp]
Now it will work fine.
It's Full of Stars!Oh, you may have noticed that having two sets of
**
characters is actually redundant. That's because **
means recurse down the whole depth of the path until you find a file. So you would only ever need one of these.So the path above should really be:
http://[server]/data/downloads/roads.zip[**/*.shp]
Unless you wanted to go exactly two levels deep, in which case the URL would look like this:
http://[server]/data/downloads/roads.zip[*/*/*.shp]
It's a minor issue, but worth getting right.
Writing Nested Zipped ShapefilesOn a similar topic, a recent update improves the capability to write nested zipped datasets. This scenario isn't where there is a series of nested folders in the output zip file, but where we want a series of nested zip files, inside one another.
For example, say you wanted to write the following output:
c:\[folder]\Output.zip\Shapefiles.zip\PrimaryRoads.zip
...where there is a zip file of output, that contains a zip file of Shapefiles, that contains a zip file of roads!
Another use for this is in FME Server Data Downloads. The Data Download service creates its own zip files when it writes the output datasets. But if you specify the output dataset was also to be a zip file, then that would be nested zips.
Up until recently, this would not work (as discovered by users here and here) because the zipped output dataset could not be nested.
I actually tweeted that this could be done:
...but I think I was wrong. This couldn't be done. What I was getting was a zipped file inside a plain folder that just happened to have .zip in its name (hey, it's an easy mistake to make).
However, in FME2020 I can do things like this:
...and create one zipped file inside another. I can even create fanouts like:
c:\[folder]\Output.zip\Parks.zip\[NeighborhoodName].zip
Plus you can now deploy writing zipped datasets to a Data Download service on FME Server!
Thanks to @andreaatsafe, Graeme, and Harbinder (the latter two are developers at Safe) for providing this information.
Other Notable QuestionsHere are some other interesting questions:
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.