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

Slovenia: Delete old reprojected shapefile before reprojection using gk-shp, updated year in attribution, using https, updated README #3470

Merged
merged 5 commits into from
Apr 14, 2018
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
2 changes: 2 additions & 0 deletions scripts/si/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ all:
fi

cd GeoCoordinateConverter && $(MAKE) -f Makefile.unix gk-shp

rm -r $(TMP)HS-etrs89 || true
mkdir -p $(TMP)HS-etrs89
./GeoCoordinateConverter/gk-shp -t 9 -dd $(TMP)HS/SI.GURS.RPE.PUB.HS.shp $(TMP)HS-etrs89/SI.GURS.RPE.PUB.HS-etrs89.shp

Expand Down
18 changes: 10 additions & 8 deletions scripts/si/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,22 @@

### To manually download the data you should:
1. Register as user at http://egp.gu.gov.si/egp, wait for the email with the password, login
2. Expand section "9. Register prostorskih enot"
3. Download the data "Prostorske enote" (spatial units) -> RPE_PE.ZIP and put it in this folder
4. Download the data "Ulice" (streets) -> RPE_PUL.ZIP and put it in this folder
5. Download the data "Hišne številke" (house numbers) -> RPE_PE.ZIP and put it in this folder
2. Expand section "9. Register prostorskih enot" / "9. Register of Spatial Units"
3. Download the data "Prostorske enote" / "Spatial units" -> `RPE_PE.ZIP` and put it in this folder
4. Download the data "Ulice" / "Streets" -> `RPE_PUL.ZIP` and put it in this folder
5. Download the data "Hišne številke" / "House numbers" -> `RPE_PE.ZIP` and put it in this folder
6. Adjust the scripts to use these ZIPs.

### Technical info:
Encoding in source shapefiles is Windows-1250 (`CP1250` in `iconv`), result is UTF8

