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

Error: There are no KML files to load from the base directory with this filter #3

Open
boomvalk opened this issue Jan 4, 2017 · 4 comments

Comments

@boomvalk
Copy link

boomvalk commented Jan 4, 2017

Hi,
When I try the Load Them All plugin, select a map containing two sub maps each containing a KML file I always get the error: "There are no shp, mif, tab, kml, ... files to load fromt he base directory with this filter. Change those parameters and try again"

This is odd since I have turned off all filters and the maps contain nothing but the KML files I wish to upload. I tried it with all boxes unchecked in configuration, tried it in a new empty project as well as an existing one, rebooted my QGIS, tried with "all listed formats" as well as ".kml". Everything try results in the same error.

When I try the plugin for a different map structure containing .shp files everything works like a charm.

Can someone please help? Im on QGIS 2.14.2 on a windows 7
image 4
image 5

@boomvalk
Copy link
Author

boomvalk commented Jan 4, 2017

Hi,
So I figured out the issue. Apparently it had something to do with the folder structure. If I moved the map containing the files to a different location all of a sudden it worked like a charm. Thanks for the great plugin! Might be something to look into though, possibly something to do with a maximum pathway length?
The folder that didn't work as well as the one where it does work are located on a server, maps created by myself on a directory I have full acces to (editing too).

Anyway Great plugin! One small suggestion: the configuration "sort loaded layers by name" doesn't work propperly for numbers in the directory names.

An extra question: Is there a way to export all the files back to the original folder pathway? In my case I imported a big batch of KML files in WGS84 and wat to export them to the source maps in a .shp with a different CRS (Lambert1972 EPSG31370)

@gacarrillor
Copy link
Owner

Hi @boomvalk,

thanks for raising these issues.

  • On my GNU/Linux machine KML files are loaded properly, even adding spaces and Umlauts into folder names. It seems to be a Windows issue, I'll have to test it there.
  • Right, there is a problem with ordering numbers. I'll check that out as well.

Regarding the batch export functionality, unfortunately I have no spare time these days to spend on it, but it should be certainly possible.

I'll keep you informed when these issues are solved.

Regards,

Germán

@boomvalk
Copy link
Author

boomvalk commented Jan 4, 2017 via email

@gacarrillor
Copy link
Owner

Always use os.path to deal with paths.

To save each layer in its corresponding folder, you could extract its folder with:
layerDir = os.path.dirname( layer.source() ) # Will work because your layers are file-based

and then, set the path to the new layer as:

ret = QgsVectorFileWriter.writeAsVectorFormat( layer, os.path.join( layerDir, newName ),'utf-8',trs,'ESRI Shapefile' )

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

No branches or pull requests

2 participants