Code Monkey home page Code Monkey logo

Comments (9)

bosborn avatar bosborn commented on July 22, 2024 2

I wrote a Coordinate Reference Systems library to parse CRS WKT 1 and 2. Recently added a CRS to PROJ / PROJ.4 parser as well.

Example to use with this library:

// String wkt = ...
CoordinateReferenceSystem crs = null;
CRS crsObject = CRSReader.read(wkt);
if (crsObject != null) {
    String params = ProjParser.paramsText(crsObject);
    if (params != null) {
        crs = CRSParser.getCRSFactory().createFromParameters(crsObject.getName(), params);
    }
}

from proj4j.

willcohen avatar willcohen commented on July 22, 2024 1

I think the use of native code in sqlite-jdbc is a main concern here, since proj4j is a pure java reimplementation of proj.

It does lead to a thought experiment -- if we're going to the trouble to embed native code for JDBC for this library, why don't we just build a native version of proj for as many platforms as possible, just like sqlite-jdbc, and embed that into a java library using JNI as a wrapper? On the other hand, if proj4j is the pure-java version of proj, we need to be reimplementing everything piece by piece, which might mean something like h2 or derby.

from proj4j.

echeipesh avatar echeipesh commented on July 22, 2024

Obviously GDAL does this somehow. But besides that I would love to identify a couple of reference resources that look like they can be used to do this in a principled way.

Potentially this is an good opportunity for GSoC project.

from proj4j.

vpipkt avatar vpipkt commented on July 22, 2024

It's my understanding that recent versions of GDAL now have a binary dependency on PROJ version 6. Which seems to answer the question of how GDAL does it...

This announcement describes some high level things about PROJ 6. There is an ISO spec and OGC spec that PROJ 6 implements. Of interest also, there is a sqlite database defining the projections. That database is installed with PROJ binaries.

from proj4j.

metasim avatar metasim commented on July 22, 2024

I don't know how much of an issue it is any more with caching, but the text file parsing that used to happen for constructing the lookup tables was quite slow. A SQLlite approach would be much faster, and allow us to keep up with the official database more easily.

from proj4j.

willcohen avatar willcohen commented on July 22, 2024

More discussion on this in #53. There are some concerns with sqlite and its not being pure java. On my own I've started trying out an approach to this but it's not nearly put together enough for a pull request -- it's fairly straightforward to copy the .sql files from upstream on some kind of version release cadence, and then have maven's build for proj4j just build its own version of the database first. From there, it seems like all of the SQL queries proj implements are located in one place, though modeling that OGC spec mentioned above would be a fair bit of work. It might make sense to wait until EPSG changes to model v10, though that seems to be on a delayed timeline.

from proj4j.

metasim avatar metasim commented on July 22, 2024

@willcohen Is this not sufficient? Or does it require a native sqlite installation (I couldn't tell from the README)?

https://github.com/xerial/sqlite-jdbc

The .jar file contains some native libraries:
Screen Shot 2020-01-08 at 11 14 52 AM

from proj4j.

vpipkt avatar vpipkt commented on July 22, 2024

@willcohen very interesting

from proj4j.

willcohen avatar willcohen commented on July 22, 2024

When proj appears on the classpath, it looks like this project implements a JNI approach. For this reason, it may be that that library is better suited to handle this native case.

from proj4j.

Related Issues (20)

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.