Source shapefile structure is described in http://www.e-prostor.gov.si/fileadmin/struktura/RPE_struktura.pdf
Source shapefile structure is described in [RPE_struktura.pdf](http://www.e-prostor.gov.si/fileadmin/struktura/RPE_struktura.pdf) (only in Slovenian so far)

### Dataset source
Data can be obtained from Geodetska uprava Republike Slovenije - http://egp.gu.gov.si/egp/ under CreativeCommons attribution license - CC-BY 2.5 (http://creativecommons.org/licenses/by/2.5 ), attribution details: http://www.e-prostor.gov.si/fileadmin/struktura/preberi_me.pdf
Data can be obtained from Geodetska uprava Republike Slovenije - http://egp.gu.gov.si/egp/ under CreativeCommons attribution license - [CC-BY 2.5](http://creativecommons.org/licenses/by/2.5/si/legalcode), attribution details in [General_terms.pdf](http://www.e-prostor.gov.si/fileadmin/struktura/ANG/General_terms.pdf) (or slovene [preberi_me.pdf](http://www.e-prostor.gov.si/fileadmin/struktura/preberi_me.pdf)).

### Dependancies
GeoCoordinateConverter for most accurate reprojection
https://github.com/mrihtar/GeoCoordinateConverter (will be checked out and built if it is not existing yet)
1. [GeoCoordinateConverter](http://geocoordinateconverter.tk/) for most accurate reprojection (https://github.com/mrihtar/GeoCoordinateConverter will be checked out and built if it is not existing yet)
2. GNU Make, bash, wget... (normal linux stuff)
3. `ogr2ogr` (part of [gdal suite](http://www.gdal.org/))
3. Python
2 changes: 1 addition & 1 deletion scripts/si/countrywide-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"text": "CC BY 2.5 SI",
"url": "https://creativecommons.org/licenses/by/2.5/si/legalcode",
"attribution": true,
"attribution name": "Geodetska uprava Republike Slovenije / The Surveying and Mapping Authority of the Republic of Slovenia, Register prostorskih enot, %YYYY%",
"attribution name": "Geodetska uprava Republike Slovenije / The Surveying and Mapping Authority of the Republic of Slovenia, Register prostorskih enot / Register of Spatial Units, %YYYY%",
"share-alike": false
},
"conform": {
Expand Down
21 changes: 13 additions & 8 deletions scripts/si/getSource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi
# read possibly existing credentials...
source $credentialsFile

echo Credentials for http://egp.gu.gov.si/egp/
echo Credentials for https://egp.gu.gov.si/egp/

if [ -z "$username" ]; then
echo -n " Username: ";
Expand Down Expand Up @@ -54,8 +54,9 @@ fi
wget --quiet \
--save-cookies cookies.txt \
--keep-session-cookies \
http://egp.gu.gov.si/egp/login.html
# example login.html content:;
--ca-certificate=sigov-ca2.pem \
"https://egp.gu.gov.si/egp/login.html"
# example login.html content:
# <input type="hidden" name="_csrf" value="089070ed-b40a-4e3c-ab22-422de0daffff" />
csrftoken="`sed -n 's/.*name="_csrf"\s\+value="\([^"]\+\).*/\1/p' login.html`"
rm login.html
Expand All @@ -69,30 +70,34 @@ loginFormData="username=${username}&password=${password}&_csrf=${csrftoken}"
wget --quiet --load-cookies cookies.txt \
--save-cookies cookies.txt \
--keep-session-cookies \
--referer http://egp.gu.gov.si/egp/ \
--referer https://egp.gu.gov.si/egp/ \
--post-data "${loginFormData}" \
--delete-after \
http://egp.gu.gov.si/egp/login.html
--ca-certificate=sigov-ca2.pem \
"https://egp.gu.gov.si/egp/login.html"

# Now grab the data we care about.

#RPE_PE.ZIP
wget --load-cookies cookies.txt \
--directory-prefix "${dest}" \
--content-disposition -N \
"http://egp.gu.gov.si/egp/download-file.html?id=105&format=10&d96=0"
--ca-certificate=sigov-ca2.pem \
"https://egp.gu.gov.si/egp/download-file.html?id=105&format=10&d96=0"

#RPE_UL.ZIP
wget --load-cookies cookies.txt \
--directory-prefix "${dest}" \
--content-disposition -N \
"http://egp.gu.gov.si/egp/download-file.html?id=106&format=10&d96=0"
--ca-certificate=sigov-ca2.pem \
"https://egp.gu.gov.si/egp/download-file.html?id=106&format=10&d96=0"

#RPE_HS.ZIP
wget --load-cookies cookies.txt \
--directory-prefix "${dest}" \
--content-disposition -N \
"http://egp.gu.gov.si/egp/download-file.html?id=107&format=10&d96=0"
--ca-certificate=sigov-ca2.pem \
"https://egp.gu.gov.si/egp/download-file.html?id=107&format=10&d96=0"

rm cookies.txt
rm login.htm*
Expand Down
28 changes: 28 additions & 0 deletions scripts/si/sigov-ca2.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN CERTIFICATE-----
MIIEgDCCAuigAwIBAgINAL0ag3wAAAAAVnvHDjANBgkqhkiG9w0BAQsFADBXMQsw
CQYDVQQGEwJTSTEcMBoGA1UEChMTUmVwdWJsaWthIFNsb3ZlbmlqYTEXMBUGA1UE
YRMOVkFUU0ktMTc2NTk5NTcxETAPBgNVBAMTCFNJR09WLUNBMB4XDTE1MTIyNDA5
NTEwNloXDTM1MTIyNDEwMjEwNlowVzELMAkGA1UEBhMCU0kxHDAaBgNVBAoTE1Jl
cHVibGlrYSBTbG92ZW5pamExFzAVBgNVBGETDlZBVFNJLTE3NjU5OTU3MREwDwYD
VQQDEwhTSUdPVi1DQTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAMwL
1q8WkYT8bgTgdHHvdMS+A0Fiep9eQA4Y2bNiLFYF2Gzj2ykP1Llg2SPQJBIJkB4R
x49celNikM/XOzsxtov4qnP8eO9N6Ez4pu68MldzHdWC2UpglR8vE9QMjn3zFdGM
88x84x5A7wxDr05kgeiPLy9KD2vSVsX7CNIAWXGv9FAE0ayCtsUNWQBH+nln/eR9
xJGSwYHySnvYniUwihAVsZMYRipBcjc8EpLWriaaQvxOhqmk8qwvTmbm9SCo4uTK
I9HGhIbhMQZ+6B/Q0cHNKa5hPJyQpJ9iWza7gBfUe7uU/Ee5Xj4WjNJlshS80wNu
S8y8gbkUvPPhAGuWEX0Hg5/v5yOpq6iMbkFL5vdLif4qdV06I/+j4oco8F761Obs
5VP39++QHUBF93Le6ZZBweftzCYegIUX/kRPyEoxmkUDCkme8HF0m6gJBF0prh7C
o4geBeEzSCq5DwxrKbb0ZhS30uxjEQr3dgXfxHqJQcfuyKdymlYEuGJ7TmmuVQID
AQABo0swSTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjATBgNVHSME
DDAKgAhGXkDlU+3+/jARBgNVHQ4ECgQIRl5A5VPt/v4wDQYJKoZIhvcNAQELBQAD
ggGBAKuyWriPA495SJiRLk8xh4ikFkIMgum61AXGg6O2B2KGn44cNQWUlpbYBu9s
9z86K43+rKbgDcl6o40paRwfneKRHNsjiHmXDyZa7u74S6jGf+t9SO+TDlpBe6iu
Pl97Yw8LMtnktQuKMnuKms78RIJrX9K8JRFQiGkhIAduDwYdcQEbQ77sJxNdcfRL
hK5fNZFWQiyWmdBxwIyhec5s69Vsu44+wUACrCDHNH69vxfWkS39DO4m46gjHfNr
+vo+G6ATo2kQX2cLIBz7AX/aF5grR+K+4Y/hZdyKF3WR4eIJUcaZ72P80M09fOiM
0sgBAQNNUFKgqHBojawIH2ZtdrZHY361gSd86tXEoJbq5xKLE+Ux6+7p86IM2gAr
lzs89rwII0TdMcAbCTZnOrjqtgiMGac/LL8jbsLcJlkhwW4ZM8sxZoHqlrvd8Sm6
s43iLyLD/P6gsSCv65ZasettJxwVoBNF45qXEvQ973pkyPPK9DOrYs+r5801/MjD
eFARnA==
-----END CERTIFICATE-----

2 changes: 1 addition & 1 deletion sources/si/countrywide.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"text": "CC BY 2.5 SI",
"url": "https://creativecommons.org/licenses/by/2.5/si/legalcode",
"attribution": true,
"attribution name": "Geodetska uprava Republike Slovenije / The Surveying and Mapping Authority of the Republic of Slovenia, Register prostorskih enot, 2017",
"attribution name": "Geodetska uprava Republike Slovenije / The Surveying and Mapping Authority of the Republic of Slovenia, Register prostorskih enot / Register of Spatial Units, 2018",
"share-alike": false
},
"conform": {
Expand Down