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

generating factories out of WKT v1 (geotools epsg.properties) #4

Open
fikin opened this issue Jul 31, 2023 · 4 comments
Open

generating factories out of WKT v1 (geotools epsg.properties) #4

fikin opened this issue Jul 31, 2023 · 4 comments

Comments

@fikin
Copy link

fikin commented Jul 31, 2023

hi,

i'm toying with the idea of tapping into geotools wkt epsg.properties and script/generate transformation factories for each definition. or simply parse wkt1, not decided yet.

perhaps parameterize MGI -> helmert with parameters from TOWGS84 definitions.
and then instrument transverseMercator with PROPERTY values.

how do you see it, would it be working approach en mass? what would "area" function be then?

@wroge
Copy link
Owner

wroge commented Jul 31, 2023

I have also considered using the different definition files (WKT, Proj4js, Proj.4) to derive the coordinate reference systems.
However, many projections and transformations (e.g. GRID-based transformations like OSTN15_NTv2_OSGBtoETRS) are still missing in this library so that it has not yet been worthwhile from my point of view.
Here is a document with most of the projections: https://drive.tiny.cloud/1/4m326iu12oa8re9cjiadxonharclteqb4mumfxj71zsttwkx/d6ce146d-81c5-423b-8cdb-1b66e801e167
It is certainly already possible to generate the code for the missing projections from this document with an AI. Maybe that's the reason why I couldn't get up the nerve to do this by hand yet :D

If you want to generate the EPSG codes with already existing projections and transformations, I would be happy about pull requests. The area function can simply always return true and then cause no harm. But I'm not really happy with the structure anymore and I'm thinking about releasing a new version.

@fikin
Copy link
Author

fikin commented Jul 31, 2023

alright, lets see if i manage to drive this generation to some meaningful results to post a pull request.
and thanks for the pointer, apparently i had part 1 only and was missing the formulas ...

@fikin fikin closed this as completed Jul 31, 2023
@fikin
Copy link
Author

fikin commented Aug 16, 2023

let me follow up on this and brainstorm together how to go about it.
btw, as a background i'm casual bystander to geo projection topics, so don't expect me to show deep understanding on the subject.

as an example i'm looking at one of the provided definitions from GeoTools:

PROJCS["MGI / Austria M31", 
  GEOGCS["MGI", 
    DATUM["Militar-Geographische Institut", 
      SPHEROID["Bessel 1841", 6377397.155, 299.1528128, 
        AUTHORITY["EPSG", "7004"]], 
      TOWGS84[601.705, 84.263, 485.227, 4.7354, -1.3145, -5.393, -2.3887], 
      AUTHORITY["EPSG", "6312"]], 
    PRIMEM["Greenwich", 0.0, 
      AUTHORITY["EPSG", "8901"]], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Geodetic longitude", EAST], 
    AXIS["Geodetic latitude", NORTH], 
    AUTHORITY["EPSG", "4312"]], 
  PROJECTION["Transverse_Mercator", 
    AUTHORITY["EPSG", "9807"]], 
  PARAMETER["central_meridian", 13.333333333333336], 
  PARAMETER["latitude_of_origin", 0.0], 
  PARAMETER["scale_factor", 1.0], 
  PARAMETER["false_easting", 450000.0], 
  PARAMETER["false_northing", 0.0], 
  UNIT["m", 1.0], 
  AXIS["Easting", EAST], 
  AXIS["Northing", NORTH], 
  AUTHORITY["EPSG", "31285"]] 

am i assuming right that this would result in:

helmert{
	tx: 601.705,
	ty: 84.263,
	tz: 485.227,
	rx: 4.7354,
	ry: -1.3145,
	rz: -5.393,
	ds: -2.3887,
}

and TransverseMercator(10.33333333333333, 0, 1, 450000, 0) ?

@fikin fikin reopened this Aug 16, 2023
@wroge
Copy link
Owner

wroge commented Aug 16, 2023

epsg31285 := Helmert(6377397.155, 299.1528128, 601.705, 84.263, 485.227, 4.7354, -1.3145, -5.393, -2.3887).TransverseMercator(13.333333333333336, 0, 1, 450000.0, 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants