hobu / crs Goto Github PK
View Code? Open in Web Editor NEWCRS dictionary and database stuff
License: MIT License
CRS dictionary and database stuff
License: MIT License
I've been doing a little bit of prototyping with the EPSG DB in Python and I ran into this problem.
The EPSG SQL files are encoded by default in ISO-8859-1. SQLite assumes that text data should be encoded in Unicode format.
How do you test this out to see if everything is working properly?
$ sqlite epsg.sqlite
sqlite> SELECT * FROM epsg_unitofmeasure WHERE uom_code=1029;
which should return this line
1029|year|time|1040|31556925.445|1.0||International Union of Geological Sciences (IUGS) and International Union of Pure and Applied Chemistry (IUPAC). Pure Appl. Chem., Vol. 83, No. 5, pp. 1159–1162, 2011.|OGP|2013-05-28|2013.021|0
The 1159–1162
should be an en-dash which is U+2013. Otherwise, it should be some other odd character. (In Python, the SELECT causes an Exception to occur. SQLite's console utility seems to just fill in what character it thinks it is.)
The solution is the data file needs to be converted to UTF-8, using iconv
. (In Windows, I used notepad to save as UTF-8, but you could install iconv
port.)
~/epsg2$ file EPSG_v9_0.mdb_Data_PostgreSQL.sql
EPSG_v9_0.mdb_Data_PostgreSQL.sql: ISO-8859 text, with CRLF line terminators
~/epsg2$ iconv -f ISO-8859-1 -t UTF-8 EPSG_v9_0.mdb_Data_PostgreSQL.sql -o out_utf8.sql
micah@micah-VirtualBox:~/epsg2$ file out_utf8.sql
out_utf8.sql: UTF-8 Unicode text, with CRLF line terminators
IMO iconv
should be added as a step to the build.sh.
I tested both the issue and the solution on Ubuntu 16.04 and Windows 7.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.