Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,12 @@ download_soil_data:

DATABASE_DUMP_FILE ?= Data/soil_id_db.dump
DOCKER_IMAGE_TAG ?= ghcr.io/techmatters/soil-id-db:latest
# Build linux/amd64 explicitly: the postgis:16-3.5 base has no arm64 manifest,
# and CI/prod run the image on amd64 regardless.
build_docker_image:
@echo "Building to tag $(DOCKER_IMAGE_TAG)"
docker build \
--platform linux/amd64 \
--build-arg DATABASE_DUMP_FILE=$(DATABASE_DUMP_FILE) \
-t $(DOCKER_IMAGE_TAG) \
.
Expand All @@ -138,8 +141,19 @@ stop_db:
connect_db:
docker compose exec db psql -U postgres -d soil_id

# Container running the local soil-id-db (PostgreSQL 16). Override if your
# compose project names it differently.
SOIL_ID_DB_CONTAINER ?= terraso-backend-soil-id-db-1

# Dump from *inside* the PG16 container so the archive is always restorable by
# the PG16 image. A host pg_dump newer than 16 (e.g. 17/18) writes an archive
# the image's pg_restore 16 cannot read ("unsupported version in file header"),
# which silently breaks build_docker_image.
dump_soil_id_db:
pg_dump --format=custom $(DATABASE_URL) -t hwsd2_segment -t hwsd2_data -t landpks_munsell_rgb_lab -t normdist1 -t normdist2 -t wise_soil_data -t wrb2006_to_fao90 -t wrb_fao90_desc -f $(DATABASE_DUMP_FILE)
docker exec $(SOIL_ID_DB_CONTAINER) pg_dump --format=custom -U postgres -d soil_id \
-t hwsd2_segment -t hwsd2_data -t landpks_munsell_rgb_lab -t normdist1 -t normdist2 \
-t wise_soil_data -t wrb2006_to_fao90 -t wrb_fao90_desc -f /tmp/soil_id_db.dump
docker cp $(SOIL_ID_DB_CONTAINER):/tmp/soil_id_db.dump $(DATABASE_DUMP_FILE)

restore_soil_id_db:
pg_restore --dbname=$(DATABASE_URL) --single-transaction --clean --if-exists --no-owner $(DATABASE_DUMP_FILE)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: soil_id

