Skip to content

Commit c2e726b

Browse files
author
Adam Collins
committed
Merge branch 'develop' into 237-exporting-point-geometry
# Conflicts: # grails-app/conf/application.yml
2 parents 22880e3 + 5a4f690 commit c2e726b

File tree

5 files changed

+28
-15
lines changed

5 files changed

+28
-15
lines changed

grails-app/conf/application.yml

+3
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ openapi:
467467
version: '@info.app.version@'
468468
cachetimeoutms: 4000
469469

470+
# Allow setting a fixed locale to prevent number formatting issues: https://github.com/AtlasOfLivingAustralia/spatial-service/issues/247
471+
#useFixedLocale: en
472+
470473
# Internal sandbox service for processing uploaded CSV files
471474
sandboxEnabled: true
472475
sandboxSolrUrl: http://localhost:8983/solr

grails-app/conf/spring/resources.groovy

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import au.org.ala.spatial.web.NoSSOStrategy
55
import com.github.ziplet.filter.compression.CompressingFilter
66
import org.springframework.boot.web.servlet.FilterRegistrationBean
77
import org.springframework.core.Ordered
8+
import org.springframework.web.servlet.i18n.FixedLocaleResolver
89

910
beans = {
1011
compressionFilter(FilterRegistrationBean) {
@@ -17,4 +18,10 @@ beans = {
1718
if (!application.config.security.cas.enabled && !application.config.security.oidc.enabled) {
1819
noSSOStrategy(NoSSOStrategy) {}
1920
}
21+
22+
if (grailsApplication.config.useFixedLocale) {
23+
// Use fixed English locale, prevents issues with parsing of BBox decimal values in some locales
24+
// https://github.com/AtlasOfLivingAustralia/spatial-service/issues/247
25+
localeResolver(FixedLocaleResolver, new Locale(grailsApplication.config.useFixedLocale))
26+
}
2027
}

grails-app/services/au/org/ala/spatial/ManageLayersService.groovy

+16-13
Original file line numberDiff line numberDiff line change
@@ -621,19 +621,22 @@ class ManageLayersService {
621621
}
622622
}
623623

624-
//raw upload
625-
//TODO: tidy messages for id == name (layer already deleted)
626-
// String[] result;
627-
// result = httpCall("DELETE",
628-
// geoserverUrl + "/rest/workspaces/ALA/datastores/" + id + "?recurse=true", ///external.shp",
629-
// geoserverUsername, geoserverPassword,
630-
// null,null,
631-
// "text/plain");
632-
// result = httpCall("DELETE",
633-
// geoserverUrl + "/rest/workspaces/ALA/coveragestores/" + id + "?recurse=true", //"/external.geotiff",
634-
// geoserverUsername, geoserverPassword,
635-
// null,null,
636-
// "text/plain");
624+
//Delete raw upload
625+
httpCall("DELETE",
626+
geoserverUrl + "/rest/workspaces/ALA/datastores/" + id + "?recurse=true", ///external.shp",
627+
geoserverUsername, geoserverPassword,
628+
null, null,
629+
"text/plain");
630+
httpCall("DELETE",
631+
geoserverUrl + "/rest/workspaces/ALA/coveragestores/" + id + "?recurse=true", //"/external.geotiff",
632+
geoserverUsername, geoserverPassword,
633+
null, null,
634+
"text/plain");
635+
636+
def layerDataFolder = new File(spatialConfig.data.dir.toString() + "/uploads/" + id)
637+
if (layerDataFolder.exists()) {
638+
FileUtils.deleteDirectory(layerDataFolder)
639+
}
637640
}
638641

639642
def deleteField(String fieldId) {

src/main/groovy/au/org/ala/spatial/process/LayerCreation.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class LayerCreation extends SlaveProcess {
9292
new File(outPath + "_tmp.bil").delete()
9393

9494
taskWrapper.task.message = 'bil > diva'
95-
Bil2diva.bil2diva(outPath, outPath, layer.environmentalvalueunits.toString())
95+
Bil2diva.bil2diva(outPath, outPath, layer.environmentalvalueunits.toString(), spatialConfig.gdal.dir.toString(), 36000000)
9696

9797
if ("Contextual".equalsIgnoreCase(layer.type.toString())) {
9898
taskWrapper.task.message = "process grid file to shapes"

src/main/groovy/au/org/ala/spatial/util/OccurrenceData.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class OccurrenceData {
3535

3636
//remove sensitive records that will not be LSID matched
3737
try {
38-
Records r = new Records(bs, q + "&fq=" + UriEncoder.encode("-sensitive:[* TO *]"), null, records_filename, null, facetName)
38+
Records r = new Records(bs, q + "&fq=" + URLEncoder.encode("-sensitive:[* TO *]", "utf-8"), null, records_filename, null, facetName)
3939

4040
StringBuilder sb = null
4141
if (r.getRecordsSize() > 0) {

0 commit comments

Comments
 (0)