Skip to content

Commit

Permalink
Merge pull request #590 from Universite-Gustave-Eiffel/fixkmlpath
Browse files Browse the repository at this point in the history
Fix kml path
  • Loading branch information
nicolas-f authored Jul 25, 2023
2 parents ac6322e + 912220b commit 20e40f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion wps_scripts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ out/
.gradle
build/
.idea
dependencies/
dependencies/
lib/
Original file line number Diff line number Diff line change
Expand Up @@ -588,17 +588,17 @@ def exec(Connection connection, input) {
String kmlFileNamePrepend = ""
if (input['confRaysName'] && !((input['confRaysName'] as String).isEmpty())) {
String confRaysName = input['confRaysName'] as String
if(confRaysName.startsWith("file:")) {
if(confRaysName.toLowerCase().startsWith("file:")) {
ldenConfig.setExportRaysMethod(LDENConfig.ExportRaysMethods.TO_MEMORY)
URL url = new URL(confRaysName)
File urlFile = new File(url.toURI())
if(urlFile.isDirectory()) {
folderExportKML = urlFile
} else {
folderExportKML = urlFile.getParentFile()
kmlFileNamePrepend = confRaysName.substring(
Math.max(0, confRaysName.lastIndexOf(File.separator) + 1),
Math.max(0, confRaysName.lastIndexOf(".")))
String fileName = urlFile.getName()
int positionExt = fileName.lastIndexOf(".")
kmlFileNamePrepend = fileName.substring(0, positionExt > 0 ? positionExt : fileName.length())
}
} else {
ldenConfig.setExportRaysMethod(LDENConfig.ExportRaysMethods.TO_RAYS_TABLE)
Expand Down

0 comments on commit 20e40f4

Please sign in to comment.