services:
db:
image: ghcr.io/techmatters/soil-id-db:0.3
image: ghcr.io/techmatters/soil-id-db:2026-06-23
ports:
- "5432:5432"
environment:
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
"soilDepth": 200
},
"siteDescription": {
"Description_en": "Haplic Calcisols mostly occur in semiarid and arid climates. They are calcareous soils, with high base saturation, pH, and P fixation. <br> Many have gravelly surface horizons. ",
"Management_en": "These soils have low organic matter content, are dry, and often stony. <br> They are calcareous, and will have high base saturation (Ca, Mg and K) and high soil pH. <br> If used, the soils are best suited for grazing or limited use with drought tolerant crops. <br> At best they could be cultivated every-other or every-third year, with fallow in the years in which the soils are not used for crops. <br> If irrigated, care must be taken so that the soils do not become high in salts (saline). High quality irrigation water that is low in salts would be needed to prevent salinization."
"Description_en": "Haplic Calcisols mostly occur in semiarid and arid climates. They are calcareous soils, with high base saturation, pH, and P fixation. Many have gravelly surface horizons. ",
"Management_en": "These soils have low organic matter content, are dry, and often stony. They are calcareous, and will have high base saturation (Ca, Mg and K) and high soil pH. If used, the soils are best suited for grazing or limited use with drought tolerant crops. At best they could be cultivated every-other or every-third year, with fallow in the years in which the soils are not used for crops. If irrigated, care must be taken so that the soils do not become high in salts (saline). High quality irrigation water that is low in salts would be needed to prevent salinization."
}
},
"texture": {
Expand Down Expand Up @@ -160,8 +160,8 @@
"soilDepth": 20
},
"siteDescription": {
"Description_en": "Lithic Leptosols have very limited rooting volume due to continuous rock, highly calcareous material, cemented horizons, or many rocks and coarse fragments in the upper portion of the soil. <br> Leptosols on steep slopes are highly erodible. <br> Lithic Leptosols have hard rock within 10 cm of the soil surface. ",
"Management_en": "Because these soils are shallow, rocky and erodible they should be used for perennial crops, and not tilled. <br> Practices to maintain organic matter and cover should be used. <br> Only uses for grazing or agroforestry should be considered. <br> Preservation of the surface soil with its organic matter is important, and erosion prevention is critical. <br> Land management practices should maximize soil cover. <br> Any agricultural use should be for grazing, with cover continuously maintained. "
"Description_en": "Lithic Leptosols have very limited rooting volume due to continuous rock, highly calcareous material, cemented horizons, or many rocks and coarse fragments in the upper portion of the soil. Leptosols on steep slopes are highly erodible. Lithic Leptosols have hard rock within 10 cm of the soil surface. ",
"Management_en": "Because these soils are shallow, rocky and erodible they should be used for perennial crops, and not tilled. Practices to maintain organic matter and cover should be used. Only uses for grazing or agroforestry should be considered. Preservation of the surface soil with its organic matter is important, and erosion prevention is critical. Land management practices should maximize soil cover. Any agricultural use should be for grazing, with cover continuously maintained. "
}
},
"texture": {
Expand Down Expand Up @@ -250,8 +250,8 @@
"soilDepth": 200
},
"siteDescription": {
"Description_en": "Calcaric Regosols are weakly developed soils that commonly are too dry, or are on steeper slopes which limit productivity.<br>Calcaric Regosols are calcareous in the upper portion of the subsoil. ",
"Management_en": "These soils have low water holding capacity, and are very sensitive to drought. <br> They are prone to erosion, especially in areas with slope. <br> The combination of drought sensitivity and high erosion potential makes these soils best suited for grazing or other uses with constant soil cover. <br> Even when used for grazing, irrigation will be needed due to the low water holding capacity and high permeability of these soils. "
"Description_en": "Calcaric Regosols are weakly developed soils that commonly are too dry, or are on steeper slopes which limit productivity. Calcaric Regosols are calcareous in the upper portion of the subsoil. ",
"Management_en": "These soils have low water holding capacity, and are very sensitive to drought. They are prone to erosion, especially in areas with slope. The combination of drought sensitivity and high erosion potential makes these soils best suited for grazing or other uses with constant soil cover. Even when used for grazing, irrigation will be needed due to the low water holding capacity and high permeability of these soils. "
}
},
"texture": {
Expand Down Expand Up @@ -345,7 +345,7 @@
},
"siteDescription": {
"Description_en": "Regosols are weakly developed soils that commonly are too dry, or are on steeper slopes which limit productivity. ",
"Management_en": "These soils have low water holding capacity, and are very sensitive to drought. <br> This soil can be productive, if irrigation and fertilization are provided. <br> They are prone to erosion, especially in areas with slope. <br> The combination of drought sensitivity and high erosion potential makes these soils best suited for grazing or other uses with constant soil cover. <br> Even when used for grazing, irrigation will be needed due to the low water holding capacity and high permeability of these soils. "
"Management_en": "These soils have low water holding capacity, and are very sensitive to drought. This soil can be productive, if irrigation and fertilization are provided. They are prone to erosion, especially in areas with slope. The combination of drought sensitivity and high erosion potential makes these soils best suited for grazing or other uses with constant soil cover. Even when used for grazing, irrigation will be needed due to the low water holding capacity and high permeability of these soils. "
}
},
"texture": {
Expand Down Expand Up @@ -439,7 +439,7 @@
},
"siteDescription": {
"Description_en": "Haplic Luvisols are productive soils with high base saturation and relatively clayey subsoils.",
"Management_en": "These soils are fertile, and can be used for a wide range of cropping practices. <br> However, they are sensitive to soil loss through erosion, and care must be taken to protect the soil from loss. <br> If the soil is already eroded they may best be suited for grazing andtree crops."
"Management_en": "These soils are fertile, and can be used for a wide range of cropping practices. However, they are sensitive to soil loss through erosion, and care must be taken to protect the soil from loss. If the soil is already eroded they may best be suited for grazing andtree crops."
}
},
"texture": {
Expand Down Expand Up @@ -532,8 +532,8 @@
"soilDepth": 200
},
"siteDescription": {
"Description_en": "Chromic Luvisols are productive soils with high base saturation and relatively clayey subsoils. <br> Chromic Luvisols have an iron rich subsoil.",
"Management_en": "These soils are fertile, and can be used for a wide range of cropping practices. <br> However, they are sensitive to soil loss through erosion, and care must be taken to protect the soil from loss. <br> If the soil is already eroded they may best be suited for grazing andtree crops."
"Description_en": "Chromic Luvisols are productive soils with high base saturation and relatively clayey subsoils. Chromic Luvisols have an iron rich subsoil.",
"Management_en": "These soils are fertile, and can be used for a wide range of cropping practices. However, they are sensitive to soil loss through erosion, and care must be taken to protect the soil from loss. If the soil is already eroded they may best be suited for grazing andtree crops."
}
},
"texture": {
Expand Down Expand Up @@ -627,7 +627,7 @@
},
"siteDescription": {
"Description_en": "Solonchaks are soils that contain salts at or near the soil surface. These soils form in either deserts or close to coastlines.",
"Management_en": "These soils are typically high in total salts. <br> They have very poor productivity, and cannot be used unless high quality irrigation is available to remove accumulated salts. <br>These soils are not well suited for agriculture and are best used for grazing, or left fallow. "
"Management_en": "These soils are typically high in total salts. They have very poor productivity, and cannot be used unless high quality irrigation is available to remove accumulated salts. These soils are not well suited for agriculture and are best used for grazing, or left fallow. "
}
},
"texture": {
Expand Down
Loading
Loading