{"id":21819958,"url":"https://github.com/ngageoint/coordinate-reference-systems-ios","last_synced_at":"2025-04-14T02:42:57.042Z","repository":{"id":56931863,"uuid":"379937867","full_name":"ngageoint/coordinate-reference-systems-ios","owner":"ngageoint","description":"Coordinate Reference Systems iOS Library","archived":false,"fork":false,"pushed_at":"2023-11-07T17:59:46.000Z","size":5432,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-27T16:42:01.987Z","etag":null,"topics":["cocoapods","coordinate-reference-system","coordinate-reference-systems","crs","ios","ios-lib","nga","objective-c","objective-c-library","ogc","proj","proj4","projection","projections","swift","well-known","well-known-text","wkt","wkt-crs","xcode"],"latest_commit_sha":null,"homepage":"https://ngageoint.github.io/coordinate-reference-systems-ios/","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngageoint.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-24T13:41:15.000Z","updated_at":"2024-09-09T16:15:04.000Z","dependencies_parsed_at":"2024-12-01T06:46:52.196Z","dependency_job_id":null,"html_url":"https://github.com/ngageoint/coordinate-reference-systems-ios","commit_stats":{"total_commits":133,"total_committers":1,"mean_commits":133.0,"dds":0.0,"last_synced_commit":"112063a9325158ccd7c5c994a6b9b3eab389735b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fcoordinate-reference-systems-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fcoordinate-reference-systems-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fcoordinate-reference-systems-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngageoint%2Fcoordinate-reference-systems-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngageoint","download_url":"https://codeload.github.com/ngageoint/coordinate-reference-systems-ios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625493,"owners_count":21135513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","coordinate-reference-system","coordinate-reference-systems","crs","ios","ios-lib","nga","objective-c","objective-c-library","ogc","proj","proj4","projection","projections","swift","well-known","well-known-text","wkt","wkt-crs","xcode"],"created_at":"2024-11-27T16:27:28.414Z","updated_at":"2025-04-14T02:42:57.020Z","avatar_url":"https://github.com/ngageoint.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coordinate Reference Systems iOS\n\n#### Coordinate Reference Systems Lib ####\n\nThe Coordinate Reference Systems Library was developed at the [National Geospatial-Intelligence Agency (NGA)](http://www.nga.mil/) in collaboration with [BIT Systems](https://www.caci.com/bit-systems/). The government has \"unlimited rights\" and is releasing this software to increase the impact of government investments by providing developers with the opportunity to take things in new directions. The software use, modification, and distribution rights are stipulated within the [MIT license](http://choosealicense.com/licenses/mit/).\n\n### Pull Requests ###\nIf you'd like to contribute to this project, please make a pull request. We'll review the pull request and discuss the changes. All pull request contributions to this project will be released under the MIT license.\n\nSoftware source code previously released under an open source license and then modified by NGA staff is considered a \"joint work\" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open source license.\n\n### About ###\n\n[Coordinate Reference Systems](http://ngageoint.github.io/coordinate-reference-systems-ios/) is an iOS library implementation of OGC's 'Geographic information — Well-known text representation of coordinate reference systems' ([18-010r7](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html)) specification.\n\nFor projection conversions between coordinates, see [Projections](https://ngageoint.github.io/projections-ios/).\n\n### Usage ###\n\nView the latest [Appledoc](http://ngageoint.github.io/coordinate-reference-systems-ios/docs/api/)\n\n```objectivec\n\n// NSString *wkt = ...\n\nCRSObject *crs = [CRSReader read:wkt];\n\nenum CRSType type = crs.type;\nenum CRSCategoryType category = crs.categoryType;\n\nNSString *text = [CRSWriter write:crs];\nNSString *prettyText = [CRSWriter writePretty:crs];\n\nswitch(category){\n\n    case CRS_CATEGORY_CRS:\n    {\n        CRSCoordinateReferenceSystem *coordRefSys = (CRSCoordinateReferenceSystem *) crs;\n\n        switch (type) {\n            case CRS_TYPE_BOUND:\n            {\n                CRSBoundCoordinateReferenceSystem *bound = (CRSBoundCoordinateReferenceSystem *) coordRefSys;\n                // ...\n                break;\n            }\n            case CRS_TYPE_COMPOUND:\n            {\n                CRSCompoundCoordinateReferenceSystem *compound = (CRSCompoundCoordinateReferenceSystem *) coordRefSys;\n                // ...\n                break;\n            }\n            case CRS_TYPE_DERIVED:\n            {\n                CRSDerivedCoordinateReferenceSystem *derived = (CRSDerivedCoordinateReferenceSystem *) coordRefSys;\n                // ...\n                break;\n            }\n            case CRS_TYPE_ENGINEERING:\n            {\n                CRSEngineeringCoordinateReferenceSystem *engineering = (CRSEngineeringCoordinateReferenceSystem *) coordRefSys;\n                // ...\n                break;\n            }\n            case CRS_TYPE_GEODETIC:\n            case CRS_TYPE_GEOGRAPHIC:\n            {\n                CRSGeoCoordinateReferenceSystem *geo = (CRSGeoCoordinateReferenceSystem *) coordRefSys;\n                // ...\n                break;\n            }\n            case CRS_TYPE_PARAMETRIC:\n            {\n                CRSParametricCoordinateReferenceSystem *parametric = (CRSParametricCoordinateReferenceSystem *) coordRefSys;\n                // ...\n                break;\n            }\n            case CRS_TYPE_PROJECTED:\n            {\n                CRSProjectedCoordinateReferenceSystem *projected = (CRSProjectedCoordinateReferenceSystem *) coordRefSys;\n                // ...\n                break;\n            }\n            case CRS_TYPE_TEMPORAL:\n            {\n                CRSTemporalCoordinateReferenceSystem *temporal = (CRSTemporalCoordinateReferenceSystem *) coordRefSys;\n                // ...\n                break;\n            }\n            case CRS_TYPE_VERTICAL:\n            {\n                CRSVerticalCoordinateReferenceSystem *vertical = (CRSVerticalCoordinateReferenceSystem *) coordRefSys;\n                // ...\n                break;\n            }\n            default:\n                break;\n        }\n\n        // ...\n        break;\n    }\n\n    case CRS_CATEGORY_METADATA:\n    {\n\n        CRSCoordinateMetadata *metadata = (CRSCoordinateMetadata *) crs;\n\n        // ...\n        break;\n    }\n\n    case CRS_CATEGORY_OPERATION:\n    {\n\n        CRSOperation *operation = (CRSOperation *) crs;\n\n        switch (type) {\n            case CRS_TYPE_CONCATENATED_OPERATION:\n            {\n                CRSConcatenatedOperation *concatenatedOperation = (CRSConcatenatedOperation *) operation;\n                // ...\n                break;\n            }\n            case CRS_TYPE_COORDINATE_OPERATION:\n            {\n                CRSCoordinateOperation *coordinateOperation = (CRSCoordinateOperation *) operation;\n                // ...\n                break;\n            }\n            case CRS_TYPE_POINT_MOTION_OPERATION:\n            {\n                CRSPointMotionOperation *pointMotionOperation = (CRSPointMotionOperation *) operation;\n                // ...\n                break;\n            }\n            default:\n                break;\n        }\n\n        // ...\n        break;\n\n    }\n\n}\n\n```\n\n#### PROJ ####\n\n```objectivec\n\n// NSString *wkt = ...\n\nCRSObject *crs = [CRSReader read:wkt];\n\nCRSProjParams *projParamsFromCRS = [CRSProjParser paramsFromCRS:crs];\nNSString *projTextFromCRS = [CRSProjParser paramsTextFromCRS:crs];\nCRSProjParams *projParamsFromWKT = [CRSProjParser paramsFromText:wkt];\nNSString *projTextFromWKT = [CRSProjParser paramsTextFromText:wkt];\n\n```\n\n### Build ###\n\n[![Build \u0026 Test](https://github.com/ngageoint/coordinate-reference-systems-ios/workflows/Build%20\u0026%20Test/badge.svg)](https://github.com/ngageoint/coordinate-reference-systems-ios/actions/workflows/build-test.yml)\n\nBuild this repository using Xcode and/or CocoaPods:\n\n    pod repo update\n    pod install\n\nOpen crs-ios.xcworkspace in Xcode or build from command line:\n\n    xcodebuild -workspace 'crs-ios.xcworkspace' -scheme crs-ios build\n\nRun tests from Xcode or from command line:\n\n    xcodebuild test -workspace 'crs-ios.xcworkspace' -scheme crs-ios -destination 'platform=iOS Simulator,name=iPhone 15'\n\n### Include Library ###\n\nInclude this repository by specifying it in a Podfile using a supported option.\n\nPull from [CocoaPods](https://cocoapods.org/pods/crs-ios):\n\n    pod 'crs-ios', '~\u003e 1.0.5'\n\nPull from GitHub:\n\n    pod 'crs-ios', :git =\u003e 'https://github.com/ngageoint/coordinate-reference-systems-ios.git', :branch =\u003e 'master'\n    pod 'crs-ios', :git =\u003e 'https://github.com/ngageoint/coordinate-reference-systems-ios.git', :tag =\u003e '1.0.5'\n\nInclude as local project:\n\n    pod 'crs-ios', :path =\u003e '../coordinate-reference-systems-ios'\n\n### Swift ###\n\nTo use from Swift, import the crs-ios bridging header from the Swift project's bridging header\n\n    #import \"crs-ios-Bridging-Header.h\"\n\n```swift\n\n// var wkt: String = ...\n\nlet crs : CRSObject = CRSReader.read(wkt)\n\nvar type : CRSType = crs.type\nvar category : CRSCategoryType = crs.categoryType()\n\nlet text : String = CRSWriter.write(crs)\nlet prettyText : String = CRSWriter.writePretty(crs)\n\nswitch category{\n\ncase CRS_CATEGORY_CRS:\n\n    let coordRefSys : CRSCoordinateReferenceSystem = crs as! CRSCoordinateReferenceSystem\n\n    switch type {\n    case CRS_TYPE_BOUND:\n        let bound : CRSBoundCoordinateReferenceSystem = coordRefSys as! CRSBoundCoordinateReferenceSystem\n        // ...\n        break\n    case CRS_TYPE_COMPOUND:\n        let compound : CRSCompoundCoordinateReferenceSystem = coordRefSys as! CRSCompoundCoordinateReferenceSystem\n        // ...\n        break\n    case CRS_TYPE_DERIVED:\n        let derived : CRSDerivedCoordinateReferenceSystem = coordRefSys as! CRSDerivedCoordinateReferenceSystem\n        // ...\n        break\n    case CRS_TYPE_ENGINEERING:\n        let engineering : CRSEngineeringCoordinateReferenceSystem = coordRefSys as! CRSEngineeringCoordinateReferenceSystem\n        // ...\n        break\n    case CRS_TYPE_GEODETIC, CRS_TYPE_GEOGRAPHIC:\n        let geo : CRSGeoCoordinateReferenceSystem = coordRefSys as! CRSGeoCoordinateReferenceSystem\n        // ...\n        break\n    case CRS_TYPE_PARAMETRIC:\n        let parametric : CRSParametricCoordinateReferenceSystem = coordRefSys as! CRSParametricCoordinateReferenceSystem\n        // ...\n        break\n    case CRS_TYPE_PROJECTED:\n        let projected : CRSProjectedCoordinateReferenceSystem = coordRefSys as! CRSProjectedCoordinateReferenceSystem\n        // ...\n        break\n    case CRS_TYPE_TEMPORAL:\n        let temporal : CRSTemporalCoordinateReferenceSystem = coordRefSys as! CRSTemporalCoordinateReferenceSystem\n        // ...\n        break\n    case CRS_TYPE_VERTICAL:\n        let vertical : CRSVerticalCoordinateReferenceSystem = coordRefSys as! CRSVerticalCoordinateReferenceSystem\n        // ...\n        break\n    default:\n        break\n    }\n\n    // ...\n    break\n\ncase CRS_CATEGORY_METADATA:\n\n    let metadata : CRSCoordinateMetadata = crs as! CRSCoordinateMetadata\n\n    // ...\n    break\n\ncase CRS_CATEGORY_OPERATION:\n\n    let operation = crs as! CRSOperation\n\n    switch type {\n    case CRS_TYPE_CONCATENATED_OPERATION:\n        let concatenatedOperation : CRSConcatenatedOperation = operation as! CRSConcatenatedOperation\n        // ...\n        break\n    case CRS_TYPE_COORDINATE_OPERATION:\n        let coordinateOperation : CRSCoordinateOperation = operation as! CRSCoordinateOperation\n        // ...\n        break\n    case CRS_TYPE_POINT_MOTION_OPERATION:\n        let pointMotionOperation : CRSPointMotionOperation = operation as! CRSPointMotionOperation\n        // ...\n        break\n    default:\n        break\n    }\n\n    // ...\n    break\n\ndefault:\n    break\n}\n\n```\n\n#### PROJ ####\n\n```swift\n\n// var wkt: String = ...\n\nlet crs : CRSObject = CRSReader.read(wkt)\n\nlet projParamsFromCRS : CRSProjParams = CRSProjParser.params(fromCRS: crs)\nlet projTextFromCRS : String = CRSProjParser.paramsText(fromCRS: crs)\nlet projParamsFromWKT : CRSProjParams = CRSProjParser.params(fromText: wkt)\nlet projTextFromWKT : String = CRSProjParser.paramsText(fromText: wkt)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngageoint%2Fcoordinate-reference-systems-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngageoint%2Fcoordinate-reference-systems-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngageoint%2Fcoordinate-reference-systems-ios/lists"}