Giter VIP home page Giter VIP logo

crs's People

Contributors

hobu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

crs's Issues

EPSG .SQL file code page issue

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.