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

Commande LOAD DEM #235

Open
camillemonchicourt opened this Issue Sep 4, 2017 · 1 comment

Comments

1 participant
@camillemonchicourt
Member

camillemonchicourt commented Sep 4, 2017

Permet d'automatiser le chargement du MNT dans la BDD PostGIS à partir d'un fichier. Voir https://github.com/GeotrekCE/Geotrek-admin/blob/master/geotrek/altimetry/management/commands/loaddem.py

@camillemonchicourt

This comment has been minimized.

Member

camillemonchicourt commented Sep 6, 2017

Pour le moment, on télécharge la BDalti de l'IGN France metropole à 250m (75m trop lourd sur toute la France), on insert le MNT raster dans la BDD, puis on le vectorise pour pouvoir l'indexer :

GeoNature/install_db.sh

Lines 244 to 266 in 1fe9ee4

if $install_default_dem
then
echo "Insert default French DEM (IGN 250m BD alti)"
echo "" &>> log/install_db.log
echo "" &>> log/install_db.log
echo "--------------------" &>> log/install_db.log
echo "Insert default French DEM (IGN 250m BD alti)" &>> log/install_db.log
echo "--------------------" &>> log/install_db.log
echo "" &>> log/install_db.log
if [ ! -f '/tmp/BDALTIV2_2-0_250M_ASC_LAMB93-IGN69_FRANCE_2017-06-21.zip' ]
then
wget --cache=off http://geonature.fr/data/ign/BDALTIV2_2-0_250M_ASC_LAMB93-IGN69_FRANCE_2017-06-21.zip -P /tmp
else
echo "/tmp/BDALTIV2_2-0_250M_ASC_LAMB93-IGN69_FRANCE_2017-06-21.zip already exist"
fi
unzip /tmp/BDALTIV2_2-0_250M_ASC_LAMB93-IGN69_FRANCE_2017-06-21.zip -d /tmp
#gdalwarp -t_srs EPSG:$srid_local /tmp/BDALTIV2_250M_FXX_0098_7150_MNT_LAMB93_IGN69.asc /tmp/dem.tif &>> log/install_db.log
export PGPASSWORD=$user_pg_pass;raster2pgsql -s $srid_local -c -C -I -M -d -t 100x100 /tmp/BDALTIV2_250M_FXX_0098_7150_MNT_LAMB93_IGN69.asc ref_geo.dem|psql -h $db_host -U $user_pg -d $db_name &>> log/install_db.log
echo "Vectorisation of dem raster. This may take a few minutes..."
sudo -n -u postgres -s psql -d $db_name -c "INSERT INTO ref_geo.dem_vector (geom, val) SELECT (ST_DumpAsPolygons(rast)).* FROM ref_geo.dem;" &>> log/install_db.log
echo "Create dem vector spatial index. This may take a few minutes..."
sudo -n -u postgres -s psql -d $db_name -c "CREATE INDEX index_dem_vector_geom ON ref_geo.dem_vector USING gist (geom);" &>> log/install_db.log
fi

La BDalti 75m ou 250m IGN est aussi disponible pour les DOM-TOM : http://professionnels.ign.fr/bdalti#tab-3

Sinon au niveau mondial, l'agence aérospatial japonaise propose depuis peu un MNT mondial à 30m :
http://www.eorc.jaxa.jp/ALOS/en/aw3d30/index.htm (TIF en 4326)

J'en ai téléchargé et mosaïqué quelques bouts pour tester sur la Guadeloupe : http://geonature.fr/data/jaxa/

@camillemonchicourt camillemonchicourt added this to the V2 - Sprint September milestone Sep 7, 2017

@camillemonchicourt camillemonchicourt modified the milestones: V2 - Sprint September, V2 - Sprint November Oct 10, 2017

@camillemonchicourt camillemonchicourt modified the milestones: V2 - Sprint November, V2 Dec 12, 2017

@gildeluermoz gildeluermoz moved this from DOING to PAUSE in GeoNature V2 Jan 16, 2018

@camillemonchicourt camillemonchicourt removed this from the V2 milestone Oct 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment