GithubHelp home page GithubHelp logo

Comments (11)

proj4-bot avatar proj4-bot commented on July 24, 2024

Comment by cdestigter on 4 Nov 2008 21:21 UTC
second patch removes some unnecessary stuff which shouldn't have been in the first patch (porting artifacts from cvs to svn)

from proj.

proj4-bot avatar proj4-bot commented on July 24, 2024

Comment by rcoup on 5 Jul 2009 10:41 UTC
I've attached a reworked patch: The goals were to:

  1. fallback to 3/7 parameter transforms for source points outside the grid range
  2. happily work for point sequences. ie. if point 5/10 failed it would use 3/7 param, while the other 9 points would use the grid.

The 2nd is a problem currently, since the gridshift bails out with a "transient error", so the return code from pj_datum_transform() ends up being 0 even though there were errors and many points weren't transformed. Postgis deliberately checks for this and throws an exception. See also #45.

Changes in the patch:

  • make a projection's datum_type a mask, so it can have 3param & 7param & gridshift rather than only one.
  • make a new -47 error for pj_apply_gridshift, which is transient and is returned only when a point is outside the grid range (as opposed to -38 which is also used for file-not-found, etc).
  • make -38 not transient.
  • make apply-gridshift take/return an array which it populates with 0 (transformed successfully) or 1 (errors) for each point processed.
  • if a -47 error occurs during the gridshift, transform the errored points via 3/7 param before continuing with the remainder of the datum transformation.
  • handling only a subset of points required changes to the APIs of several functions. I've maintained the old public APIs and used "funcname_impl()" for the ones that take an ignore-mask. The _impl versions aren't in proj_api.h (and only 1 was needed in projects.h)

My main test case ([attachment:proj_grid_test.c]) was transforming:

3010000.0,5300000.0
1990000.0,6790000.0 # outside the gridshift range
3010000.0,5300000.0

between:

+proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=intl +datum=nzgd49 +units=m +no_defs +nadgrids=nzgd2kgrid0005.gsb

and:

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

from proj.

proj4-bot avatar proj4-bot commented on July 24, 2024

Comment by rcoup on 20 Jul 2009 06:20 UTC
Updated patch & testcase fixes an issue where double-datum transforms occurred when projections had both 7/3 and gridshift transforms defined.

from proj.

proj4-bot avatar proj4-bot commented on July 24, 2024

Attachment added by cdestigter on 4 Nov 2008 21:09 UTC
https://trac.osgeo.org/proj/attachment/ticket/19/datum_gridshift_fallback.diff

from proj.

proj4-bot avatar proj4-bot commented on July 24, 2024

Attachment added by cdestigter on 4 Nov 2008 21:20 UTC
https://trac.osgeo.org/proj/attachment/ticket/19/datum_gridshift_fallback2.diff

from proj.

proj4-bot avatar proj4-bot commented on July 24, 2024

Attachment added by rcoup on 5 Jul 2009 10:26 UTC
https://trac.osgeo.org/proj/attachment/ticket/19/datum_gridshift_fallback.4.diff

from proj.

proj4-bot avatar proj4-bot commented on July 24, 2024

Attachment added by rcoup on 5 Jul 2009 10:43 UTC
https://trac.osgeo.org/proj/attachment/ticket/19/proj_grid_test.c

from proj.

proj4-bot avatar proj4-bot commented on July 24, 2024

Attachment added by rcoup on 20 Jul 2009 06:21 UTC
https://trac.osgeo.org/proj/attachment/ticket/19/datum_gridshift_fallback.5.diff

from proj.

proj4-bot avatar proj4-bot commented on July 24, 2024

Attachment added by rcoup on 20 Jul 2009 06:22 UTC
https://trac.osgeo.org/proj/attachment/ticket/19/proj_grid_test.2.c

from proj.

proj4-bot avatar proj4-bot commented on July 24, 2024

Attachment added by rcoup on 27 Jul 2009 22:37 UTC
https://trac.osgeo.org/proj/attachment/ticket/19/datum_gridshift_fallback.6.diff

from proj.

busstoptaktik avatar busstoptaktik commented on July 24, 2024

Closing, since attachment links now 404

from proj.

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.