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

When upgrading an old database with french IGN #448

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions doc/installation.xml
Expand Up @@ -2483,6 +2483,34 @@ ALTER EXTENSION postgis_topology UPDATE TO "&last_release_version;next";</progra
<programlisting>ALTER TABLE spatial_ref_sys ADD CONSTRAINT spatial_ref_sys_srid_check check (srid &gt; 0 AND srid &lt; 999000 );</programlisting>

<programlisting>ALTER TABLE spatial_ref_sys ADD PRIMARY KEY(srid));</programlisting>

If you are upgrading an old database containing french <ulink url="https://en.wikipedia.org/wiki/Institut_g%C3%A9ographique_national">
IGN
</ulink> cartography, you will have probably SRIDs out
of range and you will see, when importing your database, issues like this :

<programlisting> WARNING: SRID 310642222 converted to 999175 (in reserved zone)</programlisting>

In this case, you can try following steps : first throw
out completely the IGN from the sql which is resulting
from postgis_restore.pl. So, after having run :

<programlisting>perl utils/postgis_restore.pl "/somepath/olddb.backup" > oldbb.sql</programlisting>

run this command :

<programlisting>grep -v IGNF olddb.sql > olddb-without-IGN.sql</programlisting>

Create then your newdb, activate the required Postgis extensions,
and insert properly the french system IGN with :

<ulink url="https://raw.githubusercontent.com/Remi-C/IGN_spatial_ref_for_PostGIS/master/Put_IGN_SRS_into_Postgis.sql">
this script
</ulink>

After these operations, import your data :

<programlisting>psql -h localhost -p 5432 -U postgres -d newdb -f olddb-without-IGN.sql 2> errors.txt</programlisting>

</para>
</listitem>
Expand Down