Compare commits

..
51 Commits
Author SHA1 Message Date
Even Rouault 0e993d9744 Update NEWS to 6.3.1 2020-02-10 10:51:02 +01:00
Even Rouault fd9c81b60a Update version and libtool number to 6.3.1 2020-02-10 10:34:57 +01:00
Even Rouault e379c1116f Update man-pages from Sphinx-docs 2020-02-10 10:32:50 +01:00
Even Rouault 83d02d0d17 Dockerfile: make it non-git dependent, so that it can work in branches, and Docker Hub builds; update version of grid archives 2020-02-09 17:59:16 +01:00
Even Rouault 98f38e4b57 Merge pull request #1919 from rouault/backport_fix_for_1906
[Backport 6.3] fixes for #1906 (test failures on i386)
2020-02-08 14:49:48 +01:00
Even Rouault a5d856771e Fix numerical precision issues in vandg and robin
Refs #1906
Fix remaining issues of https://github.com/OSGeo/PROJ/issues/1906#issuecomment-583168348
as found with gcc 8.2.0 -m32 -O2
2020-02-08 10:50:32 +01:00
Even Rouault 0fc56e02e5 Fix test issues on i386
Fix a few issues of #1906 found when running the test suite
on Ubuntu 16.04 with gcc 5.5 -m32. When applied on top of
the fix of #1912, make check succeeds
2020-02-08 10:50:32 +01:00
Kristian Evers 0019962137 cart: Avoid discontinuity at poles in the inverse case
This should avoid issues with numerical stability as uncovered in
https://github.com/OSGeo/PROJ/issues/1906.

Practically speaking this change isn't going to affect real life
scenarios since the position of the center of the Earth is rarely
expressed in geodetic coordinates.
2020-02-08 10:50:31 +01:00
Even Rouault 20e9bdea53 Merge pull request #1916 from rouault/backport_1884_1914_1915
[Backport 6.3] PR #1884 #1914 #1915
2020-02-06 19:42:04 +01:00
Even Rouault 7fb3ebbf37 Fix identification of ESRI-style datum names starting with D_ but without alias
Fixes #1911
2020-02-06 14:18:39 +01:00
Even Rouault 589c44aa12 Fix performance issue, affecting projinfo EPSG:7842
Fixes #1913

AuthorityFactory::createBetweenGeodeticCRSWithDatumBasedIntermediates() issued
a complex SQL query that pushes the SQLite3 query plan optimizer to its limits.
Was working reasonably with sqlite 3.11, but not with later versions.
So put less constraints in the main query and do post-processing checks and
auxiliary requests to avoid such issues.

For some unknown reason, this slightly slows down a bit execution time of the
whole test_cpp_api binary (~ 10%), but couldn't come with something better,
despite trying many variations of the main SQL query. It seems that in the
general case the non-filter LEFT JOIN on the supersession table helped,
except on this EPSG:7842 case.
2020-02-06 13:55:06 +01:00
Even Rouault d7cd77244e Fix ingestion of +proj=cea with +k_0
Fixes #1881

Digging into the implementation of proj=cea, it appears that
k_0 and lat_ts are intended to be exclusive ways of specifying the
same concept. EPSG only models the variant using lat_s.
So if k_0 is found and lat_ts is absent, compute the equivalent
value of lat_ts from k_0.

Note: k_0 should normally be in the [0,1] range. In case creative users
would use something outside, we raise an exception, even if the cea
implementation could potentially deal with any k_0 value. Hopefully
this is a (reasonable) limitation that will address nominal use cases.
2020-02-06 13:45:17 +01:00
Kristian Evers 4d0b2e91c5 Merge pull request #1905 from russkel/patch-1
tests: force use of bash for proj_add_test_script_sh
2020-02-04 13:27:40 +01:00
Russ e7450dd3ac tests: force use of bash for proj_add_test_script_sh 2020-02-04 10:44:46 +11:00
Anshul Singhvi 471822610b Mention the Julia package Proj4.jl
in `docs/src/development/bindings.rst`
2020-01-28 12:16:16 +01:00
Kristian Evers bd500d9a7e Merge pull request #1889 from PROJ-BOT/backport-1888-to-6.3
[Backport 6.3] Doc: advertize FOSS4G 2020
2020-01-27 09:15:46 +01:00
github-actions[bot] 18569b7f30 Doc: advertize FOSS4G 2020 2020-01-26 20:37:53 +00:00
Even Rouault 28121d1688 Merge pull request #1875 from rouault/backport_fix_wrong_use_of_derivingConversion
[6.3 backport] Fix wrong use of derivingConversionRef() that caused GDAL bug
2020-01-23 23:26:26 +01:00
Even Rouault 9a4b8a6c21 Merge pull request #1874 from rouault/backport_epsg_9_8_6
[6.3 backport] Database: update to EPSG v9.8.6
2020-01-23 23:26:17 +01:00
Even Rouault 79eed0da28 Fix wrong use of derivingConversionRef() that caused GDAL bug
Hopefully final cut at solving the same class of bug that the one
that affected QGIS in December.

This time, this hit GDAL in the situation of
https://lists.osgeo.org/pipermail/gdal-dev/2020-January/051500.html
The bug fix for that particular issue is in
PROJStringParser::createFromPROJString()

But grepping more in the code base, I could find other potential smelly
situations (might not be issues, but better be safe than sorry),
so let's fix them too.

Bottom line is:
derivingConversionRef() should *only* be used for consultation, and
never to create a new ProjectedCRS()
2020-01-23 19:11:05 +01:00
Even Rouault ba37cd70b2 Database: add a geoid_like value for proj_method column of grid_alternatives, fix related entries and simplify/robustify logic to deal with EPSG 'Geographic3D to GravityRelatedHeight' methods 2020-01-23 19:05:50 +01:00
Even Rouault ae1a0324fb Database: update to EPSG v9.8.6
Fixes #1867
2020-01-23 19:05:48 +01:00
Kristian Evers 0bd886d8b2 docs: add note about autogen.sh to install guide 2020-01-23 10:49:56 +01:00
Even Rouault a217239fa5 appveyor.yml: tune PATH order to fix error when running 'proj' on x64 builds 2020-01-22 15:06:47 +01:00
Kristian Evers 9b00240f4b Add explanation of the PROJ.4 -> PROJ shift to FAQ
closes #1511
2020-01-22 08:24:36 +01:00
Kristian Evers 1d4654847d Merge pull request #1861 from ravenAtSafe/patch-1
Document need for quotes when a pipeline grid path contains spaces
2020-01-22 08:19:13 +01:00
Even Rouault 31060c33c9 ProjectedCRS::identify(): fix wrong identification of some ESRI WKT linked to units
Fixes bug reported in https://lists.osgeo.org/pipermail/gdal-dev/2020-January/051481.html
2020-01-21 22:53:22 +01:00
Raven Kopelman 46d97de5bb Doc use of vertical grids with spaces in path 2020-01-21 09:53:10 -08:00
Raven Kopelman 673c60b140 Doc use of deformation grids with spaces in path 2020-01-21 09:51:41 -08:00
Raven Kopelman c28701eea5 grammar cleanup, removed confusing "either" 2020-01-21 09:48:41 -08:00
Raven Kopelman 28ff9563e4 Fix spelling mistake in "horizontal" 2020-01-21 09:46:56 -08:00
Raven Kopelman e311d508b5 Need quotes when a pipeline grid path contains spaces
Not certain whether this is appropriate when you are dealing with lists of grids, but it definitely helps for a single grid.
2020-01-20 16:35:03 -08:00
Kristian Evers d6330021e8 Explain why sweep axis affects geolocation (#1853)
Explain why sweep axis affects geolocation
2020-01-16 16:39:14 +01:00
Gerrit Holl 4915321e19 Explain why sweep axis affects geolocation
In the note on the sweep angle, add a line explaining why the sweep angle ultimately affects the geolocation, as it is not immediately or trivially obvious to see why it should matter what the outer or inner gimbal is.  To this end, link to a post on Mathematics Stack Exchange that explains this very well.
2020-01-16 14:52:11 +01:00
Even Rouault 3889496c8e Add RFC 4 text: Remote access to grids and GeoTIFF grids (#1747) 2020-01-15 22:12:59 +01:00
Kristian Evers 8583e33bad doc: Fix error in previous commit (duplicate link targets) 2020-01-14 12:48:20 +01:00
Kristian Evers 33a29c833f Doc: Update index of development section
Adds links to git repositories and adjusts deprecation warnings to
reflect that PROJ 6 has been released.
2020-01-14 11:02:55 +01:00
Even Rouault 1302fc0463 unitconvert with mjd time format: avoid potential integer overflow
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20072
2020-01-13 22:13:58 +01:00
Even Rouault e18e4823ac WKT1_GDAL export: limit datum name massaging to names matching EPSG (fixes #1835) 2020-01-11 12:02:14 +01:00
Even Rouault 6a2ee6fbc8 createOperations(): fix dealing with projected 3D CRS whose Z units != metre 2020-01-11 11:59:21 +01:00
Even Rouault 7d46771382 CompoundCRS::identify(): avoid exception when horiz/vertical part is a BoundCRS
The exception only affects C++ users. It was caught by the C layer.
2020-01-11 11:56:57 +01:00
Even Rouault 91e360027b projinfo: use No. abbreviation instead of UTF-8 character (fixes #1828) 2020-01-07 22:02:11 +01:00
Even Rouault d65f44248a Doc: add a 'Feedback from downstream projects' for PROJ6 migration 2020-01-06 16:22:10 +01:00
Even Rouault 6358877b2a operations_computation.rst: update with latest 6.3 adjustments 2020-01-02 15:30:38 +01:00
snowman2 b391fbc78b fix exporting CoordinateSystem to PROJ JSON with ID 2020-01-02 13:30:48 +01:00
Kristian Evers 6baadad43b Update github version in Sphinx config 2020-01-01 21:48:21 +01:00
Kristian Evers 77ae7cadbe switch to 6.3 branch for website generation 2020-01-01 21:45:19 +01:00
Kristian Evers 40e8677bf5 Update website for 6.3.0 release 2020-01-01 21:40:07 +01:00
Even Rouault 6d64ff8817 Travis: fix OSX builds 2019-12-29 00:30:41 +01:00
Even Rouault 5bd8446ef4 Database: add mapping for TOR27CSv1.GSB 2019-12-28 23:27:25 +01:00
Even Rouault 737e71f3b2 Database: add mapping for gg10_smv2.mnt and gg10_sbv2.mnt French grids 2019-12-28 23:27:25 +01:00
1273 changed files with 143284 additions and 284627 deletions
+30
View File
@@ -0,0 +1,30 @@
# Cirrus CI configuration
task:
name: FreeBSD
freebsd_instance:
matrix:
image: freebsd-12-0-release-amd64
# image: freebsd-11-2-release-amd64
# image: freebsd-10-4-release-amd64
env:
CIRRUS_CLONE_DEPTH: 1
MAKE_FLAGS: -j 2
cache:
folder: $HOME/.ccache
pkginstall_script:
- pkg install -y autoconf automake libtool pkgconf sqlite3 wget unzip ccache gmake
download_grid_script:
- wget https://download.osgeo.org/proj/proj-datumgrid-1.8.zip
- (cd data && unzip -o ../proj-datumgrid-1.8.zip)
configure_script:
- ./autogen.sh
- CC="ccache cc" CXX="ccache c++" ./configure --disable-static
compile_script:
- gmake $(MAKE_FLAGS)
test_script:
- gmake check $(MAKE_FLAGS)
-29
View File
@@ -1,29 +0,0 @@
# Cirrus CI configuration
task:
name: FreeBSD
freebsd_instance:
cpu: 4
matrix:
image: freebsd-12-1-release-amd64
# image: freebsd-11-2-release-amd64
# image: freebsd-10-4-release-amd64
env:
CIRRUS_CLONE_DEPTH: 1
MAKE_FLAGS: -j 4
# Disable cache: its upload can take up to 30 minutes!
#cache:
# folder: $HOME/.ccache
pkginstall_script:
- pkg install -y autoconf automake libtool pkgconf sqlite3 tiff ccache gmake
configure_script:
- ./autogen.sh
- ./configure --disable-static
compile_script:
- gmake $(MAKE_FLAGS)
test_script:
- gmake check $(MAKE_FLAGS)
-2
View File
@@ -1,2 +0,0 @@
BasedOnStyle: llvm
IndentWidth: 4
-2
View File
@@ -1,2 +0,0 @@
# Auto-generated file.
src/proj_symbol_rename.h
-2
View File
@@ -1,2 +0,0 @@
f090353792c0530a7aa5d02e44ad9b236986757b
aa818d6772887453432ce607410b784ff56308a1
-42
View File
@@ -1,42 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
labels: bug
---
<!-- Please search existing issues to avoid creating duplicates. -->
#### AI usage
- [ ] AI (Copilot or something similar) supported the creation f this ticket. See our [policy about AI tool use](https://proj.org/community/ai_tool_policy.html). Use of AI tools *must* be indicated.
- [ ] This ticket has been (mostly) written by myself (human), and is aimed at being read by humans. We *do* not accept AI generated wall-of-text
#### Example of problem
Demonstrate the problem you have found, either by using PROJ tools like
`cs2cs`, `cct` or `projinfo` **or** add a code snippet that highlights the
problem using the PROJ C/C++ API.
A "Minimal, Complete and Verifiable Example" will make it much easier for
maintainers to help you: <http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports>
```c
# Your code here
```
#### Problem description
[this should explain **why** the current behavior is a problem and why the
expected output is a better solution.]
#### Expected Output
#### Environment Information
- PROJ version (`proj`)
- Operation System Information
#### Installation method
- conda, apt-get, from source, etc...
@@ -1,7 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
labels: feature request
---
<!-- Describe the feature you'd like. -->
-7
View File
@@ -1,7 +0,0 @@
<!-- Feel free to remove check-list items aren't relevant to your change -->
- [ ] AI (Copilot or something similar) supported my development of this PR. See our [policy about AI tool use](https://proj.org/community/ai_tool_policy.html). Use of AI tools *must* be indicated.
- [ ] Closes #xxxx
- [ ] Tests added
- [ ] Added clear title that can be used to generate release notes
- [ ] Fully documented, including updating `docs/source/*.rst` for new API
-12
View File
@@ -1,12 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
cooldown:
default-days: 7
groups:
all-actions:
patterns:
- "*"
-47
View File
@@ -1,47 +0,0 @@
name: Update Stable Tag
on:
push:
branches:
- '**' # Matches all branches, but we later filter on the one matching the STABLE_BRANCH repository variable
permissions:
contents: read
jobs:
update-stable-tag:
runs-on: ubuntu-latest
if: github.repository == 'OSGeo/PROJ'
permissions:
contents: write
steps:
- name: Check branch match
id: check_branch
env:
STABLE_BRANCH: ${{ vars.STABLE_BRANCH }} # Repository variable
run: |
echo "Push detected on branch $GITHUB_REF"
if [[ "${GITHUB_REF#refs/heads/}" != "${STABLE_BRANCH}" ]]; then
echo "This workflow only runs for branch $STABLE_BRANCH. Skipping further steps."
echo "run=false" >> $GITHUB_OUTPUT
else
echo "run=true" >> $GITHUB_OUTPUT
fi
- name: Checkout code
if: steps.check_branch.outputs.run == 'true'
uses: actions/checkout@v7.0.1
- name: Tag
if: steps.check_branch.outputs.run == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "PROJ-bot@example.com"
git config --global user.name "PROJ-bot"
touch .dummy-file
git add .dummy-file
# Do that so that stable doesn't have the same git sha as the stable branch, so ReadTheDocs triggers a build
git commit -a -m "Add .dummy-file"
git checkout -b stable
git push -f origin stable
-19
View File
@@ -1,19 +0,0 @@
name: Backport
on:
pull_request_target:
types:
- closed
- labeled
permissions: {}
jobs:
backport:
runs-on: ubuntu-latest
name: Backport
steps:
- name: Backport Bot
id: backport
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( join( github.event.pull_request.labels.*.name ), 'backport') ) || contains( github.event.label.name, 'backport' ) )
uses: m-kuhn/backport@v1.2.8
with:
github_token: ${{ secrets.BACKPORT_TOKEN }}
-36
View File
@@ -1,36 +0,0 @@
name: CIFuzz
on:
pull_request:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'proj4'
dry-run: false
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'proj4'
fuzz-seconds: 600
dry-run: false
- name: Upload Crash
uses: actions/upload-artifact@v7
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
-57
View File
@@ -1,57 +0,0 @@
name: Clang Linux
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
clang_linux:
runs-on: ubuntu-latest
env:
PROJ_CMAKE_BUILD_OPTIONS: ${{ matrix.PROJ_CMAKE_BUILD_OPTIONS }}
strategy:
fail-fast: false
matrix:
include:
- name: Regular
id: regular
PROJ_CMAKE_BUILD_OPTIONS: ""
- name: EMBED_RESOURCE_FILES
id: EMBED_RESOURCE_FILES
PROJ_CMAKE_BUILD_OPTIONS: "-DEMBED_RESOURCE_FILES=ON"
- name: Without TIFF
id: without_tiff
PROJ_CMAKE_BUILD_OPTIONS: "-DENABLE_TIFF=OFF"
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Cache
uses: actions/cache@v6.1.0
id: cache
with:
path: |
${{ github.workspace }}/ccache.tar.gz
key: ${{ runner.os }}-cache-clang-${{ matrix.id }}-${{ github.run_id }}
restore-keys: ${{ runner.os }}-cache-clang-${{ matrix.id }}-
- name: Run
run: docker run -e PROJ_GITHUB_SHA=${{ github.sha }} -e CI -e TRAVIS_BUILD_DIR="$PWD" -e PROJ_CMAKE_BUILD_OPTIONS="$PROJ_CMAKE_BUILD_OPTIONS" -e WORK_DIR="$PWD" -e TRAVIS_OS_NAME=linux -e BUILD_NAME=linux_clang -v $PWD:$PWD ubuntu:24.04 $PWD/ci/clang_linux/start.sh
@@ -1,28 +0,0 @@
name: Clang Static Analyzer
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
clang_static_analyzer:
runs-on: ubuntu-24.04
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Run
run: ci/clang_static_analyzer/start.sh
-100
View File
@@ -1,100 +0,0 @@
name: Code Checks
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
cppcheck_2204:
runs-on: ubuntu-22.04
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Install Requirements
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends cppcheck
- name: Run cppcheck test
run: ./scripts/cppcheck.sh
cppcheck_master:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Install Requirements
run: |
sudo apt update
sudo apt install -y --no-install-recommends git cmake g++ make
- name: Build cppcheck
run: |
git clone https://github.com/danmar/cppcheck
cd cppcheck
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install
cd ../..
- name: Run cppcheck test (on push events)
if: ${{ github.event_name == 'push' }}
run: |
./scripts/cppcheck.sh
- name: Run cppcheck test, but ignore failures (on pull request)
if: ${{ github.event_name == 'pull_request' }}
run: |
# Do not fail the job. This is just used as a tool to monitor how we are regarding recent cppcheck
./scripts/cppcheck.sh || /bin/true
code_quality_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Detect missing includes
run: ./scripts/detect_missing_include.sh
other_checks:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Install Requirements
run: |
sudo apt-get install -y --no-install-recommends python3-pip
sudo apt-get remove -y python3-jsonschema
sudo pip3 install --break-system-packages cffconvert
- name: Validate citation file
run: |
cffconvert --validate
cffconvert -f bibtex
cffconvert -f apalike
linting:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-python@v7
- uses: pre-commit/action@v3.0.1
-104
View File
@@ -1,104 +0,0 @@
name: "CodeQL"
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'c-cpp' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v7.0.1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4.37.8
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
config: |
query-filters:
- exclude:
id: cpp/non-https-url
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ccache cmake g++ sqlite3 libsqlite3-dev libtiff-dev libcurl4-openssl-dev
# cache the .ccache directory
# key it on the runner os, build type, deps, and arch
# It's especially important to include arch in the key because we
# may get runtime errors with -mavx2 from objects built on a
# different architecture.
- name: Restore build cache
if: matrix.language == 'c-cpp'
id: restore-cache
uses: actions/cache/restore@v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ${{ matrix.id }}-${{ steps.get-arch.outputs.arch }}-${{ github.ref_name }}-${{ github.run_id }}
restore-keys: |
${{ matrix.id }}-${{ steps.get-arch.outputs.arch }}-${{ github.ref_name }}
${{ matrix.id }}-${{ steps.get-arch.outputs.arch }}
- name: Configure ccache
if: matrix.language == 'c-cpp'
run: |
echo CCACHE_BASEDIR=${{ github.workspace }} >> ${GITHUB_ENV}
echo CCACHE_DIR=${{ github.workspace }}/.ccache >> ${GITHUB_ENV}
echo CCACHE_MAXSIZE=250M >> ${GITHUB_ENV}
ccache -z
- name: Build
if: matrix.language == 'c-cpp'
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_CCACHE=YES
make -j$(nproc)
- name: Summarize ccache
if: matrix.language == 'c-cpp'
run: |
ccache -s
- name: Save build cache
if: matrix.language == 'c-cpp'
uses: actions/cache/save@v6.1.0
with:
path: ${{ github.workspace }}/.ccache
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4.37.8
with:
category: "/language:${{matrix.language}}"
-57
View File
@@ -1,57 +0,0 @@
name: Conda
on:
push:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
conda:
name: Conda ${{ matrix.platform }}
if: github.repository == 'OSGeo/PROJ'
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: true
matrix:
# macos-15-intel: Intel
# macos-14: arm64
platform: ['ubuntu-latest','windows-latest','macos-15-intel','macos-14']
env:
GHA_CI_PLATFORM: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v7.0.1
- uses: conda-incubator/setup-miniconda@v4
with:
miniforge-version: latest
use-mamba: true
channels: conda-forge
auto-update-conda: true
- name: Setup
shell: bash -l {0}
run: |
source ./ci/conda/setup.sh
- name: Build
shell: bash -l {0}
run: |
source ../ci/conda/compile.sh
working-directory: ./proj.4-feedstock
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.platform }}-conda-package
path: ./proj.4-feedstock/packages/
-54
View File
@@ -1,54 +0,0 @@
name: Coverity scan
# Controls when the action will run.
on:
# Run this action on a schedule (we're allowed a maximum of two per day)
schedule:
- cron: '0 18 * * SUN' # Sunday at 18:00 UTC
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
coverity:
runs-on: ubuntu-22.04
if: github.repository == 'OSGeo/PROJ'
steps:
- uses: actions/checkout@v7.0.1
- name: Install Libraries
run: |
sudo apt-get update
sudo apt-get install --allow-unauthenticated curl libcurl4-gnutls-dev libtiff-dev sqlite3 libsqlite3-dev g++ make cmake
- name: Configure PROJ
run: |
cmake . -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF
- name: Download Coverity Build Tool
run: |
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=OSGeo%2Fproj.4" -O cov-analysis-linux64.tar.gz
mkdir cov-analysis-linux64
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
- name: Build with cov-build
run: |
pwd
export PATH=`pwd`/cov-analysis-linux64/bin:$PATH
cov-build --dir cov-int make -j$(nproc)
- name: Submit to Coverity Scan
run: |
tar czvf proj.tgz cov-int
curl \
--form project=OSGeo%2Fproj.4 \
--form token=$TOKEN \
--form email=even.rouault@spatialys.com \
--form file=@proj.tgz \
--form version=master \
--form description="`git rev-parse --abbrev-ref HEAD` `git rev-parse --short HEAD`" \
https://scan.coverity.com/builds?project=OSGeo%2Fproj.4
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
-59
View File
@@ -1,59 +0,0 @@
name: Docs
on:
push:
branches-ignore:
- 'backport**'
- 'dependabot**'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
docs:
name: Documentation checks
runs-on: ubuntu-latest
strategy:
fail-fast: true
container: ghcr.io/osgeo/proj-docs
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4.1.7
- name: Update sphinx-rtd-theme
shell: bash -l {0}
run: |
pip install -U "sphinx-rtd-theme>=3.0.0"
- name: Print versions
shell: bash -l {0}
run: |
python3 --version
sphinx-build --version
python3 -m pip list --not-required --format=columns
- name: Lint .rst files
shell: bash -l {0}
run: |
set -eu
if find . -name '*.rst' | xargs grep -P '\t'; then echo 'Tabs are bad, please use four spaces in .rst files.'; false; fi
if find . -name '*.rst' | xargs grep "\.\.versionadded"; then echo 'Wrong annotation. Should be .. versionadded'; false; fi
if find . -name '*.rst' | xargs grep "\.\.note"; then echo 'Wrong annotation. Should be .. note'; false; fi
if find . -name '*.rst' | xargs grep "\.\.warning"; then echo 'Wrong annotation. Should be .. warning'; false; fi
if find . -name '*.rst' | xargs grep "\.\.codeblock"; then echo 'Wrong annotation. Should be .. codeblock'; false; fi
working-directory: ./docs
- name: Doxygen
shell: bash -l {0}
run: |
make .doxygen_up_to_date
working-directory: ./docs
- name: Spelling
shell: bash -l {0}
run: |
make spelling SPHINXOPTS=-W
working-directory: ./docs
-244
View File
@@ -1,244 +0,0 @@
name: Docker
on:
push:
paths-ignore:
- 'docs/**'
branches-ignore: ["dependabot/**"]
tags:
- '*'
pull_request:
paths-ignore:
- 'docs/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
# adapted from https://raw.githubusercontent.com/stefanprodan/podinfo/master/.github/workflows/release.yml
#
jobs:
containers:
name: ${{ matrix.container }} Container - ${{ matrix.runner }}
strategy:
matrix:
container: ["proj"]
runner: [ubuntu-24.04, ubuntu-24.04-arm]
dockerfile: ["./Dockerfile"]
include:
- container: "proj-docs"
dockerfile: "./docs/docbuild/Dockerfile"
runner: "ubuntu-24.04"
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
attestations: write
id-token: write
env:
# Only push proj-docs package for master
PUSH_PACKAGES: ${{ github.repository_owner == 'OSGeo' && github.event_name != 'pull_request' && (matrix.container == 'proj' || (matrix.container == 'proj-docs' && github.ref_name == 'master')) }}
CONTAINER: ${{ matrix.container }}
steps:
- uses: actions/checkout@v7.0.1
- name: Lint
id: lint
run: |
echo "are we pushing packages" ${{ env.PUSH_PACKAGES }}
echo "event_name" ${{ github.event_name }}
echo "ref" ${{ github.ref }}
- name: Set up Docker
uses: docker/setup-docker-action@v5.4.0
with:
daemon-config: |
{
"debug": false,
"features": {
"containerd-snapshotter": true
}
}
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v4
with:
version: latest
- name: Login to GitHub Container Registry
if: env.PUSH_PACKAGES == 'true'
uses: docker/login-action@v4.6.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Login to Docker Hub
if: env.PUSH_PACKAGES == 'true'
uses: docker/login-action@v4.6.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract container metadata
id: meta
uses: docker/metadata-action@v6
with:
images: |
ghcr.io/osgeo/${{ matrix.container }}
docker.io/osgeo/${{ matrix.container }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
- name: Prepare
id: prep
run: |
VERSION=sha-${GITHUB_SHA::8}
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF/refs\/tags\//}
# 9.8.0-x --> 9.8.0
VERSION=$(echo $VERSION | sed "s/-.*//" )
fi
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
runner=${{ matrix.runner }}
if [[ "$runner" == *"-arm" ]]; then
ARCH=arm64
else
ARCH=amd64
fi
echo "ARCH=$ARCH" >> $GITHUB_OUTPUT
- name: Build docs image
uses: docker/build-push-action@v7.3.0
if: matrix.container == 'proj-docs'
with:
push: ${{ env.PUSH_PACKAGES == 'true' }}
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64
tags: |
docker.io/osgeo/${{ matrix.container }}:${{ steps.prep.outputs.VERSION }}
docker.io/osgeo/${{ matrix.container }}:latest
ghcr.io/osgeo/${{ matrix.container }}:${{ steps.prep.outputs.VERSION }}
ghcr.io/osgeo/${{ matrix.container }}:latest
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }}
org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }}
- name: Prepare tags
id: prep_tags
run: |
TAGS="docker.io/osgeo/${{ matrix.container }}:${{ steps.prep.outputs.VERSION }}-${{ steps.prep.outputs.ARCH }}
ghcr.io/osgeo/${{ matrix.container }}:${{ steps.prep.outputs.VERSION }}-${{ steps.prep.outputs.ARCH }}"
if [ "${GITHUB_REF}" = "refs/heads/master" ]; then
TAGS="$TAGS
docker.io/osgeo/${{ matrix.container }}:latest-${{ steps.prep.outputs.ARCH }}
ghcr.io/osgeo/${{ matrix.container }}:latest-${{ steps.prep.outputs.ARCH }}"
fi
echo "tags<<EOF" >> $GITHUB_OUTPUT
echo "$TAGS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Build image
uses: docker/build-push-action@v7.3.0
id: push
if: matrix.container == 'proj'
with:
push: ${{ env.PUSH_PACKAGES == 'true' }}
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ${{ matrix.dockerfile }}
build-args: |
PROJ_GITHUB_SHA=${{ github.sha }}
platforms: linux/${{ steps.prep.outputs.ARCH }}
tags: ${{ steps.prep_tags.outputs.tags }}
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }}
org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }}
- name: Generate artifact attestation
if: ${{ env.PUSH_PACKAGES == 'true' && matrix.container == 'proj' }}
uses: actions/attest-build-provenance@v4.2.2
with:
subject-name: ghcr.io/osgeo/proj
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: ${{ env.PUSH_PACKAGES == 'true' }}
create-manifest:
permissions:
contents: read
packages: write
attestations: write
id-token: write
runs-on: ubuntu-latest
env:
PUSH_PACKAGES: ${{ github.repository_owner == 'OSGeo' && github.event_name != 'pull_request' }}
needs: containers
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v4.6.0
if: env.PUSH_PACKAGES == 'true'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v4.6.0
if: env.PUSH_PACKAGES == 'true'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Prepare
id: prep
run: |
VERSION=sha-${GITHUB_SHA::8}
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF/refs\/tags\//}
# 9.8.0-x --> 9.8.0
VERSION=$(echo $VERSION | sed "s/-.*//" )
fi
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Create and push multi-platform manifest
if: env.PUSH_PACKAGES == 'true'
run: |
docker buildx imagetools create \
-t ghcr.io/osgeo/proj:${{ steps.prep.outputs.VERSION }} \
ghcr.io/osgeo/proj:${{ steps.prep.outputs.VERSION }}-amd64 \
ghcr.io/osgeo/proj:${{ steps.prep.outputs.VERSION }}-arm64
docker buildx imagetools create \
-t osgeo/proj:${{ steps.prep.outputs.VERSION }} \
osgeo/proj:${{ steps.prep.outputs.VERSION }}-amd64 \
osgeo/proj:${{ steps.prep.outputs.VERSION }}-arm64
if [ "${GITHUB_REF}" = "refs/heads/master" ]; then
docker buildx imagetools create \
-t ghcr.io/osgeo/proj:latest \
ghcr.io/osgeo/proj:latest-amd64 \
ghcr.io/osgeo/proj:latest-arm64
docker buildx imagetools create \
-t osgeo/proj:latest \
osgeo/proj:latest-amd64 \
osgeo/proj:latest-arm64
fi
-90
View File
@@ -1,90 +0,0 @@
name: Emscripten
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
emscripten:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Build docker
run: docker build -t proj-emscripten-builder ci/emscripten/
- name: Artifacts folder
run: mkdir -p "$PWD"/wasm_out
- name: Run docker build
run: |
docker run --user $(id -u):$(id -g) --rm \
-e PROJ_GITHUB_SHA=${{ github.sha }} \
-v "$PWD":/build/proj_src \
-v "$PWD"/wasm_out:/build/install \
proj-emscripten-builder
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: proj-js-wasm
retention-days: 90
path: wasm_out/projModule.*
- name: Copy for tests
run: |
mkdir -p "$PWD"/out_node
cp wasm_out/projModule.* out_node
cp ci/emscripten/proj.ems.tests.js out_node
- name: Run docker tests
run: |
docker run --user $(id -u):$(id -g) --rm \
-v "$PWD"/out_node:/opt/node/tests \
node:24-alpine \
node /opt/node/tests/proj.ems.tests.js
- name: Deploy ssh key (wasm_proj)
if: ${{ github.event_name == 'push' && github.ref_name == 'master' && github.repository == 'OSGeo/PROJ' }}
shell: bash -l {0}
env:
WASM_PROJ_DEPLOY_SSH_KEY: ${{ secrets.WASM_PROJ_DEPLOY_SSH_KEY }} # zizmor: ignore[secrets-outside-env]
run: |
mkdir $HOME/.ssh && echo "${WASM_PROJ_DEPLOY_SSH_KEY}" > $HOME/.ssh/id_rsa
chmod 700 $HOME/.ssh && chmod 600 $HOME/.ssh/id_rsa
ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
eval `ssh-agent -s`
ssh-add $HOME/.ssh/id_rsa
- name: Deploy to wasm-proj/master pages
if: ${{ github.event_name == 'push' && github.ref_name == 'master' && github.repository == 'OSGeo/PROJ' }}
shell: bash -l {0}
run: |
set -x
set -e
git clone -b pages git@github.com:jjimenezshaw/wasm-proj.git wasm_proj_pages
cp wasm_out/projModule.* wasm_proj_pages/master/wasm/
cd wasm_proj_pages
git config user.email "proj-master-updater@example.com"
git config user.name "Automatic PROJ updater"
git remote -v
git rev-parse --abbrev-ref HEAD
git add -A
git commit -m "Update wasm with OSGeo/PROJ commit $GITHUB_SHA"
git push -f origin pages
-37
View File
@@ -1,37 +0,0 @@
name: Fedora Rawhide
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
fedora_rawhide:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Cache
uses: actions/cache@v6.1.0
id: cache
with:
path: |
${{ github.workspace }}/ccache.tar.gz
key: ${{ runner.os }}-cache-fedora_rawhide-${{ github.run_id }}
restore-keys: ${{ runner.os }}-cache-fedora_rawhide-
- name: Run
run: docker run -e PROJ_GITHUB_SHA=${{ github.sha }} -e CI -e WORK_DIR="$PWD" -v $PWD:$PWD fedora:rawhide $PWD/ci/fedora_rawhide/start.sh
-37
View File
@@ -1,37 +0,0 @@
name: Linux GCC 32bit
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
linux_gcc_32bit:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Cache
uses: actions/cache@v6.1.0
id: cache
with:
path: |
${{ github.workspace }}/ccache.tar.gz
key: ${{ runner.os }}-cache-gcc32bit-${{ github.run_id }}
restore-keys: ${{ runner.os }}-cache-gcc32bit-
- name: Run
run: docker run -e PROJ_GITHUB_SHA=${{ github.sha }} -e CI -e WORK_DIR="$PWD" -v $PWD:$PWD ubuntu:24.04 $PWD/ci/linux_gcc_32bit/start.sh
-64
View File
@@ -1,64 +0,0 @@
name: MacOS build
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
macos_build:
strategy:
fail-fast: true
matrix:
include:
- platform: "macos-15-intel"
architecture: "x64"
# macOS-14 is a M1 ARM64 MacOS runner: https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/
- platform: "macOS-14"
architecture: "arm64"
runs-on: ${{ matrix.platform }}
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v7.0.1
- uses: mamba-org/setup-micromamba@v3
with:
init-shell: bash
environment-file: ci/mac/environment.yml
- name: Cache
uses: actions/cache@v6.1.0
id: cache
with:
path: ${{ github.workspace }}/.ccache
key: ${{ runner.os }}-cache-mac-${{ matrix.architecture }}-${{ github.run_id }}
restore-keys: ${{ runner.os }}-cache-mac-${{ matrix.architecture }}-
- name: Install Requirements
shell: bash -l {0}
run: |
source ci/mac/before_install.sh
- name: Build
shell: bash -l {0}
run: |
export TRAVIS_BUILD_DIR=$PWD
source ci/mac/install.sh
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
TRAVIS_OS_NAME: osx
BUILD_NAME: osx
-37
View File
@@ -1,37 +0,0 @@
name: mingw_w64 build
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
mingw_w64_build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Cache
uses: actions/cache@v6.1.0
id: cache
with:
path: |
${{ github.workspace }}/ccache.tar.gz
key: ${{ runner.os }}-cache-mingw_w64-${{ github.run_id }}
restore-keys: ${{ runner.os }}-cache-mingw_w64-
- name: Build
run: docker run -e PROJ_GITHUB_SHA=${{ github.sha }} -e CI -e TRAVIS_OS_NAME=linux -e BUILD_NAME=mingw_w64 -e WORK_DIR="$PWD" -v $PWD:$PWD ubuntu:22.04 $PWD/ci/mingw_w64/start.sh
-93
View File
@@ -1,93 +0,0 @@
name: Handle stale issues
on:
schedule:
- cron: "30 2 * * *"
permissions:
contents: read
jobs:
stale:
permissions:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
if: github.repository_owner == 'osgeo'
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v11.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: >
The PROJ project highly values your contribution and would love to see
this work merged!
Unfortunately this PR has not had any activity in the last two months and
is being automatically marked as "stale".
If you think this pull request should be merged, please check
- that all unit tests are passing
- that all comments by reviewers have been addressed
- that there is enough information for reviewers, in particular
- link to any issues which this pull request fixes
- add a description of workflows which this pull request fixes
- add terminal output examples if applicable
- that you have written unit tests where possible
In case you should have any uncertainty, please leave a comment and we will
be happy to help you proceed with this pull request.
If there is no further activity on this pull request, it will be closed in a
week.
close-pr-message: >
While we hate to see this happen, this PR has been automatically closed because
it has not had any activity in the last 2 months. If this pull request should be
reconsidered, please follow the guidelines in the previous comment and reopen
this pull request. Or, if you have any further questions, just ask! We love to
help, and if there's anything the PROJ project can do to help push this PR forward
please let us know how we can assist.
stale-pr-label: 'stale'
exempt-pr-labels: 'pinned'
days-before-pr-stale: 60
days-before-pr-close: 7
stale-issue-message: >
The PROJ project highly values your report and would love to see it addressed.
However, this issue has been left in feedback mode for the last two months and is
being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information
or answer any open questions. If you could resolve the issue yourself meanwhile,
please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be
happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.
close-issue-message: >
While we hate to see this happen, this issue has been automatically closed because
it has not had any activity in the last two months despite being marked as feedback.
If this issue should be reconsidered, please follow the guidelines in the previous
comment and reopen this issue.
Or, if you have any further questions, there are also
[further support channels](https://proj.org/community/channels.html)
that can help you.
stale-issue-label: 'stale'
only-issue-labels: 'feedback'
days-before-issue-stale: 60
days-before-issue-close: 7
operations-per-run: 1000
-224
View File
@@ -1,224 +0,0 @@
name: Windows build
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
MSVC:
runs-on: windows-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
strategy:
fail-fast: false
matrix:
BUILD_SHARED_LIBS: [ON, OFF]
BUILD_TYPE: [Release, Debug]
env:
ARCH: x64
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS }}
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
CMAKE_GENERATOR: Ninja
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-python@v7
with:
python-version: "3.x"
- run: pip install pyyaml
- uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: ${{ env.ARCH }}
- name: Cache vcpkg packages
uses: actions/cache@v6.1.0
id: cache
with:
path: c:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-${{ hashFiles('.github/workflows/windows.yml') }}
- name: Install build requirements
shell: cmd
if: steps.cache.outputs.cache-hit != 'true'
run: |
vcpkg install sqlite3[core,tool,rtree] tiff curl --triplet=${{ env.ARCH }}-windows
- name: Build
shell: cmd
run: |
set VCPKG_INSTALLED=c:\vcpkg\installed\${{ env.ARCH }}-windows
dir %VCPKG_INSTALLED%\bin
dir %VCPKG_INSTALLED%\tools
set PROJ_DB_CACHE_DIR=%VCPKG_INSTALLED%\cache
mkdir %PROJ_DB_CACHE_DIR%
set PATH=%VCPKG_INSTALLED%\bin;%VCPKG_INSTALLED%\tools;%PATH%
set PROJ_BUILD=%GITHUB_WORKSPACE%\build
mkdir %PROJ_BUILD%
cd %PROJ_BUILD%
set PROJ_DIR=%GITHUB_WORKSPACE%\proj_dir
:: Not directly linked to BUILD_SHARED_LIBS, but a way to test different C++ standard versions
if "${{ env.BUILD_SHARED_LIBS }}"=="ON" (set CMAKE_CXX_STANDARD="-DCMAKE_CXX_STANDARD=20")
if "${{ env.BUILD_TYPE }}"=="Release" (set CMAKE_UNITY_BUILD_OPT="-DCMAKE_UNITY_BUILD=ON")
cmake ^
-D CMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}" ^
-D BUILD_SHARED_LIBS="${{ env.BUILD_SHARED_LIBS }}" ^
-D EXPORT_PDB="ON" ^
-D CMAKE_COMPILE_WARNING_AS_ERROR=ON ^
%CMAKE_CXX_STANDARD% ^
-D CMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake ^
-D CMAKE_INSTALL_PREFIX="%PROJ_DIR%" ^
-D PROJ_DB_CACHE_DIR=%PROJ_DB_CACHE_DIR% ^
%CMAKE_UNITY_BUILD_OPT% ..
ninja -v
ninja install
dir %PROJ_DIR%\bin
- name: Run tests
shell: bash -l {0}
run: |
export VCPKG_ROOT=c:/vcpkg
export platform=${{ env.ARCH }}
export VCPKG_INSTALLED=${VCPKG_ROOT}/installed/${platform}-windows
export PATH=${VCPKG_INSTALLED}/bin:${PATH}
export PROJ_DIR=${GITHUB_WORKSPACE}/proj_dir
export PROJ_BUILD=${GITHUB_WORKSPACE}/build
cd ${PROJ_BUILD}
ctest --output-on-failure -C "${{ env.BUILD_TYPE }}"
- name: Post install checks
shell: cmd
run: |
set VCPKG_ROOT=c:\vcpkg
set platform=${{ env.ARCH }}
set VCPKG_INSTALLED=%VCPKG_ROOT%\installed\%platform%-windows
set PATH=%VCPKG_INSTALLED%\bin;%PATH%
set PROJ_DIR=%GITHUB_WORKSPACE%\proj_dir
set PROJ_BUILD=%GITHUB_WORKSPACE%\build
cd %PROJ_BUILD%
set PATH=%PROJ_DIR%\bin;%PATH%
set BUILD_MODE=shared
if "${{ env.BUILD_SHARED_LIBS }}"=="OFF" (set BUILD_MODE=static)
if "${{ env.BUILD_TYPE }}"=="Release" call %GITHUB_WORKSPACE%\test\postinstall\test_cmake.bat %PROJ_DIR% %BUILD_MODE%
if "${{ env.BUILD_TYPE }}"=="Release" proj
MSYS2:
runs-on: windows-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
defaults:
run:
shell: msys2 {0}
strategy:
fail-fast: false
matrix:
BUILD_SHARED_LIBS: [ON, OFF]
env:
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS }}
BUILD_TYPE: Release
CMAKE_GENERATOR: "MSYS Makefiles"
steps:
- uses: actions/checkout@v7.0.1
- name: Cache
uses: actions/cache@v6.1.0
id: cache
with:
path: ~/.ccache
key: ${{ runner.os }}-cache-msys-${{ hashFiles('.github/workflows/windows.yml') }}
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
git
make
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ccache
mingw-w64-x86_64-curl
mingw-w64-x86_64-gcc
mingw-w64-x86_64-libtiff
mingw-w64-x86_64-python-yaml
mingw-w64-x86_64-sqlite3
- name: First build with EMBED_RESOURCE_FILES=ON and USE_ONLY_EMBEDDED_RESOURCE_FILES=ON
run: |
mkdir -p $HOME/.ccache
ccache -M 500M
ccache -s
PROJ_BUILD=${GITHUB_WORKSPACE}/build
PROJ_DIR=${GITHUB_WORKSPACE}/proj_dir
mkdir ${PROJ_BUILD}
cd ${PROJ_BUILD}
cmake \
-D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-D BUILD_SHARED_LIBS=${{ env.BUILD_SHARED_LIBS }} \
-D CMAKE_INSTALL_PREFIX="${PROJ_DIR}" \
-D CMAKE_COMPILE_WARNING_AS_ERROR=ON \
-D USE_CCACHE=ON \
-D PROJ_DB_CACHE_DIR=$HOME/.ccache \
-D CMAKE_UNITY_BUILD=ON \
-D Python_ROOT_DIR=/mingw64 \
-D CMAKE_CXX_STANDARD=20 \
-D EMBED_RESOURCE_FILES=ON \
-D USE_ONLY_EMBEDDED_RESOURCE_FILES=ON \
..
make -j 2
- name: Seond build with EMBED_RESOURCE_FILES=OFF and USE_ONLY_EMBEDDED_RESOURCE_FILES=OFF
run: |
PROJ_BUILD=${GITHUB_WORKSPACE}/build
PROJ_DIR=${GITHUB_WORKSPACE}/proj_dir
cd ${PROJ_BUILD}
cmake \
-D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-D BUILD_SHARED_LIBS=${{ env.BUILD_SHARED_LIBS }} \
-D CMAKE_INSTALL_PREFIX="${PROJ_DIR}" \
-D CMAKE_COMPILE_WARNING_AS_ERROR=ON \
-D USE_CCACHE=ON \
-D PROJ_DB_CACHE_DIR=$HOME/.ccache \
-D CMAKE_UNITY_BUILD=ON \
-D Python_ROOT_DIR=/mingw64 \
-D CMAKE_CXX_STANDARD=20 \
-D EMBED_RESOURCE_FILES=OFF \
-D USE_ONLY_EMBEDDED_RESOURCE_FILES=OFF \
..
make -j 2
make install
ls ${PROJ_DIR}/bin
ccache -s
- name: Run tests
run: |
PROJ_BUILD=${GITHUB_WORKSPACE}/build
PROJ_DIR=${GITHUB_WORKSPACE}/proj_dir
cd ${PROJ_BUILD}
ctest --output-on-failure
export PATH=${PROJ_DIR}/bin:${PATH}
BUILD_MODE=shared
if [ ${{ env.BUILD_SHARED_LIBS }} == "OFF" ]; then BUILD_MODE=static; fi
../test/postinstall/test_cmake.sh ${PROJ_DIR} ${BUILD_MODE}
# Disabled because of issue with (likely sqlite3.pc) that includes a unexisting -ldl
# ../test/postinstall/test_pkg-config.sh ${PROJ_DIR} ${BUILD_MODE}
proj
+15 -22
View File
@@ -26,19 +26,18 @@ build.local.sh
# Autotools
autom4te.cache
aclocal.m4
compile
config.cache
config.guess
config.log
config.status
config.sub
configure
depcomp
test-driver
install-sh
ltmain.sh
missing
/aclocal.m4
/compile
/config.cache
/config.guess
/config.log
/config.status
/config.sub
/configure
/depcomp
/install-sh
/ltmain.sh
/missing
libtool
.deps
.dirstamp
@@ -54,7 +53,7 @@ CTestTestfile.cmake
cmake_install.cmake
cmake/project-config*.cmake
install_manifest.txt
/CMakeUserPresets.json
/googletest*
# / (base)
/*.manifest
@@ -62,6 +61,7 @@ install_manifest.txt
/bin
/lib
/proj.pc
/test-driver
/Testing
# data
@@ -93,13 +93,11 @@ install_manifest.txt
/data/stlrnc
/data/stpaul
/data/tv_out
/data/for_tests/
# docs
tmp_breathe
/docs/.doxygen_up_to_date
/docs/build
/docs/plot/images
/latex
# m4
m4/libtool.m4
@@ -118,7 +116,6 @@ m4/lt~obsolete.m4
/src/proj_config.h
/src/proj_config.h.in
/src/projinfo
/src/projsync
/src/stamp-h1
/src/test-suite.log
@@ -132,10 +129,6 @@ m4/lt~obsolete.m4
/test/unit/proj_context_test
/test/unit/test_cpp_api
/test/unit/proj_errno_string_test
/test/unit/test_defmodel
/test/unit/test_network
/test/unit/test_tinshift
/tmp_alias/
# jniwrap
jniwrap/out
-30
View File
@@ -1,30 +0,0 @@
Aaron Puchert <aaron.puchert@sap.com> <aaronpuchert@alice-dsl.net>
Alan D. Snow <alansnow21@gmail.com>
Alan D. Snow <alansnow21@gmail.com> <alan.snow@pioneer.com>
Ben Boeckel <ben.boeckel@kitware.com> <mathstuf@users.noreply.github.com>
Bojan Šavrič <bsavric@esri.com>
Brendan Jurd <direvus@gmail.com> <brendan.jurd@geoplex.com.au>
Charles Karney <charles@karney.com>
Charles Karney <charles@karney.com> <charles.karney@sri.com>
Charles Karney <charles@karney.com> <ckarney@karney.com>
dalia2 <dalia@lmi.is> <57895979+dalia2@users.noreply.github.com>
Eli Rykoff <erykoff@stanford.edu>
Even Rouault <even.rouault@spatialys.com> <even.rouault@mines-paris.org>
George Ouzounoudis <geothrock@gmail.com>
Jeff McKenna <jeffmckenna@gmail.com>
Jeff McKenna <jeffmckenna@gmail.com> <jmckenna@gatewaygeomatics.com>
Jürnjakob Dugge <juernjakob@gmail.com>
Jürnjakob Dugge <juernjakob@gmail.com> <jdugge@users.noreply.github.com>
Kurt Schwehr <schwehr@google.com> <schwehr@gmail.com>
Martin Desruisseaux <martin.desruisseaux@geomatys.com> <martin.desruisseaux@geomatys.fr>
Mateusz Łoskot <mateusz@loskot.net>
Mike Taves <mwtoews@gmail.com>
Olli Räisä <olli.raisa@trimble.com>
Sebastian Val <Sebastian.Val@jpl.nasa.gov> <sval-dev@users.noreply.github.com>
Sveinung Himle <himsve@kartverket.no>
Sveinung Himle <himsve@kartverket.no> <56073535+himsve@users.noreply.github.com>
Sveinung Himle <himsve@kartverket.no> <Sveinung.Himle@kartverket.no>
Thomas Knudsen <thokn@sdfe.dk>
Thomas Knudsen <thokn@sdfe.dk> <busstoptaktik@users.noreply.github.com>
Thomas Knudsen <thokn@sdfe.dk> <knudsen.thomas@gmail.com>
Thomas Knudsen <thokn@sdfe.dk> <lastname DOT firstname AT gmail DOT com>
-26
View File
@@ -1,26 +0,0 @@
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
# Heading style
MD003:
style: "atx"
# Unordered list indentation
MD007:
indent: 2
# Line length
MD013: false
# line_length: 100
# Multiple headings with the same content
MD024:
siblings_only: true
# Multiple top-level headings in the same document
MD025: false
# First line in a file should be a top-level heading
MD041: false
# Required heading structure
MD043: true
-23
View File
@@ -1,23 +0,0 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v15.0.4'
hooks:
- id: clang-format
exclude: >
(?x)^(
data/|
schemas/|
docs/|
include/proj/nn.hpp|
include/proj/internal/lru_cache.hpp|
include/proj/internal/vendor/nlohmann/json.hpp|
src/wkt1_generated_parser.c|
src/wkt1_generated_parser.h|
src/wkt2_generated_parser.c|
src/wkt2_generated_parser.h|
src/geodesic.c|
src/geodesic.h|
src/proj_symbol_rename.h|
src/tests/geodtest.c|
src/tests/geodsigntest.c
)
-41
View File
@@ -1,41 +0,0 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
build:
os: "ubuntu-22.04"
tools:
python: "mambaforge-4.10"
jobs:
post_checkout:
- (git --no-pager log --pretty="tformat:%s -- %b" -1 | paste -s -d " " | grep -viqP "skip ci|ci skip") || exit 183
pre_build:
- ./docs/rtd/pre_build.sh
- ./scripts/doxygen.sh
- ./docs/rtd/plot.sh
post_build:
- ./docs/rtd/post_build.sh
apt_packages:
- cmake
- ninja-build
- g++
- sqlite3
- libsqlite3-dev
- libtiff-dev
- libcurl4-openssl-dev
formats:
- htmlzip
- pdf
conda:
environment: docs/environment.yml
sphinx:
configuration: docs/source/conf.py
fail_on_warning: true
+64 -29
View File
@@ -2,14 +2,9 @@
# with Travis-ci.org
language: cpp
# FIXME: Travis-CI builds are disabled
branches:
only:
- disabled_disabled
#branches:
# except:
# - /^(cherry-pick-)?backport-\d+-to-/
except:
- /^(cherry-pick-)?backport-\d+-to-/
cache:
directories:
@@ -19,42 +14,82 @@ matrix:
fast_finish: true
include:
#- os: linux
# dist: jammy
# compiler: gcc
# arch: s390x
# env:
# - BUILD_NAME=linux_generic
# - DETAILS="linux, s390x"
- os: linux
dist: xenial
compiler: gcc
services:
- docker
env:
- BUILD_NAME=linux_gcc
- DETAILS="linux, gcc"
- os: linux
dist: jammy
dist: xenial
compiler: gcc
arch: arm64
services:
- docker
env:
- BUILD_NAME=linux_generic
- DETAILS="linux, arm64"
- NPROC=4
- BUILD_NAME=linux_gcc7
- DETAILS="linux, gcc7"
- CC=gcc-7
- CXX=g++-7
- CXXFLAGS='-g -D_GLIBCXX_ASSERTIONS'
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- make
- autoconf
- automake
- os: linux
dist: xenial
compiler: clang
services:
- docker
env:
- BUILD_NAME=linux_clang
- DETAILS="linux, clang"
- os: osx
env:
- BUILD_NAME=osx
- DETAILS="osx"
- os: linux
dist: xenial
compiler: gcc
env:
- BUILD_NAME=mingw32
- DETAILS="mingw32"
- os: linux
compiler: gcc
dist: xenial
env:
- BUILD_NAME=csa
- DETAILS="CLang Static Analyzer"
allow_failures:
- env: BUILD_NAME=mingw32
before_install: ./ci/${BUILD_NAME}/before_install.sh
before_install: ./travis/${BUILD_NAME}/before_install.sh
install: ./ci/${BUILD_NAME}/install.sh
install: ./travis/${BUILD_NAME}/install.sh
script:
- echo "done"
after_success: ./travis/${BUILD_NAME}/after_success.sh
notifications:
#email:
# recipients:
# - gdal-commits@lists.osgeo.org
irc:
channels:
- "irc.freenode.org#proj-activity"
# - "irc.freenode.org#gdal"
# - "irc.freenode.org#proj"
- "irc.freenode.org#gdal"
use_notice: true
# #email:
# # recipients:
# # - gdal-commits@lists.osgeo.org
#
+42
View File
@@ -0,0 +1,42 @@
--------------------------------------------------------------------------------
Authors
--------------------------------------------------------------------------------
Original Author
................................................................................
Gerald Evenden (1935-2016)
Maintainer(s)
................................................................................
Kristian Evers <kreve@sdfe.dk>
Even Rouault <even.rouault@spatialys.com>
Project Steering Committee
--------------------------------------------------------------------------------
Process and membership can be found at:
https://proj.org/community/rfc/rfc-1.html
Chair
................................................................................
Kristian Evers <kreve@sdfe.dk>
Members
................................................................................
Frank Warmerdam <warmerdam@pobox.com>
Howard Butler <howard@hobu.co>
Charles Karney <charles.karney@sri.com>
Thomas Knudsen <thokn@sdfe.dk>
Even Rouault <even.rouault@spatialys.com>
Kurt Schwehr <schwehr@gmail.com>
Contributors
--------------------------------------------------------------------------------
The full list of contributors can be found on GitHub
https://github.com/OSGeo/PROJ/graphs/contributors
-33
View File
@@ -1,33 +0,0 @@
# Authors
## Original Author
- Gerald Evenden (1935-2016)
## Maintainers
- Kristian Evers <kreve@sdfi.dk>
- Even Rouault <even.rouault@spatialys.com>
## Project Steering Committee
Process and membership can be found at:
<https://proj.org/community/rfc/rfc-1.html>
Chair:
- Kristian Evers <kreve@sdfi.dk>
Members:
- Frank Warmerdam <warmerdam@pobox.com>
- Howard Butler <howard@hobu.co>
- Charles Karney <charles.karney@sri.com>
- Thomas Knudsen <thokn@sdfi.dk>
- Even Rouault <even.rouault@spatialys.com>
- Kurt Schwehr <schwehr@gmail.com>
## Contributors
The full list of contributors can be found on GitHub
<https://github.com/OSGeo/PROJ/graphs/contributors>
+2 -4
View File
@@ -1,8 +1,7 @@
To cite PROJ in publications use:
PROJ contributors (2026). PROJ coordinate transformation software
PROJ contributors (2019). PROJ coordinate transformation software
library. Open Source Geospatial Foundation. URL https://proj.org/.
DOI: 10.5281/zenodo.5884394
A BibTeX entry for LaTeX users is
@@ -12,7 +11,6 @@ A BibTeX entry for LaTeX users is
title = {{PROJ} coordinate transformation software library},
author = {{PROJ contributors}},
organization = {Open Source Geospatial Foundation},
year = {2026},
year = {2020},
url = {https://proj.org/},
doi = {10.5281/zenodo.5884394},
}
-70
View File
@@ -1,70 +0,0 @@
cff-version: 1.2.0
message: Please cite this software using these metadata or in the CITATION file.
type: software
title: PROJ
version: 9.9.0
date-released: 2026-09-15
doi: 10.5281/zenodo.5884394
abstract: PROJ is a generic coordinate transformation software that transforms
geospatial coordinates from one coordinate reference system (CRS) to another.
This includes cartographic projections as well as geodetic transformations.
url: https://proj.org
repository-code: https://github.com/OSGeo/PROJ/
license: MIT
authors:
- given-names: Gerald I.
family-names: Evenden
affiliation: United States Geological Survey
- given-names: Even
family-names: Rouault
affiliation: Spatialys
orcid: https://orcid.org/0000-0002-5068-0476
- given-names: Frank
family-names: Warmerdam
affiliation: Planet Labs Inc
- given-names: Kristian
family-names: Evers
affiliation: Danish Agency for Climate Data
orcid: https://orcid.org/0000-0002-1310-4576
- given-names: Thomas
family-names: Knudsen
affiliation: Danish Agency for Climate Data
- given-names: Howard
family-names: Butler
affiliation: Hobu Inc
orcid: https://orcid.org/0000-0002-5340-1380
- given-names: Mike W.
family-names: Taves
affiliation: Earth Sciences New Zealand
orcid: https://orcid.org/0000-0003-3657-7963
- given-names: Kurt
family-names: Schwehr
affiliation: Google Inc
orcid: https://orcid.org/0000-0002-5624-8190
- given-names: Elliott
family-names: Sales de Andrade
orcid: https://orcid.org/0000-0001-7310-8942
- given-names: Charles
family-names: Karney
affiliation: SRI International
orcid: https://orcid.org/0000-0002-5006-5836
- given-names: Sebastiaan
family-names: Couwenberg
- given-names: Nyall
family-names: Dawson
affiliation: North Road
orcid: https://orcid.org/0000-0001-9812-7584
- given-names: Alan D.
family-names: Snow
affiliation: Corteva
orcid: https://orcid.org/0000-0002-7333-3100
- given-names: Javier
family-names: Jimenez Shaw
orcid: https://orcid.org/0000-0002-7227-9173
keywords:
- PROJ
- geodesy
- cartography
- coordinates
- projections
- conversion
+83 -404
View File
@@ -9,35 +9,33 @@
################################################################################
# General settings
################################################################################
cmake_minimum_required(VERSION 3.22.1)
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(PROJ
DESCRIPTION "PROJ coordinate transformation software library"
LANGUAGES C CXX
)
# For historic reasons, the CMake PROJECT-NAME is PROJ4
project(PROJ4 LANGUAGES C CXX)
set(PROJECT_INTERN_NAME PROJ)
# Only interpret if() arguments as variables or keywords when unquoted
cmake_policy(SET CMP0054 NEW)
include(CheckCXXCompilerFlag)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
cmake_policy(SET CMP0054 NEW)
endif()
# Set C++ version
# Make CMAKE_CXX_STANDARD available as cache option overridable by user
set(CMAKE_CXX_STANDARD 17
CACHE STRING "C++ standard version to use (default is 17)")
message(CHECK_START "Requiring C++${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD 11
CACHE STRING "C++ standard version to use (default is 11)")
message(STATUS "Requiring C++${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
message(CHECK_PASS "done")
message(STATUS "Requiring C++${CMAKE_CXX_STANDARD} - done")
# Set C99 version
# Make CMAKE_C_STANDARD available as cache option overridable by user
set(CMAKE_C_STANDARD 99
CACHE STRING "C standard version to use (default is 99)")
message(CHECK_START "Requiring C${CMAKE_C_STANDARD}")
message(STATUS "Requiring C${CMAKE_C_STANDARD}")
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
message(CHECK_PASS "done")
message(STATUS "Requiring C${CMAKE_C_STANDARD} - done")
# Set global -fvisibility=hidden
set(CMAKE_C_VISIBILITY_PRESET hidden)
@@ -46,62 +44,27 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
# Set warnings as variables, then store as cache options
set(PROJ_common_WARN_FLAGS # common only to GNU/Clang C/C++
-Wall
-Wdate-time
-Werror=format-security
-Werror=vla
-Wextra
-Wformat
-Wimplicit-fallthrough
-Wmissing-declarations
-Wshadow
-Wswitch
-Wshadow
-Wunused-parameter
-Wmissing-declarations
-Wformat
-Wformat-security
)
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(PROJ_common_WARN_FLAGS ${PROJ_common_WARN_FLAGS}
-Wduplicated-cond
-Wduplicated-branches
-Wlogical-op
)
set(PROJ_C_WARN_FLAGS ${PROJ_common_WARN_FLAGS}
-Wmissing-prototypes
)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8)
set(PROJ_CXX_WARN_FLAGS ${PROJ_common_WARN_FLAGS} -Wextra-semi)
endif()
set(PROJ_CXX_WARN_FLAGS ${PROJ_common_WARN_FLAGS}
-Weffc++
# -Wold-style-cast
-Woverloaded-virtual
-Wzero-as-null-pointer-constant
)
set(PROJ_CXX_WARN_FLAGS ${PROJ_common_WARN_FLAGS})
elseif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
set(PROJ_common_WARN_FLAGS ${PROJ_common_WARN_FLAGS}
-Wcomma
-Wdeprecated
-Wdocumentation -Wno-documentation-deprecated-sync
-Wfloat-conversion
-Wlogical-op-parentheses
)
# Not sure about the minimum version, but clang 12 complains about \file, @cond Doxygen_Suppress, etc.
if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL 18.0.0)
set(PROJ_common_WARN_FLAGS ${PROJ_common_WARN_FLAGS} -Wdocumentation-unknown-command)
endif()
set(PROJ_C_WARN_FLAGS ${PROJ_common_WARN_FLAGS}
-Wmissing-prototypes
-Wfloat-conversion
-Wc11-extensions
)
set(PROJ_CXX_WARN_FLAGS ${PROJ_common_WARN_FLAGS}
-Weffc++
-Wextra-semi
# -Wold-style-cast
-Woverloaded-virtual
-Wshorten-64-to-32
-Wunused-private-field
-Wzero-as-null-pointer-constant
-Wweak-vtables
-Wfloat-conversion
)
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
add_definitions(/D_CRT_SECURE_NO_WARNINGS) # Eliminate deprecation warnings
@@ -110,11 +73,6 @@ elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
/wd4706 # Suppress warning about assignment within conditional expression
/wd4996 # Suppress warning about sprintf, etc., being unsafe
)
if("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "arm64")
# Suppress an inaccurate warning when compiling for an MSVC/ARM64 platform
# It incorrectly assumes a division by zero is possible despite a check
set(PROJ_C_WARN_FLAGS ${PROJ_C_WARN_FLAGS} /wd4723)
endif()
set(PROJ_CXX_WARN_FLAGS /EHsc ${PROJ_C_WARN_FLAGS})
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
if(MSVC)
@@ -125,28 +83,6 @@ elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
set(PROJ_CXX_WARN_FLAGS -Wall)
endif()
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
# Intel CXX compiler based on clang defaults to -ffast-math, which
# breaks std::isinf(), std::isnan(), etc.
string(APPEND CMAKE_C_FLAGS " -fno-fast-math")
string(APPEND CMAKE_CXX_FLAGS " -fno-fast-math")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13 AND
CMAKE_SIZEOF_VOID_P EQUAL 4)
# GCC 13 and later changed their C++ excess precision support, which impacts
# 32-bit builds. This restores the previous behavior.
string(APPEND CMAKE_CXX_FLAGS " -fexcess-precision=fast")
endif()
# Add other supported compiler flags
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
check_cxx_compiler_flag(-Wdeprecated-copy-dtor HAVE_DEP_COPY_DTOR_FLAG)
if(HAVE_DEP_COPY_DTOR_FLAG)
set(PROJ_CXX_WARN_FLAGS ${PROJ_CXX_WARN_FLAGS} -Wdeprecated-copy-dtor)
endif()
endif()
set(PROJ_C_WARN_FLAGS "${PROJ_C_WARN_FLAGS}"
CACHE STRING "C flags used to compile PROJ targets")
set(PROJ_CXX_WARN_FLAGS "${PROJ_CXX_WARN_FLAGS}"
@@ -156,174 +92,78 @@ set(PROJ_CXX_WARN_FLAGS "${PROJ_CXX_WARN_FLAGS}"
# PROJ CMake modules
################################################################################
# Path to additional CMake modules
set(CMAKE_MODULE_PATH ${PROJ_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH ${PROJ4_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
include(ProjUtilities)
message(STATUS "Configuring PROJ:")
message(STATUS "")
colormsg(_HIBLUE_ "Configuring PROJ:")
################################################################################
#PROJ version information
################################################################################
include(ProjVersion)
proj_version(MAJOR 9 MINOR 9 PATCH 0)
set(PROJ_SOVERSION 25)
set(PROJ_BUILD_VERSION "${PROJ_SOVERSION}.${PROJ_VERSION}")
proj_version(MAJOR 6 MINOR 3 PATCH 1)
set(PROJ_API_VERSION "18")
set(PROJ_BUILD_VERSION "18.1.3")
################################################################################
# Build features and variants
################################################################################
include(Ccache)
include(ProjConfig)
include(ProjMac)
include(policies)
##############################################
### SWITCH BETWEEN STATIC OR SHARED LIBRARY###
##############################################
# default config is shared
option(BUILD_SHARED_LIBS "Build PROJ library shared." ON)
################################################################################
# Check for nlohmann_json
################################################################################
set(NLOHMANN_JSON_ORIGIN "auto" CACHE STRING
"nlohmann/json origin. The default auto will try to use external \
nlohmann/json if possible")
set_property(CACHE NLOHMANN_JSON_ORIGIN PROPERTY STRINGS auto internal external)
# Probably not the strictest minimum, but known to work with it
set(MIN_NLOHMANN_JSON_VERSION 3.7.0)
if(NLOHMANN_JSON_ORIGIN STREQUAL "external")
find_package(nlohmann_json REQUIRED)
set(NLOHMANN_JSON "external")
elseif(NLOHMANN_JSON_ORIGIN STREQUAL "internal")
set(NLOHMANN_JSON "internal")
else()
find_package(nlohmann_json QUIET)
if(nlohmann_json_FOUND)
set(NLOHMANN_JSON "external")
else()
set(NLOHMANN_JSON "internal")
endif()
endif()
if(NLOHMANN_JSON STREQUAL "external")
# Check minimum version
if(nlohmann_json_VERSION VERSION_LESS MIN_NLOHMANN_JSON_VERSION)
message(STATUS "external nlohmann/json version ${nlohmann_json_VERSION} "
"is older than minimum requirement ${MIN_NLOHMANN_JSON_VERSION}")
set(NLOHMANN_JSON "internal")
else()
message(STATUS "found nlohmann/json version ${nlohmann_json_VERSION}")
endif()
endif()
message(STATUS "nlohmann/json: ${NLOHMANN_JSON}")
################################################################################
# Check for sqlite3
################################################################################
find_program(EXE_SQLITE3 sqlite3)
if(NOT EXE_SQLITE3)
message(SEND_ERROR "sqlite3 binary not found!")
endif()
# Deprecated variables since PROJ 9.4.0
if(DEFINED SQLITE3_INCLUDE_DIR)
message(DEPRECATION "Use SQLite3_INCLUDE_DIR instead of SQLITE3_INCLUDE_DIR")
set(SQLite3_INCLUDE_DIR ${SQLITE3_INCLUDE_DIR})
endif()
if(DEFINED SQLITE3_LIBRARY)
message(DEPRECATION "Use SQLite3_LIBRARY instead of SQLITE3_LIBRARY")
set(SQLite3_LIBRARY ${SQLITE3_LIBRARY})
find_package(Sqlite3 REQUIRED)
if(NOT SQLITE3_FOUND)
message(SEND_ERROR "sqlite3 dependency not found!")
endif()
find_package(SQLite3 3.11 REQUIRED)
if(NOT TARGET SQLite3::SQLite3) # CMake < 4.3
add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3)
endif()
################################################################################
# Check for libtiff
################################################################################
option(ENABLE_TIFF "Enable TIFF support to read some grids" ON)
mark_as_advanced(ENABLE_TIFF)
set(TIFF_ENABLED FALSE)
if(ENABLE_TIFF)
find_package(TIFF REQUIRED)
if(TIFF_FOUND)
set(TIFF_ENABLED TRUE)
else()
message(SEND_ERROR
"libtiff dependency not found! Use ENABLE_TIFF=OFF to force it off")
endif()
else()
message(WARNING
"TIFF support is not enabled and will result in the inability to read "
"some grids")
endif()
################################################################################
# Check for curl
################################################################################
option(ENABLE_CURL "Enable Curl support" ON)
set(CURL_ENABLED FALSE)
if(ENABLE_CURL)
find_package(CURL REQUIRED)
if(CURL_FOUND)
set(CURL_ENABLED TRUE)
# Curl SSL options are described in
# https://curl.se/libcurl/c/CURLOPT_SSL_OPTIONS.html
#set(CURLSSLOPT_NO_REVOKE 2)
#set(SSL_OPTIONS ${CURLSSLOPT_NO_REVOKE})
#add_compile_definitions(SSL_OPTIONS=${SSL_OPTIONS})
else()
message(SEND_ERROR "curl dependency not found!")
endif()
endif()
################################################################################
# Check for Emscripten fetch
################################################################################
option(ENABLE_EMSCRIPTEN_FETCH "Enable Emscripten fetch support" OFF)
set(EMSCRIPTEN_FETCH_ENABLED FALSE)
if(ENABLE_EMSCRIPTEN_FETCH)
set(EMSCRIPTEN_FETCH_ENABLED TRUE)
endif()
################################################################################
option(EMBED_PROJ_DATA_PATH "Whether the PROJ_DATA path should be embedded" ON)
if(DEFINED PROJ_LIB_ENV_VAR_TRIED_LAST)
set(PROJ_DATA_ENV_VAR_TRIED_LAST ${PROJ_LIB_ENV_VAR_TRIED_LAST})
message(WARNING "PROJ_LIB_ENV_VAR_TRIED_LAST option has been renamed to PROJ_DATA_ENV_VAR_TRIED_LAST. PROJ_LIB_ENV_VAR_TRIED_LAST is still working for now, but may be completely replaced by PROJ_DATA_ENV_VAR_TRIED_LAST in a future release")
else()
option(PROJ_DATA_ENV_VAR_TRIED_LAST "Whether the PROJ_DATA environment variable should be tried after the hardcoded location" OFF)
endif()
if(PROJ_DATA_ENV_VAR_TRIED_LAST)
add_definitions(-DPROJ_DATA_ENV_VAR_TRIED_LAST)
endif()
# Would build and run with older versons, but with horrible performance
# See https://github.com/OSGeo/PROJ/issues/1718
IF("${SQLITE3_VERSION}" VERSION_LESS "3.11")
message(SEND_ERROR "sqlite3 >= 3.11 required!")
ENDIF()
################################################################################
# threading configuration
################################################################################
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads)
include(CheckIncludeFiles)
include(CheckCSourceCompiles)
if(MSVC)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS} /WX /W4")
else()
set(CMAKE_REQUIRED_LIBRARIES m)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall")
endif()
if(Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
set(CMAKE_REQUIRED_LIBRARIES
"${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}")
check_c_source_compiles("
#include <pthread.h>
int main(int argc, char* argv[]) {
(void)PTHREAD_MUTEX_RECURSIVE;
(void)argv;
return argc;
}
" HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN)
if(HAVE_PTHREAD_MUTEX_RECURSIVE_DEFN)
add_definitions(-DHAVE_PTHREAD_MUTEX_RECURSIVE=1)
endif()
endif()
# Set a default build type for single-configuration cmake generators if
@@ -338,211 +178,50 @@ if(MSVC OR CMAKE_CONFIGURATION_TYPES)
set(CMAKE_DEBUG_POSTFIX _d)
endif()
option(PROJ_TESTS "Enable build of collection of PROJ tests" ON)
boost_report_value(PROJ_TESTS)
if(PROJ_TESTS)
enable_testing()
endif()
include(ProjTest)
# Put the libraries and binaries that get built into directories at the
# top of the build tree rather than in hard-to-find leaf
# directories. This simplifies manual testing and the use of the build
# tree rather than installed PROJ libraries.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJ_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJ_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJ_BINARY_DIR}/bin)
# tree rather than installed Boost libraries.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
################################################################################
# Installation
################################################################################
include(ProjInstallPath)
# By default GNUInstallDirs will use the upper case project name
# for CMAKE_INSTALL_DOCDIR, resulting in something like share/doc/PROJ
# instead of share/doc/proj which historically have been the path used
# by the project.
# Here force the use of a lower case project name and reset after
# GNUInstallDirs has done its thing
set(PROJECT_NAME_ORIGINAL "${PROJECT_NAME}")
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME)
include(GNUInstallDirs)
set(PROJECT_NAME "${PROJECT_NAME_ORIGINAL}")
################################################################################
# Tests
################################################################################
option(BUILD_TESTING "Build the testing tree." ON)
if(BUILD_TESTING)
enable_testing()
include(ProjTest)
else()
message(STATUS "Testing disabled")
endif()
################################################################################
# Whether we should embed resources
################################################################################
include(CheckCSourceCompiles)
function (is_sharp_embed_available res)
if (NOT EMSCRIPTEN AND
((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0) OR
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
set(TEST_SHARP_EMBED
"static const unsigned char embedded[] = {\n#embed __FILE__\n};\nint main() { (void)embedded; return 0;}"
)
set(CMAKE_C_STANDARD_BACKUP "${CMAKE_C_STANDARD}")
set(CMAKE_C_STANDARD "23")
check_c_source_compiles("${TEST_SHARP_EMBED}" _TEST_SHARP_EMBED)
set(CMAKE_C_STANDARD "${CMAKE_C_STANDARD_BACKUP}")
if (_TEST_SHARP_EMBED)
set(${res} ON PARENT_SCOPE)
else()
set(${res} OFF PARENT_SCOPE)
endif()
else()
set(${res} OFF PARENT_SCOPE)
endif()
endfunction()
is_sharp_embed_available(IS_SHARP_EMBED_AVAILABLE_RES)
if (NOT DEFINED BUILD_SHARED_LIBS)
message(FATAL_ERROR "BUILD_SHARED_LIBS should be set")
endif()
if (NOT BUILD_SHARED_LIBS)
set(DEFAULT_EMBED_RESOURCE_FILES ON)
else()
set(DEFAULT_EMBED_RESOURCE_FILES OFF)
endif()
option(EMBED_RESOURCE_FILES "Whether resource files (limited to proj.db) should be embedded into the PROJ library" ${DEFAULT_EMBED_RESOURCE_FILES})
option(USE_ONLY_EMBEDDED_RESOURCE_FILES "Whether embedded resource files (limited to proj.db) should be used (should nominally be used together with EMBED_RESOURCE_FILES=ON, otherwise this will result in non-functional builds)" OFF)
if (USE_ONLY_EMBEDDED_RESOURCE_FILES AND NOT EMBED_RESOURCE_FILES)
message(WARNING "USE_ONLY_EMBEDDED_RESOURCE_FILES=ON set but EMBED_RESOURCE_FILES=OFF: some drivers will lack required resource files")
endif()
set(BINDIR "${DEFAULT_BINDIR}"
CACHE PATH "The directory to install binaries into.")
set(LIBDIR "${DEFAULT_LIBDIR}"
CACHE PATH "The directory to install libraries into.")
set(DATADIR "${DEFAULT_DATADIR}"
CACHE PATH "The directory to install data files into.")
set(DOCDIR "${DEFAULT_DOCDIR}"
CACHE PATH "The directory to install doc files into.")
set(INCLUDEDIR "${DEFAULT_INCLUDEDIR}"
CACHE PATH "The directory to install includes into.")
set(CMAKECONFIGDIR "${DEFAULT_CMAKEDIR}"
CACHE PATH "The directory to install cmake config files into.")
################################################################################
# Build configured components
################################################################################
include_directories(${PROJ4_SOURCE_DIR}/src)
set(PROJ_DICTIONARY
world
other.extra
nad27
GL27
nad83
nad.lst
CH
ITRF2000
ITRF2008
ITRF2014
ITRF2020
)
include_directories(${PROJ_SOURCE_DIR}/src)
message(STATUS "")
add_subdirectory(data)
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(man)
add_subdirectory(cmake)
if(BUILD_TESTING)
if(PROJ_TESTS)
add_subdirectory(test)
endif()
option(BUILD_EXAMPLES "Whether to build example programs" OFF)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
add_subdirectory(scripts)
set(docfiles COPYING NEWS.md AUTHORS.md)
install(FILES ${docfiles}
DESTINATION ${CMAKE_INSTALL_DOCDIR})
################################################################################
# Build debug symbols
################################################################################
option(EXPORT_PDB "Export PDB file" OFF)
if (WIN32 AND EXPORT_PDB)
target_compile_options(proj PRIVATE /Zi /Zf)
target_link_options(proj PRIVATE /DEBUG /OPT:REF /OPT:ICF)
if(BUILD_SHARED_LIBS)
set(pdbFile $<TARGET_PDB_FILE:proj>)
else()
set(pdbDirFullPath ${CMAKE_BINARY_DIR}/lib)
set_target_properties(proj
PROPERTIES
COMPILE_PDB_OUTPUT_DIRECTORY ${pdbDirFullPath}
COMPILE_PDB_NAME proj)
set(pdbFile ${pdbDirFullPath}/proj.pdb)
endif()
install(FILES ${pdbFile} DESTINATION lib)
endif()
################################################################################
# pkg-config support
################################################################################
configure_proj_pc()
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/proj.pc
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
################################################################################
# "make dist" workalike
################################################################################
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "proj-${PROJ_VERSION}")
set(CPACK_PACKAGE_VENDOR "OSGeo")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJ_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJ_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJ_VERSION_PATCH})
set(CPACK_VERBATIM_VARIABLES TRUE)
set(CPACK_SOURCE_IGNORE_FILES
/\\..* # any file/directory starting with .
/.*\\.yml
/.*\\.gz
/.*\\.zip
/.*build.*/
\\.deps
/autogen\\.sh
/autom4te\\.cache
/ci/
/CODE_OF_CONDUCT.md
/CONTRIBUTING.md
/disabled_workflows/
/Dockerfile
/docs/
/Doxyfile
/HOWTO-RELEASE.md
/m4/lt*
/m4/libtool*
/media/
/schemas/
/test/fuzzers/
/test/gigs/.*gie\\.failing
/test/postinstall/
/travis/
${PROJECT_BINARY_DIR}
)
include(CPack)
get_property(_is_multi_config_generator GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT _is_multi_config_generator)
add_custom_target(dist
COMMAND ${CMAKE_MAKE_PROGRAM} package_source
)
message(STATUS "PROJ: Configured 'dist' target")
endif()
configure_file(cmake/uninstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/proj_uninstall.cmake @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/proj_uninstall.cmake)
endif()
message(STATUS "EMBED_RESOURCE_FILES=${EMBED_RESOURCE_FILES}")
+6 -5
View File
@@ -55,7 +55,7 @@ a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <kristianevers@gmail.com>. All
reported by contacting the project team at [kristianevers@gmail.com](mailto:kristianevers@gmail.com). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
@@ -68,9 +68,10 @@ members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
For answers to common questions about this code of conduct, see
<https://www.contributor-covenant.org/faq>
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
+26 -26
View File
@@ -1,11 +1,11 @@
# How to contribute to PROJ
# How to contribute to PROJ.4
PROJ has a wide and varied user base. Some are highly skilled geodesists with a deep
PROJ.4 has a wide and varied user base. Some are highly skilled geodesists with a deep
knowledge of map projections and reference systems, some are GIS software developers
and others are GIS users. All users, regardless of the profession or skill level,
have the ability to contribute to PROJ. Here are a few suggestions on how:
has the ability to contribute to PROJ.4. Here's a few suggestion on how:
* Help PROJ-users that is less experienced than yourself.
* Help PROJ.4-users that is less experienced than yourself.
* Write a bug report
* Request a new feature
* Write documentation for your favorite map projection
@@ -13,17 +13,16 @@ have the ability to contribute to PROJ. Here are a few suggestions on how:
* Implement a new feature
In the following sections you can find some guidelines on how to contribute.
As PROJ is managed on GitHub most contributions require that you have a GitHub
As PROJ.4 is managed on GitHub most contributions require that you have a GitHub
account. Familiarity with [issues](https://guides.github.com/features/issues/) and
the [GitHub Flow](https://guides.github.com/introduction/flow/) is an advantage.
## Help a fellow PROJ user
The main forum for support for PROJ is the mailing list. You can subscribe to
## Help a fellow PROJ.4 user
The main forum for support for PROJ.4 is the mailing list. You can subscribe to
the mailing list [here](http://lists.osgeo.org/mailman/listinfo/proj) and read
the archive [here](http://lists.osgeo.org/pipermail/proj/).
If you have questions about the usage of PROJ the mailing list is also the place to go.
If you have questions about the usage of PROJ.4 the mailing list is also the place to go.
Please *do not* use the GitHub issue tracker as a support forum. Your question is much
more likely to be answered on the mailing list, as many more people follow that than
the issue tracker.
@@ -31,7 +30,7 @@ the issue tracker.
## Adding bug reports
Bug reports are handled in the [issue tracker](https://github.com/OSGeo/PROJ/issues)
on PROJ's home on GitHub. Writing a good bug report is not easy. But fixing a poorly
on PROJ.4's home on GitHub. Writing a good bug report is not easy. But fixing a poorly
documented bug is not easy either, so please put in the effort it takes to create a
thorough bug report.
@@ -39,7 +38,7 @@ A good bug report includes at least:
* A title that quickly explains the problem
* A description of the problem and how it can be reproduced
* Version of PROJ being used
* Version of PROJ.4 being used
* Version numbers of any other relevant software being used, e.g. operating system
* A description of what already has been done to solve the problem
@@ -48,15 +47,15 @@ will find interest in solving the problem. You will probably get follow-up quest
after submitting a bug report. Please answer them in a timely manner if you have an
interest in getting the issue solved.
Finally, please only submit bug reports that are actually related to PROJ. If the
issue materializes in software that uses PROJ it is likely a problem with that
particular software. Make sure that it actually is a PROJ problem before you submit
an issue. If you can reproduce the problem only by using tools from PROJ it is
definitely a problem with PROJ.
Finally, please only submit bug reports that are actually related to PROJ.4. If the
issue materializes in software that uses PROJ.4 it is likely a problem with that
particular software. Make sure that it actually is a PROJ.4 problem before you submit
an issue. If you can reproduce the problem only by using tools from PROJ.4 it is
definitely a problem with PROJ.4.
## Feature requests
Got an idea for a new feature in PROJ? Submit a thorough description of the new
Got an idea for a new feature in PROJ.4? Submit a thorough description of the new
feature in the [issue tracker](https://github.com/OSGeo/PROJ/issues). Please
include any technical documents that can help the developer make the new feature a
reality. An example of this could be a publicly available academic paper that
@@ -68,23 +67,23 @@ Note that not all feature requests are accepted.
## Write documentation
PROJ is in dire need of better documentation. Any contributions of documentation
are greatly appreciated. The PROJ documentation is available on [proj.org](https://proj.org).
PROJ.4 is in dire need of better documentation. Any contributions of documentation
are greatly appreciated. The PROJ.4 documentation is available on [proj.org](https://proj.org).
The website is generated with [Sphinx](http://www.sphinx-doc.org/en/stable/). Contributions
to the documentation should be made as [Pull Requests](https://github.com/OSGeo/PROJ/pulls)
on GitHub.
If you intend to document one of PROJ's supported projections please use the
If you intend to document one of PROJ.4's supported projections please use the
[Mercator projection](https://proj.org/operations/projections/merc.html) as a template.
## Code contributions
See [Code Contributions](https://proj.org/community/code_contributions.html)
### Legalese
#### Legalese
Committers are the front line gatekeepers to keep the code base clear of improperly contributed code.
It is important to the PROJ users, developers and the OSGeo foundation to avoid contributing any
It is important to the PROJ.4 users, developers and the OSGeo foundation to avoid contributing any
code to the project without it being clearly licensed under the project license.
Generally speaking the key issues are that those providing code to be included in the repository
@@ -123,6 +122,7 @@ improperly contributing code to the source repository:
* If there is uncertainty about whether a change is proper to contribute to the code base, please
seek more information from the project steering committee, or the foundation legal counsel.
## Additional Resources
* [General GitHub documentation](https://help.github.com/)
@@ -130,6 +130,6 @@ improperly contributing code to the source repository:
## Acknowledgements
The [code contribution](#Code Contributions) section of this CONTRIBUTING file is inspired by
[PDAL's](https://github.com/PDAL/PDAL/blob/master/CONTRIBUTING.md) and the [legalese](#legalese)
section is modified from [GDAL committer guidelines](https://trac.osgeo.org/gdal/wiki/rfc3_commiters)
The _code contribution_ section of this CONTRIBUTING file is inspired by
[PDAL's](https://github.com/PDAL/PDAL/blob/master/CONTRIBUTING.md) and the _legalese_ section is
modified from [GDAL committer guidelines](https://trac.osgeo.org/gdal/wiki/rfc3_commiters)
+9 -9
View File
@@ -1,20 +1,19 @@
All source, data files and other contents of the PROJ package are
All source, data files and other contents of the PROJ.4 package are
available under the following terms. Note that the PROJ 4.3 and earlier
was "public domain" as is common with US government work, but apparently
this is not a well defined legal term in many countries. Frank Warmerdam placed
everything under the following MIT style license because he believed it is
this is not a well defined legal term in many countries. I am placing
everything under the following MIT style license because I believe it is
effectively the same as public domain, allowing anyone to use the code as
they wish, including making proprietary derivatives.
they wish, including making proprietary derivatives.
Initial PROJ 4.3 public domain code was put as Frank Warmerdam as copyright
holder, but he didn't mean to imply he did the work. Essentially all work was
done by Gerald Evenden.
Copyright information can be found in source files.
Though I have put my own name as copyright holder, I don't mean to imply
I did the work. Essentially all work was done by Gerald Evenden.
--------------
Copyright (c) 2000, Frank Warmerdam
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
@@ -32,3 +31,4 @@ Copyright information can be found in source files.
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
+7 -7
View File
@@ -40,7 +40,7 @@
2015-07-27 Even Rouault <even.rouault@spatialys.com>
* : Remove setlocale() use in pj_init_ctx(), and replace uses of atof() &
strtod() by their locale safe variants pj_atof() and pj_strtod().
Proj versions from now advertise #define PJ_LOCALE_SAFE 1 in proj_api.h
Proj versions from now advertize #define PJ_LOCALE_SAFE 1 in proj_api.h
and export pj_atof() & pj_strtod() (#226)
2015-06-01 Charles Karney <https://github.com/cffk>
@@ -601,7 +601,7 @@
2010-03-16 Frank Warmerdam <warmerdam@pobox.com>
* src/pj_transform.c, src/pj_init.c, src/projects.h, src/pj_gridlist.c,
src/pj_apply_gridshift.c: rework the translation of nadgrids parameters
src/pj_apply_gridshit.c: rework the translation of nadgrids parameters
into a list of gridshift files to avoid use of static "lastnadgrids"
information which screws up multithreading. Changes the PJ structure.
@@ -1491,7 +1491,7 @@ Rel. 4.4.4 2001/09/15
2001-05-14 Frank Warmerdam <warmerdam@pobox.com>
* upgraded config.sub and config.guess as per debian bug report 97374.
* upraded config.sub and config.guess as per debian bug report 97374.
Rel. 4.4.3 2001/04/20
-------------------------------------------------------------------------
@@ -1714,7 +1714,7 @@ Rel. 4.3.1 94/2/16 Base-line
-------------------------------------------------------------------------
94/6/2
Transverse Mercator, spherical inverse fixed. Misplaced parenthesis.
Transverse Mercator, spherical inverse fixed. Misplaced parenthsis.
94/10/5
Dropped dependency on FILENAME_MAX---too poorly defined in both
@@ -1756,14 +1756,14 @@ Rel. 4.3 94/2/16 Base-line
Added SPECIAL entry to conics Lambert, Albers and Equidistant.
Corrected nad/install.in test so as to only look for conus.lla.Z
as test for installation of NADCON datum matrices.
as test for installation of NADCON datum matricies.
94/3/19
Problems with MAPGEN's mapdef choking on call to proj. Fixed
with PROJ.4.3-patch-01.
94/3/22
Bump mode of handling memory allocation for 2D arrays, so that
Bumb mode of handling memory allocation for 2D arrays, so that
execution of -L may not work on some systems. Interim corrections
distributed with PROJ.4.3-patch-02.
@@ -1937,7 +1937,7 @@ Rel. 4.1.1 93/3/26 Base-line
pj_strerrno prototype added to projects.h
DOS option in strtod.c for MS C's lack of standard macros in headers.
DOS option in strtod.c for MS C's lack of standard macros in neaders.
Rel. 4.1 93/3/8 Base-line --- @(#)CHANGE-LOG 4.14 95/09/23 GIE REL
-------------------------------------------------------------------------
+29 -25
View File
@@ -1,47 +1,51 @@
##
# OSGeo/PROJ
FROM ubuntu:24.04 AS builder
FROM ubuntu:18.04 as builder
LABEL maintainer="Howard Butler <howard@hobu.co>"
MAINTAINER Howard Butler <howard@hobu.co>
ARG DESTDIR="/build"
ARG PROJ_GITHUB_SHA
# Setup build env
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing --no-install-recommends \
software-properties-common build-essential ca-certificates \
cmake wget unzip \
zlib1g-dev libsqlite3-dev sqlite3 libcurl4-gnutls-dev \
libtiff-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update -y \
&& apt-get install -y --fix-missing --no-install-recommends \
software-properties-common build-essential ca-certificates \
make cmake wget unzip libtool automake \
zlib1g-dev libsqlite3-dev pkg-config sqlite3
COPY . /PROJ
RUN cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -S /PROJ -B _build
RUN cmake --build _build -j $(nproc)
RUN cmake --install _build
RUN rm -rfv _build
RUN cd /PROJ \
&& ./autogen.sh \
&& ./configure --prefix=/usr \
&& make -j$(nproc) \
&& make install
FROM ubuntu:24.04 AS runner
FROM ubuntu:18.04 as runner
RUN date
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libsqlite3-0 libtiff6 libcurl4 libcurl3-gnutls \
wget ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libsqlite3-0 \
curl unzip
# Put this first as this is rarely changing
WORKDIR /usr/share/proj
RUN wget --no-verbose --mirror https://cdn.proj.org/ || true
RUN cd cdn.proj.org && rm -fv *.js *.css *.html favicon* && mv * .. && cd .. && rmdir cdn.proj.org
WORKDIR /
RUN \
mkdir -p /usr/share/proj; \
curl -LOs https://download.osgeo.org/proj/proj-datumgrid-1.8.zip && unzip -j -u -o proj-datumgrid-1.8.zip -d /usr/share/proj; \
curl -LOs https://download.osgeo.org/proj/proj-datumgrid-europe-1.5.zip && unzip -j -u -o proj-datumgrid-europe-1.5.zip -d /usr/share/proj; \
curl -LOs https://download.osgeo.org/proj/proj-datumgrid-oceania-1.1.zip && unzip -j -u -o proj-datumgrid-oceania-1.1.zip -d /usr/share/proj; \
curl -LOs https://download.osgeo.org/proj/proj-datumgrid-world-1.0.zip && unzip -j -u -o proj-datumgrid-world-1.0.zip -d /usr/share/proj; \
curl -LOs https://download.osgeo.org/proj/proj-datumgrid-north-america-1.3.zip && unzip -j -u -o proj-datumgrid-north-america-1.3.zip -d /usr/share/proj; \
rm *.zip
COPY --from=builder /build/usr/share/proj/ /usr/share/proj/
COPY --from=builder /build/usr/include/ /usr/include/
COPY --from=builder /build/usr/bin/ /usr/bin/
COPY --from=builder /build/usr/lib/ /usr/lib/
+84 -6
View File
@@ -230,6 +230,12 @@ TAB_SIZE = 4
ALIASES =
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
@@ -766,7 +772,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = src/iso19111 src/iso19111/operation include/proj src/proj.h src/proj_experimental.h src/general_doc.dox src/filemanager.cpp src/networkfilemanager.cpp src/coordinates.cpp src/trans_bounds.cpp
INPUT = src/iso19111 include/proj src/proj.h src/proj_experimental.h src/general_doc.dox
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -1033,6 +1039,13 @@ VERBATIM_HEADERS = YES
ALPHABETICAL_INDEX = YES
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
@@ -1161,6 +1174,15 @@ HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to YES can help to show when doxygen was last run and thus if the
# documentation is up to date.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_TIMESTAMP = NO
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
@@ -1431,6 +1453,17 @@ EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
@@ -1709,6 +1742,16 @@ LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
# code with syntax highlighting in the LaTeX output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
@@ -1843,7 +1886,7 @@ MAN_LINKS = NO
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = YES
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
@@ -2008,10 +2051,7 @@ PREDEFINED = DOXYGEN_ENABLED \
protected=private \
INLINED_MAKE_SHARED= \
PROJ_OPAQUE_PRIVATE_DATA= \
PROJ_PRIVATE=private \
PROJ_PURE_DECL= \
noexceptoverride="noexcept override" \
PROJ_NO_RETURN=
PROJ_PRIVATE=private
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@@ -2089,6 +2129,15 @@ EXTERNAL_PAGES = YES
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see:
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
@@ -2131,6 +2180,23 @@ HAVE_DOT = YES
DOT_NUM_THREADS = 0
# When you want a differently looking font in the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
# setting DOT_FONTPATH to the directory containing the font.
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
# Minimum value: 4, maximum value: 24, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
# the path where dot can find it using this tag.
@@ -2340,6 +2406,18 @@ DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not seem
# to support this out of the box.
#
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+248
View File
@@ -0,0 +1,248 @@
Preparing a PROJ Release
===============================================================================
Preparing a PROJ release is a three-step process. Before the actual release is
published we want to issue one or more release candidates to ensure that the
code is in fact ready to be released. That is step one. Step two starts when a
release candidate has been selected for promotion to final release. Step three
updates version numbers in the master branch to avoid confusion between
released code and code still in development.
The three phases are described below.
1 Release candidate
===============================================================================
At least one release candidate is necessary before the final release is
published. In case more than one release candidate is needed most steps below
can be skipped depending on what prompted the release candidate 1+n. Steps 1.6
and 1.7 are mandatory for all release candidates, otherwise it will in most
cases only be necessary to update the NEWS section (1.3).
Release candidates should be released about a week before the final release is
scheduled. When preparing major version releases it may be wise to issue the
release candidate earlier than that.
When a release candidate has not prompted any request for changes in 48 hours,
a motion for promotion to final release should be issued on the PROJ mailing
list. The PROJ PSC guidelines describes the rules for passing a motion.
1.1 Update ABI version numbers:
-------------------------------------------------------------------------------
Determine the ABI version number. It consists of "current:revision:age". Follow
the steps below to determine the next ABI version number:
- If the library source code has changed at all since the last update,
then increment revision (c:r:a becomes c:r+1:a).
- If any interfaces have been added, removed, or changed since the last
update, increment current, and set revision to 0.
- If any interfaces have been added since the last public release, then
increment age.
- If any interfaces have been removed since the last public release, then
set age to 0.
Update the following files with the new ABI version number:
- `src/Makefile.am` Update -version-info
- `CMakelists.txt`: Update PROJ_BUILD_VERSION (cur:rev:age) and
PROJ_API_VERSION (current)
*Commit the changes to master.*
1.2 Update man pages
-------------------------------------------------------------------------------
Man pages are (mostly) automatically generated from the Sphinx docs. The pages
in man/man3/ was manually updated in 1.1. Here we update the pages in
man/man1/. Follow these steps:
- Update version number and date in `man/man3/pj_init.3` and
`man/man3/geodesic.3`
- Temporarily update version in `docs/source/conf.py`
- run `script/update_man.sh`
- Revert version number in `docs/source/conf.py`
The `update_man.sh` script builds the man pages and commits the update man pages
to master.
1.3 Write release notes
-------------------------------------------------------------------------------
Update `NEWS` with descriptions of the changes since the last release.
Hopefully issues and pull requests that go into the new release have been
properly tagged with the milestone for the current release.
End the section by thanking the authors that contributed to the release. Get a
sorted list of contributors in descending order of activity:
```
git shortlog -sn x.y.z..HEAD | tac | awk '{$1=""; print $0}'
```
where `x.y.z` is the tag of the previous release. You may need to edit the list
slightly since not all authors has properly configured their names in git.
*Commit the changes to master.*
1.4 Update `CITATION`
-------------------------------------------------------------------------------
If needed, update the year in `CITATION`.
*Commit the changes to master.*
1.5 Create maintenance branch
-------------------------------------------------------------------------------
*Skip this step if you are preparing a patch release or RC2 and later.*
Create the branch:
```
git branch x.y
```
where `x` is the major version number and `y` is the minor version number. Bug
fixes found in the release candidates should be pushed to master and
subsequently cherry-picked to the maintenance branch.
*Push branch upstream.*
1.6 Prepare and upload archives
-------------------------------------------------------------------------------
Run autoconf and configure the build:
```
./autogen.sh
mkdir build
cd build
../configure
make dist
```
Rename the archives and generate MD5 sum files:
```
mv proj-x.y.z.tar.gz proj-x.y.zRCn.tar.gz
mv proj-x.y.z.zip proj-x.y.zRCn.zip
md5 proj-x.y.zRCn.tar.gz > proj-x.y.zRCn.tar.gz.md5
md5 proj-x.y.zRCn.zip > proj-x.y.zRCn.zip.md5
```
Upload to the OSGeo download server:
```
scp proj-x.y.zRCn.* warmerdam@download.osgeo.org:/osgeo/download/proj
```
Adjust version numbers and usernames accordingly.
1.7 Announce the release candidate
-------------------------------------------------------------------------------
Announce the release candidate on the PROJ mailing list.
1.8 Promotion to final release
-------------------------------------------------------------------------------
When you are confident that the latest release candidate is ready for promotion
to final release a motion for promotion should be issued on the PROJ mailing
list. Allow for a minimum of 48 hours for voting time.
2 Final release
===============================================================================
Barring a successful promotion process we can proceed with the final release.
2.1 Prepare and upload archives
-------------------------------------------------------------------------------
See step 1.6 above. Do not rename the archives with RC postfixes.
2.2 Update website
------------------------------------------------------------------------------
- Add the release notes from `NEWS` to `docs/source/news.rst`
- Update download links in `docs/source/download.rst`
- Update `$TRAVIS_BRANCH` in `travis\after_success.sh` to new maintenance
branch.
*Commit the changes to master and cherry-pick into maintenance branch.*
When pushed upstream the website will be update to the current version.
2.3 Tag the release
-------------------------------------------------------------------------------
Tag the release with:
```
git tag -a -m "Create tag x.y.z" x.y.z
git push --tags
```
2.4 Prepare the release on GitHub
-------------------------------------------------------------------------------
When the new tag is pushed upstream GitHub picks up that a new release has been
issued. Update the new release on https://github.com/OSGeo/PROJ/releases with
the release notes from `NEWS` and add the prepared source distribution archives
to the release (otherwise GitHub will just package the entire repository - we
don't want that).
2.5 Announce the new release
-------------------------------------------------------------------------------
The release should be announced on PROJ and MetaCRS mailing lists. Additionally
the release announcement should be sent to news_item@osgeo.org which will add
the announcement to osgeo.org and other OSGeo communication channels.
Make some noise on Twitter and other relevant social media.
3 Post final release
===============================================================================
3.1 Update version numbers
-------------------------------------------------------------------------------
PROJ uses [semantic versioning](http://semver.org/). Depending on the changes
in the release will be either a major, minor or patch release. Update the
version numbers in the files.
- configure.ac: Update the version number in AC_INIT().
- src/proj.h: Update PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR and
PROJ_VERSION_PATCH.
- src/proj_api.h: Update PJ_VERSION.
- src/pj_release.c: Update date to the scheduled release date.
- CMakelists.txt: Update proj_version()
- doc/source/conf.py: Update version number
*Commit changes. Either to master or maintenance branch depending on the nature
of the release.*
3.2 Disable website deployment when releasing a new non-bugfix version
-------------------------------------------------------------------------------
If the previous active version was, let's say, 6.1 and the new version is, let's say, 6.2,
then checkout 6.1 branch, and in travis/after_success.sh, remove the code
that causes commits to 6.1 to cause a website refresh, that is remove the
code under `if test "$TRAVIS_SECURE_ENV_VARS" = "true" -a "$TRAVIS_BRANCH" = "6.1"; then`.
Also edit docs/source/conf.py to change the active branch for documentation
in the `github_version` variable.
-229
View File
@@ -1,229 +0,0 @@
# Preparing a PROJ Release
Preparing a PROJ release is a three-step process. Before the actual release is
published we want to issue one or more release candidates to ensure that the
code is in fact ready to be released. That is step one. Step two starts when a
release candidate has been selected for promotion to final release. Step three
updates version numbers in the master branch to avoid confusion between
released code and code still in development.
The three phases are described below.
## 1 Release candidate
At least one release candidate is necessary before the final release is
published. In case more than one release candidate is needed most steps below
can be skipped depending on what prompted the release candidate 1+n. Steps 1.6
and 1.7 are mandatory for all release candidates, otherwise it will in most
cases only be necessary to update the NEWS section (1.3).
Release candidates should be released about a week before the final release is
scheduled. When preparing major version releases it may be wise to issue the
release candidate earlier than that.
When a release candidate has not prompted any request for changes in 48 hours,
a motion for promotion to final release should be issued on the PROJ mailing
list. The PROJ PSC guidelines describes the rules for passing a motion.
### 1.1 Update ABI version numbers
In case of a un-planned maintenance release, make sure that version numbers are
properly updated: see 3.1
For each release version, increment PROJ_SOVERSION in CMakeLists.txt if the
ABI is not backwards compatible, i.e. any interfaces have been removed, or
changed since the last release. See also:
<https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B>
*Commit the changes to master.*
### 1.2 Update man pages
Man pages are (mostly) automatically generated from the Sphinx docs. Follow
these steps:
- Temporarily update `version` and `data_version` in `docs/source/conf.py`
- run `scripts/update_man.sh`
- Revert version number in `docs/source/conf.py`
The `update_man.sh` script builds the man pages and commits the update man pages
to master.
### 1.3 Write release notes
Update `NEWS.md` with descriptions of the changes since the last release.
Hopefully issues and pull requests that go into the new release have been
properly tagged with the milestone for the current release.
`scripts/releasenotes.py` can be used to create a first draft of the release
notes.
*Commit the changes to master.*
### 1.4 Update `CITATION.cff` and `CITATION`
Update the "version" and "date-released" fields in `CITATION.cff`. The
"doi" does not need to be updated.
If needed, update the two instances of year in `CITATION`.
*Commit the changes to master.*
### 1.5 Update `PROJ_DATA.VERSION`
If the database references data from an updated PROJ-data package, update
`PROJ_DATA.VERSION` in `data/sql/metadata.sql`.
*Commit the changes to master.*
### 1.6 Create maintenance branch
*Skip this step if you are preparing a patch release or RC2 and later.*
Create the branch:
```sh
git branch x.y
```
where `x` is the major version number and `y` is the minor version number. Bug
fixes found in the release candidates should be pushed to master and
subsequently cherry-picked to the maintenance branch.
*Push branch upstream.*
### 1.7 Prepare and upload archives
Checkout the GitHub repo to an isolated local directory to package files only
tracked in git. Then, run CMake and build source distributions:
```sh
BRANCH_NAME=master
git clone --depth 1 --branch $BRANCH_NAME \
https://github.com/OSGeo/PROJ.git PROJ-$BRANCH_NAME
cd PROJ-$BRANCH_NAME
mkdir _build && cd _build
cmake -D BUILD_TESTING=OFF ..
cmake --build . --target dist
```
Rename the archives and generate MD5 sum files:
```sh
mv proj-x.y.z.tar.gz proj-x.y.zRCn.tar.gz
mv proj-x.y.z.zip proj-x.y.zRCn.zip
md5 proj-x.y.zRCn.tar.gz > proj-x.y.zRCn.tar.gz.md5
md5 proj-x.y.zRCn.zip > proj-x.y.zRCn.zip.md5
```
Upload to the OSGeo download server:
```sh
scp proj-x.y.zRCn.* warmerdam@upload.osgeo.org:/osgeo/download/proj
```
Adjust version numbers and usernames accordingly.
### 1.8 Announce the release candidate
Announce the release candidate on the PROJ mailing list.
### 1.9 Promotion to final release
When you are confident that the latest release candidate is ready for promotion
to final release a motion for promotion should be issued on the PROJ mailing
list. Allow for a minimum of 48 hours for voting time.
## 2 Final release
Barring a successful promotion process we can proceed with the final release.
### 2.1 Prepare and upload archives
See step 1.6 above. Do not rename the archives with RC postfixes.
### 2.2 Update the STABLE_BRANCH repository variable
Go to https://github.com/OSGeo/PROJ/settings/variables/actions/STABLE_BRANCH
and update the value to be x.y
### 2.3 Update website
- Add the release notes from `NEWS.md` to `docs/source/news.rst`
These vim substitutions are helpful when converting NEWS.md to rst:
```sh
:s!(\#\(\d\{4}\))!(`\#\1 <https://github.com/OSGeo/PROJ/issues/\1>`_)!
```
- Update download links in `docs/source/download.rst`
*Commit the changes to master and cherry-pick into maintenance branch.*
When pushed upstream the website will be update to the current version.
### 2.4 Tag the release
Tag the release with:
```sh
git tag -a -m "Create tag x.y.z" x.y.z
git push --tags
```
### 2.5 Check the GitHub Zeonodo integration
Go to https://zenodo.org/account/settings/github/ and check that the OSGeo/PROJ
repository is ON so that the creation of the GitHub release triggers the
creation of a corresponding Zenodo record.
### 2.6 Prepare the release on GitHub
When the new tag is pushed upstream GitHub picks up that a new release has been
issued. Update the new release on <https://github.com/OSGeo/PROJ/releases> with
the release notes from `NEWS.md` and add the prepared source distribution archives
to the release (otherwise GitHub will just package the entire repository - we
don't want that).
### 2.7 Announce the new release
The release should be announced on PROJ and MetaCRS mailing lists. Additionally
the release announcement should be sent to <news_item@osgeo.org> which will add
the announcement to osgeo.org and other OSGeo communication channels.
Make some noise on relevant social media.
## 3 Post final release
### 3.1 Update version numbers
PROJ uses [semantic versioning](http://semver.org/). Depending on the changes
in the release will be either a major, minor or patch release. Update the
version numbers in the files.
- src/proj.h: Update PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR and
PROJ_VERSION_PATCH.
- src/release.cpp: Update date to the scheduled release date.
- CMakeLists.txt: Update proj_version()
- docs/source/conf.py: Update version number
*Commit changes. Either to master or maintenance branch depending on the nature
of the release.*
### 3.2 Documentation
Edit the Sphinx configuration docs/source/conf.py with these changes:
- Set "version" to the major project version, e.g. "9.2"
- Set "release" to the full project version, e.g. "9.2.1"
- Set "data_version" to the PROJ-data version
- Set "today_date = date(Y, M, D)" using the release date
- set "github_version" to the maintenance branch label, e.g. "9.2"
HTML and PDF documentation is built using ReadTheDocs, which supports multiple
versions. Versions are based on branch labels, e.g. "9.2". To modify settings,
registered users must first log in. To add a version, go to
<https://readthedocs.org/projects/osgeo-proj/versions/> and click "Activate"
next to the maintenance branch label.
+175 -9
View File
@@ -1,16 +1,182 @@
Basic Installation
==================
These are generic installation instructions. See details online at
https://proj.org/install.html
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
PROJ can be built using a modern C/C++ compiler with CMake. From the source
directory, use the following commands to configure, build and install PROJ:
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
mkdir build
cd build
cmake ..
cmake --build .
cmake --build . --target install
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c99 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
+20
View File
@@ -0,0 +1,20 @@
SUBDIRS = include src man data jniwrap cmake
DIST_SUBDIRS = include src man data jniwrap cmake test
EXTRA_DIST = CMakeLists.txt CITATION README.md
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = proj.pc
AUTOMAKE_OPTIONS = dist-zip
ACLOCAL_AMFLAGS = -I m4
check-local:
cd test; $(MAKE) check
README: README.md
fgrep -v "[![" $< > $@
clean-local:
$(RM) README
+1379
View File
File diff suppressed because it is too large Load Diff
-3464
View File
File diff suppressed because it is too large Load Diff
+91 -28
View File
@@ -1,12 +1,11 @@
# PROJ
[![Travis Status](https://travis-ci.com/OSGeo/PROJ.svg?branch=master)](https://travis-ci.com/OSGeo/PROJ)
[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/OSGeo/PROJ?branch=master&svg=true)](https://ci.appveyor.com/project/OSGeo/PROJ?branch=master)
[![Coveralls Status](https://coveralls.io/repos/github/OSGeo/PROJ/badge.svg?branch=master)](https://coveralls.io/github/OSGeo/PROJ?branch=master)
[![CodeQL](https://github.com/OSGeo/PROJ/actions/workflows/codeql.yml/badge.svg)](https://github.com/OSGeo/PROJ/actions/workflows/codeql.yml)
[![Gitter](https://badges.gitter.im/OSGeo/proj.4.svg)](https://gitter.im/OSGeo/proj.4)
[![Mailing List](https://img.shields.io/badge/PROJ-mailing%20list-4eb899.svg)](http://lists.osgeo.org/mailman/listinfo/proj)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
[![Release](https://img.shields.io/github/v/release/OSGeo/PROJ)](https://github.com/OSGeo/PROJ/releases)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5884394.svg)](https://doi.org/10.5281/zenodo.5884394)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](code-of-conduct.md)
PROJ is a generic coordinate transformation software, that transforms
coordinates from one coordinate reference system (CRS) to another.
@@ -14,34 +13,99 @@ This includes cartographic projections as well as geodetic transformations.
For more information on the PROJ project please see the web page at:
<https://proj.org/>
https://proj.org/
The PROJ mailing list can be found at:
<https://lists.osgeo.org/mailman/listinfo/proj/>
https://lists.osgeo.org/mailman/listinfo/proj/
See the NEWS.md file for changes between versions.
See the NEWS file for changes between versions.
The following command line utilities are included in the PROJ package:
- `proj`: for cartographic projection of geodetic coordinates.
- `proj`: for cartographic projection of geodetic coordinates
- `cs2cs`: for transformation from one CRS to another CRS.
- `geod`: for geodesic (great circle) computations.
- `cct`: for generic Coordinate Conversions and Transformations.
- `gie`: the Geospatial Integrity Investigation Environment.
- `projinfo`: for geodetic object and coordinate operation queries.
- `projsync`: for synchronizing PROJ datum and transformation support data.
- `projinfo`: for geodetic object and coordinate operation queries
> More information on the utilities can be found on the [PROJ website](https://proj.org/apps).
## Installation
### Build dependencies
Consult the [Installation](https://proj.org/install.html) page of the official
documentation.
For builds on the master branch, [install.rst](https://github.com/OSGeo/PROJ/blob/master/docs/source/install.rst)
might be more up-to-date.
PROJ requires C and C++11 compilers.
It also requires SQLite3 (headers, library and executable). The minimum
version of SQLite3 required is 3.11
## Distribution files and format
### Building with CMake
cd proj
mkdir build
cd build
cmake ..
cmake --build .
On Windows, one may need to specify generator:
cmake -G "Visual Studio 15 2017" ..
If the SQLite3 dependency is installed in a custom location, specify the
paths to the include directory and the library:
cmake -DSQLITE3_INCLUDE_DIR=/opt/SQLite/include -DSQLITE3_LIBRARY=/opt/SQLite/lib/libsqlite3.so ..
Tests are run with
ctest
The test suite requires that the proj-datumgrid package is installed
in `PROJ_LIB`.
### Building on Unix/Linux
FSF's configuration procedure is used to ease installation of the
PROJ system.
The default destination path prefix for installed files is `/usr/local`.
Results from the installation script will be placed into subdirectories
`bin`, `include`, `lib`, `man/man1` and `man/man3`.
If this default path prefix is proper, then execute:
./configure
See the note below if you are building PROJ directly from the git repository.
If another path prefix is required, then execute:
./configure --prefix=/my/path
In either case, the directory of the prefix path must exist and be
writable by the installer.
After executing configure, execute:
make
make install
The install target will create, if necessary, all required sub-directories.
Tests are run with
make check
The test suite requires that the proj-datumgrid package is installed
in `PROJ_LIB`.
#### Building from the git repository
If you are building from the git repository you have to first run
./autogen.sh
which will generate a configure script that can be used as described above.
### Distribution files and format
Sources are distributed in one or more files. The principle elements
of the system are stored in a compressed tar file named `proj-x.y.z.tar.gz` where
@@ -50,14 +114,20 @@ number, and "z" indicates the patch number of the release.
In addition to the PROJ software package, distributions of datum
conversion grid files and PROJ parameter files are also available.
The grid package is distributed under the name `proj-data-x.y.zip`,
The grid package is distributed under the name `proj-datumgrid-x.y.zip`,
where "x" is the major release version and "y" is the minor release
version numbers. The resource packages can be downloaded from the
[PROJ website](https://proj.org/download.html).
version numbers. Similarly regional packages are distributed. The
regional packages contain resources that are not essential to the
functionality of PROJ but still of value to users in the region
specific to the package. All grids that were in proj-datumgrids-1.6
remain in proj-datumgrids-1.7; the regional datumgrid files contain
grids for datums not previously supported (prior to PROJ 5.0.0).
More info on the contents of the proj-data package can be
The resource packages can be downloaded from the [PROJ website](https://proj.org/download.html).
More info on the contents of the various resource packages can be
found at the
[PROJ-data GitHub repository](https://github.com/OSGeo/PROJ-data).
[proj-datumgrid GitHub repository](https://github.com/OSGeo/proj-datumgrid).
The resource file packages should be extracted to `PROJ_LIB`
where PROJ will find them after installation. The default location of
@@ -65,13 +135,6 @@ where PROJ will find them after installation. The default location of
be changed to a different directory. On Windows you have to define
`PROJ_LIB` yourself.
As an alternative to installing the data package on the local system,
the resource files can be retrieved on-the-fly from the
[PROJ CDN](https://cdn.proj.org/).
A [network-enabled](https://proj.org/usage/network.html) PROJ build, will
automatically fetch resource files that are not present locally from the CDN.
## Citing PROJ in publications
### Citing PROJ in publications
See [CITATION](CITATION)
+62
View File
@@ -0,0 +1,62 @@
platform:
- x64
- x86
branches:
except:
- /(cherry-pick-)?backport-\d+-to-/
environment:
matrix:
# VS 2015
- VS_VERSION: Visual Studio 14
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# VS 2017
- VS_VERSION: Visual Studio 15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
shallow_clone: true
build_script:
- echo build_script
- git clone https://github.com/microsoft/vcpkg
- cd vcpkg
- bootstrap-vcpkg.bat
- set PATH=%CD%;%PATH%
- cd ..
- vcpkg install sqlite3:"%platform%"-windows
- set SQLITE3_BIN=%APPVEYOR_BUILD_FOLDER%\sqlite3\bin
- mkdir %SQLITE3_BIN%
- copy c:\projects\proj\vcpkg\installed\"%platform%"-windows\bin\sqlite3.dll %SQLITE3_BIN%
- ps: |
appveyor DownloadFile https://sqlite.org/2018/sqlite-tools-win32-x86-3250100.zip
7z x sqlite-tools-win32-x86-3250100.zip
- copy "%APPVEYOR_BUILD_FOLDER%"\sqlite-tools-win32-x86-3250100\sqlite3.exe %SQLITE3_BIN%
- set PATH=%SQLITE3_BIN%;%PATH%
- if "%platform%" == "x64" SET VS_FULL=%VS_VERSION% Win64
- if "%platform%" == "x64" SET BUILD_LIBPROJ_SHARED=ON
- if "%platform%" == "x86" SET VS_FULL=%VS_VERSION%
- if "%platform%" == "x86" SET BUILD_LIBPROJ_SHARED=OFF
- echo "%VS_FULL%"
#
- set PROJ_BUILD=%APPVEYOR_BUILD_FOLDER%\build
- mkdir %PROJ_BUILD%
- cd %PROJ_BUILD%
- set PROJ_DIR=%APPVEYOR_BUILD_FOLDER%\proj_dir
- cmake -G "%VS_FULL%" .. -DCMAKE_BUILD_TYPE=Release -DBUILD_LIBPROJ_SHARED="%BUILD_LIBPROJ_SHARED%" -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE=C:/projects/proj/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX="%PROJ_DIR%"
- cmake --build . --config Release --target install
test_script:
- echo test_script
- set PROJ_LIB=%PROJ_DIR%\share\proj
- cd %PROJ_LIB%
- curl -O https://download.osgeo.org/proj/proj-datumgrid-1.8.zip
- 7z e -aoa -y proj-datumgrid-1.8.zip
- cd %PROJ_BUILD%
- ctest -V -C Release
- set PATH=%PROJ_DIR%\bin;%PATH%
- proj
deploy: off
Executable
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
#
# Autotools boostrapping script
#
giveup()
{
echo
echo " Something went wrong, giving up!"
echo
exit 1
}
OSTYPE=`uname -s`
for libtoolize in glibtoolize libtoolize; do
LIBTOOLIZE=`which $libtoolize 2>/dev/null`
if test "$LIBTOOLIZE"; then
break;
fi
done
#AMFLAGS="--add-missing --copy --force-missing"
AMFLAGS="--add-missing --copy"
if test "$OSTYPE" = "IRIX" -o "$OSTYPE" = "IRIX64"; then
AMFLAGS=$AMFLAGS" --include-deps";
fi
echo "Running aclocal"
aclocal -I ./m4 || giveup
echo "Running autoheader"
autoheader || giveup
echo "Running libtoolize"
$LIBTOOLIZE --force --copy || giveup
echo "Running automake"
automake $AMFLAGS # || giveup
echo "Running autoconf"
autoconf || giveup
echo "======================================"
echo "Now you are ready to run './configure'"
echo "======================================"
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
# All platform-specific before_install scripts starts by running this
# "global" before_install script.
# Configure Python pip
python3 -m pip config --user set global.progress_bar off
python3 -m pip install --user --upgrade pip
python3 -m pip install --user jsonschema pyyaml pytest
-34
View File
@@ -1,34 +0,0 @@
#!/bin/sh
set -e
CLANG_VERSION=20
apt-get update -y
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
autoconf automake libtool make cmake ccache pkg-config sqlite3 tar zip curl ca-certificates jq \
python3-pytest python3-ruamel.yaml python3-jsonschema \
python3-clang-$CLANG_VERSION clang-$CLANG_VERSION libclang-rt-$CLANG_VERSION-dev \
libsqlite3-dev libgtest-dev \
libtiff-dev libwebp-dev libzstd-dev \
libcurl4-openssl-dev libnghttp2-dev libidn2-dev librtmp-dev libssh-dev \
libpsl-dev libssl-dev libkrb5-dev comerr-dev libldap2-dev libbrotli-dev \
nlohmann-json3-dev libgtest-dev
cd "$WORK_DIR"
if test -f "$WORK_DIR/ccache.tar.gz"; then
echo "Restoring ccache..."
(cd $HOME && tar xzf "$WORK_DIR/ccache.tar.gz")
else
mkdir -p $HOME/.ccache
fi
ccache -M 500M
# -fno-use-cxa-atexit is needed to build with -coverage
CC="clang-$CLANG_VERSION" CXX="clang++-$CLANG_VERSION" CFLAGS="-fsanitize=address -fno-use-cxa-atexit" CXXFLAGS="-fsanitize=address -fno-use-cxa-atexit" LDFLAGS="-fsanitize=address" ./ci/install.sh
echo "Saving ccache..."
rm -f "$WORK_DIR/ccache.tar.gz"
(cd $HOME && tar czf "$WORK_DIR/ccache.tar.gz" .ccache)
-41
View File
@@ -1,41 +0,0 @@
#!/bin/bash
set -e
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends \
g++ cmake make sqlite3 libsqlite3-dev libtiff-dev libcurl4-openssl-dev jq \
clang-tools libfindbin-libs-perl
NPROC=$(nproc)
echo "NPROC=${NPROC}"
export MAKEFLAGS="-j ${NPROC}"
mkdir csa_build
cd csa_build
scan-build -o scanbuildoutput -plist -v cmake ..
scan-build -o scanbuildoutput -sarif -v -enable-checker alpha.unix.cstring.OutOfBounds,alpha.unix.cstring.BufferOverlap,optin.cplusplus.VirtualCall,optin.cplusplus.UninitializedObject make
rm -f filtered_scanbuild.txt
files=$(find scanbuildoutput -name "*.sarif")
for f in $files; do
jq '.runs[].results[] | (if .locations[].physicalLocation.fileLocation.uri | (index("_generated_parser") ) then empty else { "uri": .locations[].physicalLocation.fileLocation.uri, "msg": .message.text, "location": .codeFlows[-1].threadFlows[-1].locations[-1] } end)' < $f > tmp.txt
if [ -s tmp.txt ]; then
echo "Errors from $f: "
cat $f
echo ""
cat tmp.txt >> filtered_scanbuild.txt
fi
rm -f tmp.txt
done
if [ -s filtered_scanbuild.txt ]; then
echo ""
echo ""
echo "========================"
echo "Summary of errors found:"
cat filtered_scanbuild.txt
/bin/false
fi
-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
mkdir packages
CONDA_PLAT=""
if grep -q "windows" <<< "$GHA_CI_PLATFORM"; then
CONDA_PLAT="win"
ARCH="64"
fi
if grep -q "ubuntu" <<< "$GHA_CI_PLATFORM"; then
CONDA_PLAT="linux"
ARCH="64"
fi
if grep -q "macos-14" <<< "$GHA_CI_PLATFORM"; then
CONDA_PLAT="osx"
ARCH="arm64"
elif grep -q "macos-15-intel" <<< "$GHA_CI_PLATFORM"; then
CONDA_PLAT="osx"
ARCH="64"
fi
rattler-build build \
--recipe-dir recipe \
--output-dir packages \
--variant-config ".ci_support/${CONDA_PLAT}_${ARCH}_.yaml"
conda install -c ./packages proj
#projinfo -s NAD27 -t EPSG:4269 --area "USA - Missouri"
-14
View File
@@ -1,14 +0,0 @@
#!/bin/bash
conda update -n base -c defaults conda -y
conda install rattler-build ninja compilers yq -y
pwd
ls
git clone https://github.com/conda-forge/proj.4-feedstock.git
cd proj.4-feedstock
yq -y -i '.source = {"path": "../../../PROJ"} | .build.number = 2112' recipe/recipe.yaml
ls recipe
-25
View File
@@ -1,25 +0,0 @@
# Use the official Emscripten SDK image.
FROM emscripten/emsdk:4.0.5
# Set non-interactive frontend for package installations
ENV DEBIAN_FRONTEND="noninteractive"
# --- Install System Dependencies ---
RUN apt-get update && \
apt-get install -y \
sqlite3 \
ninja-build && \
# Clean up apt cache to reduce image size
rm -rf /var/lib/apt/lists/*
ENV BUILD_DIR="/build"
RUN mkdir -p ${BUILD_DIR}
RUN chmod ugo+rwx ${BUILD_DIR}
# Copy the build script into the container
COPY build_wasm.sh /scripts/build_wasm.sh
RUN chmod +x /scripts/build_wasm.sh
# Set the main command to execute the build script
WORKDIR /build
CMD ["/scripts/build_wasm.sh"]
-365
View File
@@ -1,365 +0,0 @@
#!/bin/bash
###############################################################################
# $Id$
#
# Project: PROJ
# Purpose: Build with emscripten compiler
# Author: Javier Jimenez Shaw
#
###############################################################################
# Copyright (c) 2025 Javier Jimenez Shaw
###############################################################################
# Exit immediately if a command exits with a non-zero status.
set -e
# --- Configuration Variables ---
# Use environment variables from Dockerfile or runtime.
PROJ_REPO=${PROJ_REPO:-https://github.com/OSGeo/PROJ.git}
INSTALL_DIR=${INSTALL_DIR:-/build/install}
BUILD_DIR=${BUILD_DIR:-/build}
PROJ_SRC_DIR="${BUILD_DIR}/proj_src"
PROJ_BUILD_WASM_DIR="${BUILD_DIR}/proj_build_wasm"
DEPS_SRC_DIR="${BUILD_DIR}/deps_src"
TEMP_BUILD_DIR="${BUILD_DIR}/temp_build"
# Clean build directories to ensure a fresh build
rm -rf ${TEMP_BUILD_DIR}
# We keep DEPS_SRC_DIR to cache downloads
mkdir -p ${PROJ_SRC_DIR}
mkdir -p ${DEPS_SRC_DIR}
mkdir -p ${TEMP_BUILD_DIR}
# Emscripten flags for Pthreads (multithreading support for synchronous emscripten_fetch)
# and some other.
EM_PTHREADS_FLAGS="-pthread -matomics -mbulk-memory -fexceptions"
# --- Utility Functions ---
function log_step {
echo ""
echo "--- $1 ---"
echo ""
}
function configure_cmake {
# Use emcmake wrapper to correctly configure the toolchain
emcmake cmake "$@" \
-G Ninja \
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS=OFF \
-D CMAKE_C_FLAGS="${EM_PTHREADS_FLAGS}" \
-D CMAKE_CXX_FLAGS="${EM_PTHREADS_FLAGS}" \
-D CMAKE_FIND_ROOT_PATH="${INSTALL_DIR}" \
-D CMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY \
-D CMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-D CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
}
function build_and_install {
cmake --build . --parallel $(nproc)
cmake --install .
}
# --- Preparation ---
log_step "1. Setting up Environment and Directories"
if [ "${FORCE_REBUILD}" = "1" ]; then
echo "!!! FORCE_REBUILD is set. Existing libraries will be ignored and rebuilt. !!!"
rm -rf "${INSTALL_DIR}"/*
fi
if [ -f "${PROJ_SRC_DIR}/CMakeLists.txt" ]; then
echo "Using content from ${PROJ_SRC_DIR} to build PROJ"
elif [ -n "${PROJ_TAG}" ]; then
echo "Using PROJ from ${PROJ_REPO} : ${PROJ_TAG}"
else
echo "Please set PROJ_TAG env variable, or populate ${PROJ_SRC_DIR}"
exit 1
fi
echo "Installation target: ${INSTALL_DIR}"
# --- 2. Build and Install Zlib (Dependency) ---
log_step "2. Building and Installing Zlib"
if [ "${FORCE_REBUILD}" != "1" ] && [ -f "${INSTALL_DIR}/lib/libz.a" ] && [ -f "${INSTALL_DIR}/include/zlib.h" ]; then
echo "Zlib library and header already installed. Skipping."
else
ZLIB_DIR="${DEPS_SRC_DIR}/zlib-1.3.1"
cd ${DEPS_SRC_DIR}
if [ ! -f "v1.3.1.zip" ]; then
wget -nc "https://github.com/madler/zlib/archive/refs/tags/v1.3.1.zip"
fi
unzip -qo v1.3.1.zip
cd ${ZLIB_DIR}
# Zlib defines both SHARED and STATIC targets with the same output name (libz.a)
# on Emscripten, causing Ninja errors.
# Fixed in https://github.com/madler/zlib/commit/b3907c2cd99908259c71fab6754f88e25d370fed
# Instead of renaming, we simply remove the SHARED target definitions entirely.
sed -i '/add_library(zlib SHARED/d' CMakeLists.txt
sed -i '/target_include_directories(zlib /d' CMakeLists.txt
sed -i '/set_target_properties(zlib /d' CMakeLists.txt
sed -i 's/install(TARGETS zlib zlibstatic/install(TARGETS zlibstatic/g' CMakeLists.txt
rm -rf build_wasm
mkdir -p build_wasm
cd build_wasm
configure_cmake .. -DZLIB_BUILD_EXAMPLES=OFF
build_and_install
# Handle case where Zlib installs as libzlibstatic.a instead of libz.a
if [ -f "${INSTALL_DIR}/lib/libzlibstatic.a" ]; then
echo "Detected libzlibstatic.a, copying to libz.a..."
cp "${INSTALL_DIR}/lib/libzlibstatic.a" "${INSTALL_DIR}/lib/libz.a"
fi
fi
# --- 3. Build and Install LibTIFF (Dependency) ---
log_step "3. Building and Installing LibTIFF"
if [ "${FORCE_REBUILD}" != "1" ] && [ -f "${INSTALL_DIR}/lib/libtiff.a" ] && [ -f "${INSTALL_DIR}/include/tiff.h" ]; then
echo "LibTIFF library and header already installed. Skipping."
else
TIFF_VERSION="4.7.0"
TIFF_DIR="${DEPS_SRC_DIR}/tiff-${TIFF_VERSION}"
cd ${DEPS_SRC_DIR}
if [ ! -f "tiff-${TIFF_VERSION}.tar.gz" ]; then
wget -nc "https://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz"
fi
tar -xzf tiff-${TIFF_VERSION}.tar.gz
cd ${TIFF_DIR}
rm -rf build_wasm
mkdir -p build_wasm
cd build_wasm
# Configure minimal LibTIFF: No JPEG, No LZMA, No WebP, No ZSTD.
# Only Zlib support enabled.
configure_cmake .. \
-D tiff-tools=OFF \
-D tiff-tests=OFF \
-D tiff-contrib=OFF \
-D tiff-docs=OFF \
-D jpeg=OFF \
-D zlib=ON \
-D lzma=OFF \
-D zstd=OFF \
-D webp=OFF \
-D jbig=OFF \
-D CMAKE_PREFIX_PATH="${INSTALL_DIR}"
build_and_install
fi
# --- 4. Build and Install SQLite3 (Dependency) ---
log_step "4. Building and Installing SQLite3"
# Check if both the library AND the header exist before skipping
if [ "${FORCE_REBUILD}" != "1" ] && [ -f "${INSTALL_DIR}/lib/libsqlite3.a" ] && [ -f "${INSTALL_DIR}/include/sqlite3.h" ]; then
echo "SQLite3 static library and header already found. Skipping build."
else
SQLITE_VERSION="3440200"
SQLITE_AMALGAMATION_DIR="${DEPS_SRC_DIR}/sqlite3_amalgamation"
mkdir -p ${SQLITE_AMALGAMATION_DIR}
cd ${SQLITE_AMALGAMATION_DIR}
if [ ! -f "sqlite-amalgamation-${SQLITE_VERSION}.zip" ]; then
wget "https://sqlite.org/2023/sqlite-amalgamation-${SQLITE_VERSION}.zip"
fi
unzip -qo sqlite-amalgamation-${SQLITE_VERSION}.zip
# Move files to the parent directory for a flat structure
mv sqlite-amalgamation-${SQLITE_VERSION}/* .
rmdir sqlite-amalgamation-${SQLITE_VERSION}
# Step 4a: Compile SQLite3 to an object file (.o)
emcc sqlite3.c \
-o ${TEMP_BUILD_DIR}/sqlite3.o \
-c \
-O3 \
-DSQLITE_THREADSAFE=1 \
-D_REENTRANT \
${EM_PTHREADS_FLAGS}
# Step 4b: Create the static library archive (.a) from the object file
emmake ar rcs ${INSTALL_DIR}/lib/libsqlite3.a ${TEMP_BUILD_DIR}/sqlite3.o
# Copy the header to the install directory
mkdir -p ${INSTALL_DIR}/include
# Force copy to overwrite any broken symlinks from previous runs
rm -f ${INSTALL_DIR}/include/sqlite3.h
cp ${SQLITE_AMALGAMATION_DIR}/sqlite3.h ${INSTALL_DIR}/include/sqlite3.h
fi
# --- 5. Download PROJ Source if needed ---
log_step "5. Downloading PROJ Source"
if [ ! -f "${PROJ_SRC_DIR}/CMakeLists.txt" ]; then
git clone --depth 1 --branch ${PROJ_TAG} ${PROJ_REPO} ${PROJ_SRC_DIR}
fi
cd ${PROJ_SRC_DIR}
# --- 6. Build and Install PROJ ---
# This step uses the NATIVE sqlite3 binary (from the Docker image)
# to generate proj.db, which is then embedded into libproj.a.
log_step "6. Building and Installing PROJ"
if [ "${FORCE_REBUILD}" != "1" ] && [ -f "${INSTALL_DIR}/lib/libproj.a" ]; then
echo "PROJ already built. Skipping."
else
# If forcing a rebuild, clean the PROJ build directory too to be safe
if [ "${FORCE_REBUILD}" = "1" ]; then
echo "Cleaning PROJ build directory due to FORCE_REBUILD..."
rm -rf ${PROJ_BUILD_WASM_DIR}
fi
mkdir -p ${PROJ_BUILD_WASM_DIR}
cd ${PROJ_BUILD_WASM_DIR}
# Configure PROJ
configure_cmake ${PROJ_SRC_DIR} \
-D BUILD_TESTING=OFF \
-D BUILD_APPS=OFF \
-D ENABLE_TIFF=ON \
-D ENABLE_CURL=OFF \
-D ENABLE_EMSCRIPTEN_FETCH=ON \
-D EXE_SQLITE3=/usr/bin/sqlite3 \
-D SQLite3_INCLUDE_DIR="${INSTALL_DIR}/include" \
-D SQLite3_LIBRARY="${INSTALL_DIR}/lib/libsqlite3.a" \
-D TIFF_INCLUDE_DIR="${INSTALL_DIR}/include" \
-D TIFF_LIBRARY_RELEASE="${INSTALL_DIR}/lib/libtiff.a"
build_and_install
fi
# --- 6.5 Create C Wrappers ---
# Helper functions to extract some info from PROJ in C and C++
log_step "6.5 Creating C Wrapper Functions"
WRAPPER_FILE="${TEMP_BUILD_DIR}/proj_wrappers.cpp"
WRAPPER_OBJ_FILE="${TEMP_BUILD_DIR}/proj_wrappers.o"
DDD=`date +"%Y-%m-%dT%H:%M:%S%z" -u`
cat << EOF > ${WRAPPER_FILE}
#include "proj.h"
#include "math.h"
#include "projapps_lib.h"
#include <emscripten/bind.h>
#include <emscripten/val.h>
#include <vector>
#include <string>
void trampoline(PJ_PROJINFO_LOG_LEVEL level, const char *msg, void *user_data) {
if (!user_data) return;
const emscripten::val* js_callback = reinterpret_cast<const emscripten::val*>(user_data);
(*js_callback)(level, std::string(msg));
}
int projinfo_wrapper(uintptr_t ctx_ptr, emscripten::val jsArgs, emscripten::val jsCallback) {
std::vector<std::string> args = emscripten::vecFromJSArray<std::string>(jsArgs);
std::vector<char*> argv;
for (auto& s : args) {
argv.push_back(&s[0]);
}
PJ_CONTEXT *ctx = reinterpret_cast<PJ_CONTEXT *>(ctx_ptr);
return projinfo(ctx, args.size(), argv.data(), &trampoline, &jsCallback);
}
EMSCRIPTEN_BINDINGS(proj_module) {
emscripten::value_object<PJ_INFO>("PJ_INFO")
.field("major", &PJ_INFO::major)
.field("minor", &PJ_INFO::minor)
.field("patch", &PJ_INFO::patch)
.field("release", std::function<std::string(const PJ_INFO&)>([](const PJ_INFO& i) {
return std::string(i.release); }),
std::function<void(PJ_INFO&, std::string)>([](PJ_INFO& i, std::string v) {}))
.field("version", std::function<std::string(const PJ_INFO&)>([](const PJ_INFO& i) {
return std::string(i.version); }),
std::function<void(PJ_INFO&, std::string)>([](PJ_INFO& i, std::string v) {}));
emscripten::function("proj_info_ems", &proj_info);
emscripten::enum_<PJ_PROJINFO_LOG_LEVEL>("PJ_PROJINFO_LOG_LEVEL")
.value("INFO", PJ_PROJINFO_LOG_LEVEL_INFO)
.value("WARN", PJ_PROJINFO_LOG_LEVEL_WARN)
.value("ERR", PJ_PROJINFO_LOG_LEVEL_ERR);
emscripten::function("projinfo_ems", &projinfo_wrapper, emscripten::allow_raw_pointers());
}
extern "C" {
const char* get_compilation_date() {
return "$DDD" ;
}
int get_ptr_size() {
return sizeof(void*);
}
}
EOF
# Compile the wrapper into an object file
emcc ${WRAPPER_FILE} \
-c \
-o ${WRAPPER_OBJ_FILE} \
-I ${INSTALL_DIR}/include \
${EM_PTHREADS_FLAGS}
# --- 7. Final WASM Module Generation ---
# Link all the static libraries and the wrapper object file
# into the final JS/WASM module and expose functions.
log_step "7. Generating Final WASM Module (projModule.js + .wasm)"
FINAL_LIBS="${INSTALL_DIR}/lib/libproj.a \
${INSTALL_DIR}/lib/libsqlite3.a \
${INSTALL_DIR}/lib/libtiff.a \
${INSTALL_DIR}/lib/libz.a \
${WRAPPER_OBJ_FILE}"
# include all exported symbols
echo -e "_malloc\n_free\n_get_compilation_date\n_get_ptr_size" > ${INSTALL_DIR}/exported_symbols.txt
grep "^proj_\|^geod_" ${PROJ_SRC_DIR}/scripts/reference_exported_symbols.txt | grep -v "(" | sed 's/^/_/' >> ${INSTALL_DIR}/exported_symbols.txt
head ${INSTALL_DIR}/exported_symbols.txt
emcc -v ${FINAL_LIBS} \
-o ${INSTALL_DIR}/projModule.js \
-O3 \
-lembind \
-s STACK_OVERFLOW_CHECK=1 \
-s STACK_SIZE=5MB \
-s NO_DISABLE_EXCEPTION_CATCHING \
-s FETCH=1 \
-s USE_PTHREADS=1 \
-s FETCH_SUPPORT_INDEXEDDB=0 \
-s WASM=1 \
-s MODULARIZE=1 \
-s EXPORT_NAME="'ProjModuleFactory'" \
-s FORCE_FILESYSTEM=1 \
-s ALLOW_MEMORY_GROWTH=1 \
-s EXPORTED_RUNTIME_METHODS="[ccall, cwrap, FS, HEAP8, HEAP16, HEAP32, HEAPF64, lengthBytesUTF8, stringToUTF8, stringToNewUTF8, UTF8ToString, getValue, setValue]" \
-s EXPORTED_FUNCTIONS=@${INSTALL_DIR}/exported_symbols.txt \
${EM_PTHREADS_FLAGS}
log_step "BUILD SUCCESSFUL!"
echo "ls -l ${INSTALL_DIR}"
ls -l ${INSTALL_DIR}
echo "Artifacts are installed in ${INSTALL_DIR}"
-252
View File
@@ -1,252 +0,0 @@
const assert = require("node:assert/strict");
const ProjModuleFactory = require("./projModule.js");
// Small class to help to manage memory.
class Keeper {
constructor(proj, debug = false) {
if (!proj) {
throw new Error("proj cannot be empty in class Keeper");
}
this.proj = proj;
this.debug = debug;
this.to_free = [];
this.to_destroy = [];
};
add(ptr, proj_destroy = true) {
if (proj_destroy) {
if (this.debug)
console.debug("add destroy", ptr);
this.to_destroy.push(ptr);
} else {
if (this.debug)
console.debug("add free", ptr);
this.to_free.push(ptr);
}
return ptr;
};
call(name, ...args) {
const ptr = this.proj[name](...args);
return this.add(ptr, true);
}
malloc(ptrSize) {
const ptr = this.proj._malloc(ptrSize);
return this.add(ptr, false);
};
string(str) {
const ptr = this.proj.stringToNewUTF8(str);
return this.add(ptr, false);
};
destroy() {
this.to_destroy.reverse();
for (const p of this.to_destroy) {
if (this.debug)
console.debug("call destroy", p);
this.proj._proj_destroy(p);
}
this.to_destroy = [];
this.to_free.reverse();
for (const p of this.to_free) {
if (this.debug)
console.debug("call free", p);
this.proj._free(p);
}
this.to_free = [];
};
};
const tests = {
test_proj_info : (proj) => {
const r = proj.proj_info_ems();
const compilation_date =
proj.UTF8ToString(proj._get_compilation_date());
// Print it for visual inspection
console.log(r);
console.log(compilation_date);
assert(compilation_date.length > 5);
assert(r.major >= 9);
if (r.major === 9) {
assert(r.minor >= 8);
}
assert(typeof r.minor === "number")
assert(typeof r.patch === "number")
const rel = `${r.major}.${r.minor}.${r.patch}`;
assert(r.release.includes(rel));
assert(r.version.includes(rel));
},
test_projinfo : (proj) => {
function get_projinfo(args) {
let msg = "";
const myCallback = (level, message) => { msg += message; };
const rc = proj.projinfo_ems(0, args, myCallback);
return [ rc, msg ];
} {
let [rc, msg] = get_projinfo([ "EPSG:32633", "-o", "WKT1:GDAL" ]);
assert.equal(rc, 0);
assert.ok(msg.includes('PROJCS["WGS 84 / UTM zone 33N"'));
assert.ok(msg.includes('AUTHORITY["EPSG","32633"]'));
} {let [rc, msg] = get_projinfo([ "EPSG:32633", "-o", "invalid" ]);
assert.equal(rc, 1);
assert.ok(msg.includes('Unrecognized value '));} {
let [rc, msg] = get_projinfo(
[ "EPSG:4326", "EPSG:32633", "-o", "proj", "--single-line" ]);
assert.equal(rc, 0);
assert.ok(msg.includes('Candidate operations'));
assert.ok(
msg.includes(('+proj=pipeline +step +proj=axisswap +order=2,1 ',
'+step +proj=unitconvert +xy_in=deg +xy_out=rad ',
'+step +proj=utm +zone=33 +ellps=WGS84')));
}
},
test_convert : (proj) => {
let ctx = proj._proj_context_create();
if (ctx === 0) {
throw new Error("proj_context_create returned NULL");
}
const sourceCRS = proj.stringToNewUTF8("EPSG:4326");
const targetCRS = proj.stringToNewUTF8("EPSG:32633");
const P = proj._proj_create_crs_to_crs(ctx, sourceCRS, targetCRS, 0);
if (P === 0) {
throw new Error("proj_create_crs_to_crs returned NULL.");
}
// PJ_COORD is 4 doubles: (x, y, z, t) or (lon, lat, z, t)
// We need 4 * 8 = 32 bytes of memory
let coordPtr = proj._malloc(32);
const coordView = new Float64Array(proj.HEAPF64.buffer, coordPtr, 4);
coordView[0] = 52;
coordView[1] = 13.5;
coordView[2] = 0;
coordView[3] = Infinity; // HUGE_VAL
let res = proj._proj_trans_array(P, 1, 1, coordPtr);
if (res != 0) {
let msgPtr = proj._proj_context_errno_string(ctx, res);
let msg = proj.UTF8ToString(msgPtr);
throw new Error(`_proj_trans_array error ${msg}`);
}
assert(Math.abs(coordView[0] - 397027.0183) < 1e-3);
assert(Math.abs(coordView[1] - 5762100.4897) < 1e-3);
proj._free(coordPtr);
proj._proj_destroy(P);
proj._free(sourceCRS);
proj._free(targetCRS);
proj._proj_destroy(ctx);
},
test_axes : (proj) => {
let ctx = proj._proj_context_create();
if (ctx === 0) {
throw new Error("proj_context_create returned NULL");
}
function get_str(ptr) {
const strPtr = proj.getValue(ptr, 'i32'); // It's a pointer (i32)
const str = proj.UTF8ToString(strPtr);
return str;
}
function get_axes(crs) {
let keep = new Keeper(proj);
try {
// TODO support compound CRS
const ptrSize = proj._get_ptr_size();
assert.ok(ptrSize == 4 || ptrSize == 8);
const doubleSize = 8; // Doubles are 8 bytes
const sourceCRS = keep.string(crs);
const P_crs = keep.call("_proj_create", ctx, sourceCRS);
const P_cs =
keep.add(proj._proj_crs_get_coordinate_system(ctx, P_crs));
const axis_count = proj._proj_cs_get_axis_count(ctx, P_cs);
const outNamePtr = keep.malloc(ptrSize);
const outAbbrevPtr = keep.malloc(ptrSize);
const outDirectionPtr = keep.malloc(ptrSize);
const outConvFactorPtr = keep.malloc(doubleSize);
const outUnitPtr = keep.malloc(ptrSize);
res = {
name : [],
abbr : [],
direction : [],
conv_factor : [],
unit : []
};
for (let i = 0; i < axis_count; i++) {
const r = proj._proj_cs_get_axis_info(
ctx, P_cs, i, outNamePtr, outAbbrevPtr, outDirectionPtr,
outConvFactorPtr, outUnitPtr, 0, 0);
if (r != 1) {
throw new Error("error calling proj_cs_get_axis_info");
}
res.name.push(get_str(outNamePtr));
res.abbr.push(get_str(outAbbrevPtr));
res.direction.push(get_str(outDirectionPtr));
res.conv_factor.push(
proj.getValue(outConvFactorPtr, 'double'));
res.unit.push(get_str(outUnitPtr));
}
} finally {
keep.destroy();
}
return res;
}
const ax4326 = get_axes("EPSG:4326");
assert.deepEqual(ax4326, {
name : [ 'Geodetic latitude', 'Geodetic longitude' ],
abbr : [ 'Lat', 'Lon' ],
direction : [ 'north', 'east' ],
conv_factor : [ 0.017453292519943295, 0.017453292519943295 ],
unit : [ 'degree', 'degree' ]
});
const ax25833 = get_axes("EPSG:25833");
assert.deepEqual(ax25833, {
name : [ 'Easting', 'Northing' ],
abbr : [ 'E', 'N' ],
direction : [ 'east', 'north' ],
conv_factor : [ 1, 1 ],
unit : [ 'metre', 'metre' ]
});
const ax3855 = get_axes("EPSG:3855");
assert.deepEqual(ax3855, {
name : [ 'Gravity-related height' ],
abbr : [ 'H' ],
direction : [ 'up' ],
conv_factor : [ 1 ],
unit : [ 'metre' ]
});
proj._proj_destroy(ctx);
}
};
if (typeof ProjModuleFactory === 'undefined') {
console.error(
"'ProjModuleFactory' is not defined. Have you loaded projModule.js.");
process.exit(1);
} else {
ProjModuleFactory()
.then(module => {
proj = module;
console.log("Starting tests");
let counter = 0;
for (let test of Object.keys(tests)) {
console.log(`+++++ Running test "${test}"`)
tests[test](proj);
counter++;
};
console.log(`Number of tests run: ${counter}`)
process.exit(0);
})
.catch(err => {
console.error(`Tests failed: ${err}`);
process.exit(1);
});
}
-62
View File
@@ -1,62 +0,0 @@
#!/bin/bash
set -e
dnf install -y cmake clang ccache ninja-build sqlite-devel libtiff-devel libcurl-devel diffutils wget
# For this build, install nlohmann-json so that the "use external"
# branch is tested; the other builds use the vendored copy.
dnf install -y nlohmann-json-devel
cd "$WORK_DIR"
if test -f "$WORK_DIR/ccache.tar.gz"; then
echo "Restoring ccache..."
(cd $HOME && tar xzf "$WORK_DIR/ccache.tar.gz")
fi
export CCACHE_CPP2=yes
ccache -M 500M
ccache -s
mkdir build
cd build
echo "Build with -DEMBED_RESOURCE_FILES=ON"
CC=clang CXX=clang++ cmake .. \
-DEMBED_RESOURCE_FILES=ON -DUSE_CCACHE=ON -DPROJ_DB_CACHE_DIR=$HOME/.ccache ..
make -j$(nproc)
ctest -j$(nproc)
# Try EMBED_RESOURCE_DIRECTORY option
wget https://raw.githubusercontent.com/OSGeo/PROJ-data/refs/heads/master/us_nga/us_nga_egm96_15.tif
wget https://cdn.proj.org/fi_nls_ykj_etrs35fin.gpkg
mkdir grids
mv us_nga_egm96_15.tif grids
mv fi_nls_ykj_etrs35fin.gpkg grids
echo "Build with -DEMBED_RESOURCE_FILES=ON -DEMBED_RESOURCE_DIRECTORY=$PWD/grids"
CC=clang CXX=clang++ cmake .. -DEMBED_RESOURCE_DIRECTORY=$PWD/grids
make -j$(nproc)
rm -rf data
echo 49 2 0 | bin/cs2cs "WGS84 + EGM96 height" EPSG:4979
echo 49 2 0 | bin/cs2cs "WGS84 + EGM96 height" EPSG:4979 | grep 44.643 >/dev/null || (echo "Expected 49dN 2dE 44.643 as a result" && /bin/false)
echo 0 0 0 | bin/cct +init=ITRF2000:ITRF96
echo 0 0 0 | bin/cct +init=ITRF2000:ITRF96 | grep 0.0067 >/dev/null || (echo "Expected 0.0067 0.0061 -0.0185 as a result" && /bin/false)
echo 3432087 6995748 0 | bin/cct +proj=tinshift +file=fi_nls_ykj_etrs35fin.gpkg
echo 3432087 6995748 0 | bin/cct +proj=tinshift +file=fi_nls_ykj_etrs35fin.gpkg | grep 431943.0905 >/dev/null || (echo "Expected 431943.0905 6992816.7826 0 as a result" && /bin/false)
echo "Build with -DEMBED_RESOURCE_FILES=ON -DEMBED_RESOURCE_DIRECTORY=$PWD/grids -DUSE_ONLY_EMBEDDED_RESOURCE_FILES=ON"
CC=clang CXX=clang++ cmake .. -DEMBED_RESOURCE_DIRECTORY=$PWD/grids -DUSE_ONLY_EMBEDDED_RESOURCE_FILES=ON
make -j$(nproc)
rm -rf data
echo 49 2 0 | bin/cs2cs "WGS84 + EGM96 height" EPSG:4979
echo 49 2 0 | bin/cs2cs "WGS84 + EGM96 height" EPSG:4979 | grep 44.643 >/dev/null || (echo "Expected 49dN 2dE 44.643 as a result" && /bin/false)
echo 0 0 0 | bin/cct +init=ITRF2000:ITRF96
echo 0 0 0 | bin/cct +init=ITRF2000:ITRF96 | grep 0.0067 >/dev/null || (echo "Expected 0.0067 0.0061 -0.0185 as a result" && /bin/false)
cd ..
ccache -s
echo "Saving ccache..."
rm -f "$WORK_DIR/ccache.tar.gz"
(cd $HOME && tar czf "$WORK_DIR/ccache.tar.gz" .cache)
-304
View File
@@ -1,304 +0,0 @@
#!/bin/bash
set -e
UNAME="$(uname)" || UNAME=""
if test "x${NPROC}" = "x"; then
if test "${UNAME}" = "Linux" ; then
NPROC=$(nproc);
elif test "${UNAME}" = "Darwin" ; then
NPROC=$(sysctl -n hw.ncpu);
fi
if test "x${NPROC}" = "x"; then
NPROC=2;
fi
fi
echo "NPROC=${NPROC}"
export MAKEFLAGS="-j ${NPROC}"
# Use ccache if it's available
if command -v ccache &> /dev/null
then
USE_CCACHE=ON
ccache -s
else
USE_CCACHE=OFF
fi
# Ensure directory exists for PROJ_DB_CACHE_DIR
mkdir -p $HOME/.ccache
if test "x${CMAKE_BUILD_TYPE}" = "x"; then
CMAKE_BUILD_TYPE=Release
fi
cmake --version
# For some odd reason the tar xzvf $TAR_FILENAME doesn't work on Travis-CI ...
if test "$TRAVIS" = ""; then
echo "Make dist tarball, and check consistency"
mkdir build_dist
cd build_dist
cmake -D BUILD_TESTING=OFF ..
make dist
TAR_FILENAME=$(ls *.tar.gz)
TAR_DIRECTORY=$(basename $TAR_FILENAME .tar.gz)
mkdir ../build_from_dist
cd ../build_from_dist
tar xvzf ../build_dist/$TAR_FILENAME
# continue build from dist tarball
cd $TAR_DIRECTORY
fi
# There's a nasty #define CS in a Solaris system header. Avoid being caught about that again
CXXFLAGS="-DCS=do_not_use_CS_for_solaris_compat $CXXFLAGS"
echo "Build shared ${CMAKE_BUILD_TYPE} configuration from generated tarball"
mkdir shared_build
cd shared_build
cmake \
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-D CMAKE_UNITY_BUILD=ON \
-D CMAKE_COMPILE_WARNING_AS_ERROR=ON \
-D USE_CCACHE=${USE_CCACHE} \
${PROJ_CMAKE_BUILD_OPTIONS:-} \
-D PROJ_DB_CACHE_DIR=$HOME/.ccache \
-D BUILD_SHARED_LIBS=ON \
-D BUILD_EXAMPLES=ON \
-D CMAKE_INSTALL_PREFIX=/tmp/proj_shared_install_from_dist \
..
make
# Test adding non-official file to DB
cp data/proj.db /tmp
cat ../data/sql/transformations_czechia_extra.sql | sqlite3 /tmp/proj.db
if [ "$(uname)" == "Linux" -a -f lib/libproj.so ]; then
if objdump -TC "lib/libproj.so" | grep "elf64-x86-64">/dev/null; then
echo "Checking exported symbols..."
cat $TRAVIS_BUILD_DIR/scripts/reference_exported_symbols.txt | sort > /tmp/reference_exported_symbols.txt
$TRAVIS_BUILD_DIR/scripts/dump_exported_symbols.sh lib/libproj.so | sort > /tmp/got_symbols.txt
diff -u /tmp/reference_exported_symbols.txt /tmp/got_symbols.txt || (echo "Difference(s) found in exported symbols. If intended, refresh scripts/reference_exported_symbols.txt with 'scripts/dump_exported_symbols.sh lib/libproj.so > scripts/reference_exported_symbols.txt'"; exit 1)
fi
fi
ctest --output-on-failure
make install
# find /tmp/proj_shared_install_from_dist
$TRAVIS_BUILD_DIR/test/postinstall/test_cmake.sh /tmp/proj_shared_install_from_dist shared
if [ "$BUILD_NAME" != "osx" ]; then
# Fail on osx Conda with "autom4te: error: need GNU m4 1.4 or later: /Users/runner/miniforge3/conda-bld/autoconf_1746873780934/_build_env/bin/m4"
$TRAVIS_BUILD_DIR/test/postinstall/test_autotools.sh /tmp/proj_shared_install_from_dist
else
echo "Skipping test_autotools.sh test for $BUILD_NAME"
fi
# Test install and uninstall targets with DESTDIR
make install DESTDIR=/tmp/destdir
make uninstall DESTDIR=/tmp/destdir
if [ ! -z "$(ls -A /tmp/destdir/tmp/proj_shared_install_from_dist)" ]; then
echo "Directory /tmp/destdir/tmp/proj_shared_install_from_dist should be empty, but its content is:"
find /tmp/destdir/tmp/proj_shared_install_from_dist
exit 1
fi
echo "Build static ${CMAKE_BUILD_TYPE} configuration from generated tarball"
cd ..
mkdir static_build
cd static_build
# Also test setting CMAKE_INSTALL_INCLUDEDIR/CMAKE_INSTALL_LIBDIR/CMAKE_INSTALL_BINDIR to absolute directories
# and INSTALL_LEGACY_CMAKE_FILES=OFF (both are independent from static build particularities)
cmake \
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-D CMAKE_COMPILE_WARNING_AS_ERROR=ON \
-D USE_CCACHE=${USE_CCACHE} \
-D PROJ_DB_CACHE_DIR=$HOME/.ccache \
-D BUILD_SHARED_LIBS=OFF \
-D INSTALL_LEGACY_CMAKE_FILES=OFF \
-D CMAKE_INSTALL_PREFIX=/tmp/proj_static_install_from_dist \
-D CMAKE_INSTALL_INCLUDEDIR=/tmp/proj_static_install_from_dist/include \
-D CMAKE_INSTALL_LIBDIR=/tmp/proj_static_install_from_dist/lib \
-D CMAKE_INSTALL_BINDIR=/tmp/proj_static_install_from_dist/bin \
..
make
ctest --output-on-failure
make install
# find /tmp/proj_static_install_from_dist
$TRAVIS_BUILD_DIR/test/postinstall/test_cmake.sh /tmp/proj_static_install_from_dist static PROJ_CONFIG
if [ "$BUILD_NAME" != "osx" ]; then
# Fail on osx Conda with "autom4te: error: need GNU m4 1.4 or later: /Users/runner/miniforge3/conda-bld/autoconf_1746873780934/_build_env/bin/m4"
$TRAVIS_BUILD_DIR/test/postinstall/test_autotools.sh /tmp/proj_static_install_from_dist static
else
echo "Skipping test_autotools.sh test for $BUILD_NAME"
fi
# Re-run by unsetting CMAKE_INSTALL_INCLUDEDIR/CMAKE_INSTALL_LIBDIR/CMAKE_INSTALL_BINDIR
# so that later test which involve renaming/moving the installation prefix work.
cmake -UCMAKE_INSTALL_INCLUDEDIR -UCMAKE_INSTALL_LIBDIR -UCMAKE_INSTALL_BINDIR ..
make install
echo "Run PROJJSON tests only with shared configuration"
export SCHEMA_FILENAME=/tmp/proj_shared_install_from_dist/share/proj/projjson.schema.json
validate_json(){
if [ $(jsonschema --version) = "3.2.0" ]; then
# workaround for this version, which does not validate UTF-8
tr -cd '\11\12\15\40-\176' < $1 > tmp.ascii.json
jsonschema -i tmp.ascii.json ${SCHEMA_FILENAME}
else
jsonschema -i $1 ${SCHEMA_FILENAME}
fi
ret=$?
if [ $ret != 0 ]; then
return $ret
else
echo "Valid!"
fi
return 0
}
test_projjson(){
printf "Testing PROJJSON output with $* ... "
case "$1" in
\+*)
/tmp/proj_shared_install_from_dist/bin/projinfo "$@" -o PROJJSON -q > out.json ;;
*)
/tmp/proj_shared_install_from_dist/bin/projinfo $* -o PROJJSON -q > out.json ;;
esac
validate_json out.json
ret=$?
if [ $ret != 0 ]; then
return $ret
fi
/tmp/proj_shared_install_from_dist/bin/projinfo @out.json -o PROJJSON -q > out2.json
diff -u out.json out2.json
ret=$?
rm -f out.json out2.json
return $ret
}
test_projjson EPSG:32631
test_projjson EPSG:4326+3855
test_projjson "+proj=longlat +ellps=GRS80 +nadgrids=@foo +type=crs"
test_projjson -s EPSG:3111 -t GDA2020
# Dynamic geographic CRS "WGS 84 (G1762)"
test_projjson EPSG:9057
# Dynamic vertical CRS "RH2000 height"
test_projjson EPSG:5613
test_projjson "ITRF2014@2025.0"
validate_json $TRAVIS_BUILD_DIR/schemas/v0.5/examples/point_motion_operation.json
cd ..
echo "Check that we can retrieve the resource directory in a relative way after renaming the installation prefix"
mkdir /tmp/proj_shared_install_from_dist_renamed
mkdir /tmp/proj_static_install_from_dist_renamed
mv /tmp/proj_shared_install_from_dist /tmp/proj_shared_install_from_dist_renamed/subdir
mv /tmp/proj_static_install_from_dist /tmp/proj_static_install_from_dist_renamed/subdir
set +e
/tmp/proj_shared_install_from_dist_renamed/subdir/bin/projsync --source-id ? --dry-run --system-directory 2>/dev/null 1>shared.out
/tmp/proj_static_install_from_dist_renamed/subdir/bin/projsync --source-id ? --dry-run --system-directory 2>/dev/null 1>static.out
set -e
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
# on macOS 11 /tmp is resolved by PROJ as a symlink to /private/tmp only for the shared build.
# on macOS 12 for both static and shared builds
INST=/private/tmp
else
INST=/tmp
fi
cat shared.out
grep "Downloading from https://cdn.proj.org into $INST/proj_shared_install_from_dist_renamed/subdir/share/proj" shared.out
cat static.out
grep "Downloading from https://cdn.proj.org into \($INST\|/tmp\)/proj_static_install_from_dist_renamed/subdir/share/proj" static.out
rm shared.out static.out
sed -i'.bak' -e '1c\
prefix='"$INST"'/proj_shared_install_from_dist_renamed/subdir' $INST/proj_shared_install_from_dist_renamed/subdir/lib/pkgconfig/proj.pc
# cat $INST/proj_shared_install_from_dist_renamed/subdir/lib/pkgconfig/proj.pc
sed -i'.bak' -e '1c\
prefix=/tmp/proj_static_install_from_dist_renamed/subdir' /tmp/proj_static_install_from_dist_renamed/subdir/lib/pkgconfig/proj.pc
# cat /tmp/proj_static_install_from_dist_renamed/subdir/lib/pkgconfig/proj.pc
if [ $BUILD_NAME = "linux_gcc" ]; then
$TRAVIS_BUILD_DIR/test/postinstall/test_autotools.sh /tmp/proj_shared_install_from_dist_renamed/subdir shared
PROJ_DATA=/tmp/proj_static_install_from_dist_renamed/subdir/share/proj $TRAVIS_BUILD_DIR/test/postinstall/test_autotools.sh /tmp/proj_static_install_from_dist_renamed/subdir static
else
echo "Skipping test_autotools.sh test for $BUILD_NAME"
fi
$TRAVIS_BUILD_DIR/test/postinstall/test_cmake.sh /tmp/proj_shared_install_from_dist_renamed/subdir shared
PROJ_DATA=/tmp/proj_static_install_from_dist_renamed/subdir/share/proj $TRAVIS_BUILD_DIR/test/postinstall/test_cmake.sh /tmp/proj_static_install_from_dist_renamed/subdir static PROJ_CONFIG
if [ "$BUILD_NAME" != "linux_gcc8" -a "$BUILD_NAME" != "linux_gcc_32bit" ]; then
echo "Build PROJ as a subproject"
mkdir proj_as_subproject
cd proj_as_subproject
mkdir external
ln -s $PWD/.. external/PROJ
echo '#include "proj.h"' > mytest.c
echo 'int main() { proj_info(); return 0; }' >> mytest.c
echo 'cmake_minimum_required(VERSION 3.9)' > CMakeLists.txt
echo 'project(mytest)' >> CMakeLists.txt
echo 'add_subdirectory(external/PROJ)' >> CMakeLists.txt
echo 'add_executable(mytest mytest.c)' >> CMakeLists.txt
echo 'target_include_directories(mytest PRIVATE $<TARGET_PROPERTY:PROJ::proj,INTERFACE_INCLUDE_DIRECTORIES>)' >> CMakeLists.txt
echo 'target_link_libraries(mytest PRIVATE PROJ::proj)' >> CMakeLists.txt
mkdir build_cmake
cd build_cmake
cmake -D USE_CCACHE=${USE_CCACHE} -D PROJ_DB_CACHE_DIR=$HOME/.ccache ..
make
# return to root
cd ../..
if test "$TRAVIS" = ""; then
cd ../..
fi
echo "Build coverage as in-source build"
# There's an issue with the clang on Travis + coverage + cpp code
if [ "$BUILD_NAME" != "linux_clang" ]; then
# build with grids and coverage
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage" cmake \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_COMPILE_WARNING_AS_ERROR=ON \
-D USE_CCACHE=${USE_CCACHE} \
-D PROJ_DB_CACHE_DIR=$HOME/.ccache \
-D CMAKE_C_FLAGS="--coverage" \
-D CMAKE_CXX_FLAGS="--coverage" \
. ;
else
LDFLAGS="$LDFLAGS -lgcov" cmake \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_COMPILE_WARNING_AS_ERROR=ON \
-D USE_CCACHE=${USE_CCACHE} \
-D PROJ_DB_CACHE_DIR=$HOME/.ccache \
-D CMAKE_C_FLAGS="$CFLAGS --coverage" \
-D CMAKE_CXX_FLAGS="$CXXFLAGS --coverage" \
. ;
fi
else
cmake \
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-D CMAKE_COMPILE_WARNING_AS_ERROR=ON \
-D USE_CCACHE=${USE_CCACHE} \
-D PROJ_DB_CACHE_DIR=$HOME/.ccache \
. ;
fi
make
ctest --output-on-failure
fi
if [ "${USE_CCACHE}" = "ON" ]; then
ccache -s
fi
-52
View File
@@ -1,52 +0,0 @@
#!/bin/bash
set -e
export TRAVIS_OS_NAME=linux
export BUILD_NAME=linux_gcc_32bit
export TRAVIS_BUILD_DIR="$WORK_DIR"
GCC_VERSION=13
ARCH=i386
dpkg --add-architecture i386
apt-get update -y
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o APT::Immediate-Configure=0 \
autoconf automake libtool make cmake ccache pkg-config sqlite3 tar zip curl ca-certificates jq \
python3-pytest python3-ruamel.yaml python3-jsonschema \
gcc-$GCC_VERSION-multilib g++-$GCC_VERSION-multilib g++-$GCC_VERSION \
libsqlite3-dev:$ARCH libgtest-dev:$ARCH \
libtiff-dev:$ARCH libwebp-dev:$ARCH libzstd-dev:$ARCH \
libcurl4-openssl-dev:$ARCH libnghttp2-dev:$ARCH libidn2-dev:$ARCH librtmp-dev:$ARCH libssh-dev:$ARCH \
libpsl-dev:$ARCH libssl-dev:$ARCH libkrb5-dev:$ARCH comerr-dev:$ARCH libldap2-dev:$ARCH libbrotli-dev:$ARCH
LIBDIR=/usr/lib/i386-linux-gnu
INCDIR=/usr/include/i386-linux-gnu
export CXXFLAGS="-m32 -D_GLIBCXX_ASSERTIONS"
export CFLAGS="-m32"
export TIFF_CFLAGS="-I$INCDIR"
export TIFF_LIBS="-L$LIBDIR -ltiff"
export SQLITE3_CFLAGS="-I$INCDIR"
export SQLITE3_LIBS="-L$LIBDIR -lsqlite3"
export PKG_CONFIG=i686-linux-gnu-pkg-config
cd "$WORK_DIR"
if test -f "$WORK_DIR/ccache.tar.gz"; then
echo "Restoring ccache..."
(cd $HOME && tar xzf "$WORK_DIR/ccache.tar.gz")
else
mkdir -p $HOME/.ccache
fi
ccache -M 500M
CC="gcc-$GCC_VERSION" CXX="g++-$GCC_VERSION" CMAKE_BUILD_TYPE=RelWithDebInfo ./ci/install.sh
echo "Saving ccache..."
rm -f "$WORK_DIR/ccache.tar.gz"
(cd $HOME && tar czf "$WORK_DIR/ccache.tar.gz" .ccache)
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
set -e
./ci/before_install_apt.sh
./ci/before_install_pip.sh
sudo apt-get install -qq \
sqlite3 zip \
libsqlite3-dev \
libtiff-dev libwebp-dev \
libcurl4-openssl-dev libnghttp2-dev libidn2-dev librtmp-dev libssh-dev \
libpsl-dev libssl-dev libkrb5-dev comerr-dev libldap2-dev libbrotli-dev
-6
View File
@@ -1,6 +0,0 @@
#!/bin/bash
set -e
# -fno-use-cxa-atexit is needed to build with -coverage
./ci/install.sh
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
set -e
mamba install --yes --quiet --only-deps proj
-20
View File
@@ -1,20 +0,0 @@
name: proj
channels:
- conda-forge
dependencies:
- python=3.8
- conda
- mamba
- compilers
- compiler-rt
- ninja
- cmake
- pkg-config
- ccache
- autoconf
- automake
- m4
- jsonschema
- ruamel.yaml
- pytest
-7
View File
@@ -1,7 +0,0 @@
#!/bin/bash
set -e
ccache -M 200M
CC="clang" CXX="clang++" CMAKE_BUILD_TYPE=RelWithDebInfo ./ci/install.sh
-128
View File
@@ -1,128 +0,0 @@
#!/bin/sh
set -e
SCRIPT_DIR=$(dirname "$0")
case $SCRIPT_DIR in
"/"*)
;;
".")
SCRIPT_DIR=$(pwd)
;;
*)
SCRIPT_DIR=$(pwd)/$(dirname "$0")
;;
esac
apt-get update -y
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
sudo wget tzdata
USER=root
export USER
cd "$WORK_DIR"
if test -f "$WORK_DIR/ccache.tar.gz"; then
echo "Restoring ccache..."
(cd $HOME && tar xzf "$WORK_DIR/ccache.tar.gz")
else
mkdir -p $HOME/.ccache
fi
sudo apt-get install -y --no-install-recommends \
binutils-mingw-w64-x86-64 \
gcc-mingw-w64-x86-64 \
g++-mingw-w64-x86-64 \
g++-mingw-w64 \
mingw-w64-tools \
wine-stable \
cmake make ccache \
sqlite3 \
curl ca-certificates
# Select posix/pthread for std::mutex
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
ccache -M 500M
ccache -s
MINGW_ARCH=x86_64-w64-mingw32
MINGW_PREFIX=/usr/lib/gcc/$MINGW_ARCH/10-posix
export CC="$MINGW_ARCH-gcc"
export CXX="$MINGW_ARCH-g++"
export LD=$MINGW_ARCH-ld
UNAME="$(uname)" || UNAME=""
NPROC=$(nproc);
echo "NPROC=${NPROC}"
export MAKEFLAGS="-j ${NPROC}"
# prepare wine environment
export WINE_PREFIX="$HOME/.wine"
WINE_SYSDIR=$WINE_PREFIX/drive_c/windows
wine64 cmd /c dir
ln -s $MINGW_PREFIX/libstdc++-6.dll $WINE_SYSDIR
ln -s $MINGW_PREFIX/libgcc_s_seh-1.dll $WINE_SYSDIR
# ln -s $MINGW_PREFIX/libgcc_s_sjlj-1.dll $WINE_SYSDIR
ln -s /usr/$MINGW_ARCH/lib/libwinpthread-1.dll $WINE_SYSDIR
# build zlib
wget -q https://github.com/madler/zlib/archive/v1.2.11.tar.gz
tar xzf v1.2.11.tar.gz
(cd zlib-1.2.11 && \
sudo make install -f win32/Makefile.gcc SHARED_MODE=1 \
PREFIX=${MINGW_ARCH}- \
prefix=/usr/${MINGW_ARCH} \
DESTDIR=/usr/${MINGW_ARCH}/ \
BINARY_PATH=bin INCLUDE_PATH=include LIBRARY_PATH=lib)
ln -s /usr/$MINGW_ARCH/bin/zlib1.dll $WINE_SYSDIR
# build libtiff
wget -q http://download.osgeo.org/libtiff/tiff-4.1.0.tar.gz
tar xzf tiff-4.1.0.tar.gz
(cd tiff-4.1.0 && ./configure --host=$MINGW_ARCH --prefix=/usr/$MINGW_ARCH && make && sudo make install)
ln -s /usr/$MINGW_ARCH/bin/libtiff-5.dll $WINE_SYSDIR
# build sqlite3
wget -q https://sqlite.org/2020/sqlite-autoconf-3330000.tar.gz
tar xzf sqlite-autoconf-3330000.tar.gz
# Build with SQLITE_DQS=0 to ensure we properly use single quotes and double quotes (cf issue #2480)
(cd sqlite-autoconf-3330000 &&
CFLAGS="-DSQLITE_DQS=0" ./configure --host=$MINGW_ARCH --prefix=/usr/$MINGW_ARCH && make && sudo make install)
ln -s /usr/$MINGW_ARCH/bin/libsqlite3-0.dll $WINE_SYSDIR
# build proj
rm -rf build
mkdir build
cd build
cmake \
-G "Unix Makefiles" \
-D CMAKE_SYSTEM_NAME=Windows \
-D CMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/wine64 \
-D CMAKE_C_COMPILER=/usr/bin/${MINGW_ARCH}-gcc \
-D CMAKE_CXX_COMPILER=/usr/bin/${MINGW_ARCH}-g++ \
-D CMAKE_COMPILE_WARNING_AS_ERROR=ON \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_FIND_ROOT_PATH=/usr/${MINGW_ARCH} \
-D CMAKE_INSTALL_PREFIX=/tmp/proj_install \
-D ENABLE_CURL=OFF \
-D BUILD_PROJSYNC=OFF \
-D USE_CCACHE=ON \
-D PROJ_DB_CACHE_DIR=$HOME/.ccache \
..
make
# Run a subset of tests that should pass
ctest --output-on-failure -R "proj_test_cpp_api|geodesic-test|proj_errno_string_test|proj_angular_io_test|proj_context_test|pj_phi2_test|gie_self_tests|test_network|test_defmodel|test_tinshift|test_misc|test_fork"
# TODO: fix failing tests with .gie files; see #2168 and run
# PROJ_DATA=./data/for_tests wine64 ./bin/gie.exe ../test/gie/more_builtins.gie
make install
ccache -s
echo "Saving ccache..."
rm -f "$WORK_DIR/ccache.tar.gz"
(cd $HOME && test ! -e .ccache || tar czf "$WORK_DIR/ccache.tar.gz" .ccache)
+33 -116
View File
@@ -1,75 +1,9 @@
# The old CMake PROJECT-NAME was PROJ4.
set (PROJECT_LEGACY_NAME PROJ4)
string (TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
string (TOLOWER "${PROJECT_LEGACY_NAME}" PROJECT_LEGACY_LOWER)
# Starting with version 7.0, we install config-style find package
# files so that PROJ can be found with both
#
# find_package(PROJ)
# find_package(PROJ4)
#
# Here are the details... The command
#
# find_package(PROJ)
#
# if successful, will define variables
#
# PROJ_FOUND
# PROJ_VERSION
# PROJ_LIBRARIES = PROJ::proj
# PROJ_INCLUDE_DIRS
# etc
#
# and will define targets
#
# PROJ::proj
# PROJ4::proj
#
# Similarly
#
# find_package(PROJ4)
#
# if successful, will define variables
#
# PROJ4_FOUND
# PROJ4_VERSION
# PROJ4_LIBRARIES = PROJ4::proj
# PROJ4_INCLUDE_DIRS
# etc
#
# and will define targets
#
# PROJ::proj
# PROJ4::proj
#
# Note that targets PROJ::proj and PROJ4::proj are provided in both
# cases. However, no attempt is made to define both sets of variables
# with the two find_package options. Doing so would just lead to user
# confusion.
#
# Because pre-7.0 versions of PROJ do not support find_package (PROJ)
# and do not define a target PROJ::proj
#
# find_package(PROJ4)
#
# (instead of PROJ) should be used in any development scenarios which
# might involve (even indirectly) pre-7.0 versions of PROJ.
#
# At some future dates, find_package (PROJ4) will
#
# define PROJ4_LIBRARIES = PROJ::proj
# give WARNING message suggesting migration to find_package(PROJ)
# be disallowed via the version checking code
#
# At some more distant date, the PROJ4::proj target will be retired.
#
#
# All this messiness is confined to
#
# cmake/CMakeLists.txt (this file)
# cmake/project-config.cmake.in
# cmake/project-config-version.cmake.in
# proj-config.cmake for the install tree. It's installed in
# ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative
# path to the root from there. (Note that the whole install tree can
# be relocated.)
file(RELATIVE_PATH PROJECT_ROOT_DIR
${CMAKE_INSTALL_PREFIX}/${CMAKECONFIGDIR} ${CMAKE_INSTALL_PREFIX})
# Variables needed by ${PROJECT_NAME_LOWER}-config-version.cmake
if (MSVC)
@@ -82,49 +16,32 @@ else ()
set (MSVC_TOOLSET_VERSION 0)
set (MSVC_TOOLSET_MAJOR 0)
endif ()
# If this is a regular build (PROJECT_SOURCE_DIR == CMAKE_SOURCE_DIR), export legacy files by default
# Otherwise, this is embedded in another project, only export PROJ target
# cf https://github.com/OSGeo/gdal/issues/5646
string(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" DEFAULT_VAL)
option(INSTALL_LEGACY_CMAKE_FILES "Install PROJ4 legacy target CMake files" ${DEFAULT_VAL})
set(PROJECT_LIST ${PROJECT_NAME})
if (INSTALL_LEGACY_CMAKE_FILES)
set(PROJECT_LIST "${PROJECT_LIST}" "${PROJECT_LEGACY_NAME}")
if (CMAKE_CROSSCOMPILING)
# Ensure that all "true" (resp. "false") settings are represented by
# the same string.
set (CMAKE_CROSSCOMPILING_STR "ON")
else ()
set (CMAKE_CROSSCOMPILING_STR "OFF")
endif ()
foreach (PROJECT_VARIANT_NAME IN LISTS PROJECT_LIST)
string (TOLOWER "${PROJECT_VARIANT_NAME}" PROJECT_VARIANT_LOWER)
set (CMAKECONFIGSUBDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_VARIANT_LOWER}")
# proj-config.cmake for the install tree. It's installed in
# ${CMAKECONFIGSUBDIR} and @PROJECT_ROOT_DIR@ is the relative
# path to the root from there. (Note that the whole install tree can
# be relocated.)
file (RELATIVE_PATH PROJECT_ROOT_DIR
${CMAKE_INSTALL_PREFIX}/${CMAKECONFIGSUBDIR} ${CMAKE_INSTALL_PREFIX})
configure_file (project-config.cmake.in
project-${PROJECT_VARIANT_LOWER}-config.cmake @ONLY)
configure_file (project-config-version.cmake.in
project-${PROJECT_VARIANT_LOWER}-version.cmake @ONLY)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/project-${PROJECT_VARIANT_LOWER}-config.cmake"
DESTINATION "${CMAKECONFIGSUBDIR}"
RENAME "${PROJECT_VARIANT_LOWER}-config.cmake")
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/project-${PROJECT_VARIANT_LOWER}-version.cmake"
DESTINATION "${CMAKECONFIGSUBDIR}"
RENAME "${PROJECT_VARIANT_LOWER}-config-version.cmake")
# Make information about the cmake targets (the library and the tools)
# available.
install(EXPORT targets
NAMESPACE ${PROJECT_NAME}::
FILE ${PROJECT_NAME_LOWER}-targets.cmake
DESTINATION "${CMAKECONFIGSUBDIR}")
if (INSTALL_LEGACY_CMAKE_FILES)
install(EXPORT targets
NAMESPACE ${PROJECT_LEGACY_NAME}::
FILE ${PROJECT_LEGACY_LOWER}-targets.cmake
DESTINATION "${CMAKECONFIGSUBDIR}")
endif()
endforeach ()
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
configure_file(project-config.cmake.in project-config.cmake @ONLY)
configure_file(project-config-version.cmake.in
project-config-version.cmake @ONLY)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/project-config.cmake"
DESTINATION "${CMAKECONFIGDIR}"
RENAME "${PROJECT_NAME_LOWER}-config.cmake")
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/project-config-version.cmake"
DESTINATION "${CMAKECONFIGDIR}"
RENAME "${PROJECT_NAME_LOWER}-config-version.cmake")
# Make information about the cmake targets (the library and the tools)
# available.
install(EXPORT targets
FILE ${PROJECT_NAME_LOWER}-targets.cmake
DESTINATION "${CMAKECONFIGDIR}")
install(EXPORT targets
NAMESPACE ${PROJECT_NAME}::
FILE ${PROJECT_NAME_LOWER}-namespace-targets.cmake
DESTINATION "${CMAKECONFIGDIR}")
-63
View File
@@ -1,63 +0,0 @@
#
# CMake module to support ccache (or clcache for MSVC)
#
# Copyright (c) 2021, Mike Taves <mwtoews at gmail dot com>
#
# Usage:
# Add "include(Ccache)" to CMakeLists.txt and enable
# using the option -D USE_CCACHE=ON
option(USE_CCACHE
"Use ccache (or clcache for MSVC) to compile C/C++ objects" OFF)
if(NOT USE_CCACHE)
# stop here and return to including file
return()
endif()
# Search priority:
# 1. ccache for many compilers except MSVC
# 2. clcache for MSVC
find_program(CCACHE_PROGRAM NAMES ccache clcache)
if(CCACHE_PROGRAM)
message(STATUS "Configuring ccache with ${CCACHE_PROGRAM}")
if(CMAKE_GENERATOR STREQUAL "Xcode")
# see https://crascit.com/2016/04/09/using-ccache-with-cmake/
set(C_LAUNCHER "${CCACHE_PROGRAM}")
set(CXX_LAUNCHER "${CCACHE_PROGRAM}")
set(CCACHE_LAUNCH_C ${CMAKE_BINARY_DIR}/ccache-c)
set(CCACHE_LAUNCH_CXX ${CMAKE_BINARY_DIR}/ccache-cxx)
file(WRITE "${CCACHE_LAUNCH_C}" "\
#!/bin/sh
shift
exec \"${C_LAUNCHER}\" \"${CMAKE_C_COMPILER}\" \"$@\"
")
file(WRITE "${CCACHE_LAUNCH_CXX}" "\
#!/bin/sh
shift
exec \"${CXX_LAUNCHER}\" \"${CMAKE_CXX_COMPILER}\" \"$@\"
")
# Do equivalent of chmod a+rx
file(CHMOD "${CCACHE_LAUNCH_C}" "${CCACHE_LAUNCH_CXX}"
FILE_PERMISSIONS
OWNER_WRITE OWNER_READ OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
# Set Xcode project attributes to route compilation and linking
# through the wrapper scripts
set(CMAKE_XCODE_ATTRIBUTE_CC "${CCACHE_LAUNCH_C}")
set(CMAKE_XCODE_ATTRIBUTE_CXX "${CCACHE_LAUNCH_CXX}")
set(CMAKE_XCODE_ATTRIBUTE_LD "${CCACHE_LAUNCH_C}")
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CCACHE_LAUNCH_CXX}")
else()
# Most other generators (Unix Makefiles, Ninja, etc.)
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
endif()
else()
message(WARNING "Ccache was requested, but no program was not found")
endif()
-99
View File
@@ -1,99 +0,0 @@
# Derived from https://gitlab.com/jhamberg/cmake-examples/-/blob/master/cmake/FileEmbed.cmake
# MIT licensed
# Copyright (c) 2022 Jonathan Hamberg
function(FileEmbedSetup)
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/file_embed)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}file_embed)
endif ()
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/file_embed/file_embed_empty.c)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file_embed/file_embed_empty.c "")
endif ()
add_library(file_embed ${CMAKE_CURRENT_BINARY_DIR}/file_embed/file_embed_empty.c)
target_include_directories(file_embed PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/file_embed)
endfunction()
function(FileEmbedAdd file)
FileEmbedGenerate(${file} var)
target_sources(file_embed PUBLIC ${var})
add_custom_command(
OUTPUT ${var}
COMMAND ${CMAKE_COMMAND}
-DRUN_FILE_EMBED_GENERATE=1
"-DFILE_EMBED_GENERATE_PATH=${file}"
-P ${PROJECT_SOURCE_DIR}/cmake/FileEmbed.cmake
MAIN_DEPENDENCY ${file}
)
endfunction()
function(FileEmbedGenerate file generated_c)
get_filename_component(base_filename ${file} NAME)
set(output_filename "${base_filename}.c")
string(MAKE_C_IDENTIFIER ${base_filename} c_name)
file(READ ${file} content HEX)
string(LENGTH "${content}" size)
math(EXPR size_mult_16 "${size} - (${size} % 16)")
string(SUBSTRING "${content}" 0 ${size_mult_16} content_mult_16)
string(REGEX REPLACE
"([A-Fa-f0-9][A-Fa-f0-9])\
([A-Fa-f0-9][A-Fa-f0-9])\
([A-Fa-f0-9][A-Fa-f0-9])\
([A-Fa-f0-9][A-Fa-f0-9])\
([A-Fa-f0-9][A-Fa-f0-9])\
([A-Fa-f0-9][A-Fa-f0-9])\
([A-Fa-f0-9][A-Fa-f0-9])\
([A-Fa-f0-9][A-Fa-f0-9])"
"0x\\1,0x\\2,0x\\3,0x\\4,0x\\5,0x\\6,0x\\7,0x\\8,\n" SEPARATED_HEX "${content_mult_16}")
set(SEPARATED_HEX_REMAINDER "")
if (NOT ${size_mult_16} EQUAL ${size})
string(SUBSTRING "${content}" ${size_mult_16} 16 content_remainder)
string(REGEX REPLACE "([A-Fa-f0-9][A-Fa-f0-9])" "0x\\1," SEPARATED_HEX_REMAINDER "${content_remainder}")
endif()
set(output_c "${SEPARATED_HEX}${SEPARATED_HEX_REMAINDER}")
set(output_c "
#include \"${c_name}.h\"
const uint8_t ${c_name}_data[] = {
${output_c}
}\;
const unsigned ${c_name}_size = sizeof(${c_name}_data)\;
")
set(output_h "
#ifndef ${c_name}_H
#define ${c_name}_H
#include <stdint.h>
extern const uint8_t ${c_name}_data[]\;
extern const unsigned ${c_name}_size\;
#endif // ${c_name}_H
")
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/file_embed)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}file_embed)
endif ()
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file_embed/${c_name}.c
${output_c})
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file_embed/${c_name}.h
${output_h})
set(${generated_c} ${CMAKE_CURRENT_BINARY_DIR}/file_embed/${c_name}.c PARENT_SCOPE)
endfunction()
if (RUN_FILE_EMBED_GENERATE)
FileEmbedGenerate(${FILE_EMBED_GENERATE_PATH} var)
endif ()
+80
View File
@@ -0,0 +1,80 @@
# Find Sqlite3
# ~~~~~~~~~~~~
# Copyright (c) 2007, Martin Dobias <wonder.sk at gmail.com>
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# CMake module to search for Sqlite3 library
#
# If it's found it sets SQLITE3_FOUND to TRUE
# and following variables are set:
# SQLITE3_INCLUDE_DIR
# SQLITE3_LIBRARY
# SQLITE3_VERSION
# find_path and find_library normally search standard locations
# before the specified paths. To search non-standard paths first,
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
# and then again with no specified paths to search the default
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
# searching for the same item do nothing.
# try to use framework on mac
# want clean framework path, not unix compatibility path
if(APPLE)
if(CMAKE_FIND_FRAMEWORK MATCHES "FIRST"
OR CMAKE_FRAMEWORK_PATH MATCHES "ONLY"
OR NOT CMAKE_FIND_FRAMEWORK)
set(CMAKE_FIND_FRAMEWORK_save ${CMAKE_FIND_FRAMEWORK} CACHE STRING "" FORCE)
set(CMAKE_FIND_FRAMEWORK "ONLY" CACHE STRING "" FORCE)
#find_path(SQLITE3_INCLUDE_DIR SQLite3/sqlite3.h)
find_library(SQLITE3_LIBRARY SQLite3)
if(SQLITE3_LIBRARY)
# find_path doesn't add "Headers" for a framework
set(SQLITE3_INCLUDE_DIR ${SQLITE3_LIBRARY}/Headers
CACHE PATH "Path to a file.")
endif()
set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_save} CACHE STRING "" FORCE)
endif()
endif()
find_path(SQLITE3_INCLUDE_DIR sqlite3.h
"$ENV{LIB_DIR}/include"
"$ENV{LIB_DIR}/include/sqlite"
"$ENV{INCLUDE}"
)
find_library(SQLITE3_LIBRARY NAMES sqlite3_i sqlite3 PATHS
"$ENV{LIB_DIR}/lib"
"$ENV{LIB}/lib"
)
if(SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
set(SQLITE3_FOUND TRUE)
endif()
# Extract version information from the header file
if(SQLITE3_INCLUDE_DIR)
file(STRINGS ${SQLITE3_INCLUDE_DIR}/sqlite3.h _ver_line
REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\""
LIMIT_COUNT 1)
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
SQLITE3_VERSION "${_ver_line}")
unset(_ver_line)
endif()
if(SQLITE3_FOUND)
if(NOT SQLITE3_FIND_QUIETLY)
message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARY}")
message(STATUS "Sqlite3 version: ${SQLITE3_VERSION}")
endif()
else()
if(SQLITE3_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Sqlite3")
endif()
endif()
+14
View File
@@ -0,0 +1,14 @@
EXTRA_DIST = CMakeLists.txt \
ProjInstallPath.cmake \
ProjUtilities.cmake \
proj_config.cmake.in \
ProjConfig.cmake \
ProjMac.cmake \
ProjTest.cmake \
ProjVersion.cmake \
policies.cmake \
proj_config.cmake.in \
project-config-version.cmake.in \
project-config.cmake.in \
FindSqlite3.cmake
+19 -57
View File
@@ -7,28 +7,40 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# https://www.boost.org/LICENSE_1_0.txt)
################################################################################
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CheckFunctionExists)
# check needed include file
check_include_files(dlfcn.h HAVE_DLFCN_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_include_files(jni.h HAVE_JNI_H)
check_include_files(memory.h HAVE_MEMORY_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(string.h HAVE_STRING_H)
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
check_function_exists(localeconv HAVE_LOCALECONV)
check_function_exists(strerror HAVE_STRERROR)
if(NOT WIN32)
check_library_exists(dl dladdr "" HAVE_LIBDL)
check_library_exists(m exp "" HAVE_LIBM)
endif()
# check libm need on unix
check_library_exists(m ceil "" HAVE_LIBM)
set(PACKAGE "proj")
set(PACKAGE_BUGREPORT "https://github.com/OSGeo/PROJ/issues")
set(PACKAGE_NAME "PROJ")
set(PACKAGE_STRING "PROJ ${${PROJECT_NAME}_VERSION}")
set(PACKAGE_STRING "PROJ ${${PROJECT_INTERN_NAME}_VERSION}")
set(PACKAGE_TARNAME "proj")
set(PACKAGE_URL "https://proj.org")
set(PACKAGE_VERSION "${${PROJECT_NAME}_VERSION}")
set(PACKAGE_VERSION "${${PROJECT_INTERN_NAME}_VERSION}")
# check if a second proj_config.h exists (created by ./configure)
# as this is within CMake's C_INCLUDES / CXX_INCLUDES
set(AUTOCONF_PROJ_CONFIG_H "${PROJ_SOURCE_DIR}/src/proj_config.h")
set(AUTOCONF_PROJ_CONFIG_H "${CMAKE_SOURCE_DIR}/src/proj_config.h")
if(EXISTS ${AUTOCONF_PROJ_CONFIG_H})
message(WARNING
"Autoconf's ${AUTOCONF_PROJ_CONFIG_H} may interfere with this "
@@ -36,54 +48,4 @@ if(EXISTS ${AUTOCONF_PROJ_CONFIG_H})
"before CMake's build.")
endif()
# Get the git hash to write it in the release message.
set(PROJ_GIT_HASH "")
if(DEFINED ENV{PROJ_GITHUB_SHA})
string(SUBSTRING "$ENV{PROJ_GITHUB_SHA}" 0 7 PROJ_GIT_HASH)
else()
find_package(Git QUIET)
if(Git_FOUND AND EXISTS "${PROJ_SOURCE_DIR}/.git")
# Get the short hash
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY "${PROJ_SOURCE_DIR}"
RESULT_VARIABLE GIT_REV_RESULT
OUTPUT_VARIABLE PROJ_GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if(GIT_REV_RESULT EQUAL 0)
# Check if the working directory is dirty
execute_process(
COMMAND ${GIT_EXECUTABLE} status --porcelain --untracked-files=no
WORKING_DIRECTORY "${PROJ_SOURCE_DIR}"
RESULT_VARIABLE GIT_STATUS_RESULT
OUTPUT_VARIABLE GIT_STATUS_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
# If the command succeeds and outputs anything, the tree is dirty
if(GIT_STATUS_RESULT EQUAL 0 AND NOT GIT_STATUS_OUTPUT STREQUAL "")
string(APPEND PROJ_GIT_HASH "*")
endif()
else()
set(PROJ_GIT_HASH "")
endif()
endif()
endif()
if(PROJ_GIT_HASH)
add_compile_definitions(PROJ_GIT_HASH=\"${PROJ_GIT_HASH}\")
endif()
message(VERBOSE "PROJ_GIT_HASH=\"${PROJ_GIT_HASH}\"")
# Tell CMake to re-configure if the Git HEAD or index changes
if(Git_FOUND AND EXISTS "${PROJ_SOURCE_DIR}/.git")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
"${PROJ_SOURCE_DIR}/.git/HEAD" # for the hash
"${PROJ_SOURCE_DIR}/.git/index" # for the *
)
endif()
configure_file(cmake/proj_config.cmake.in src/proj_config.h)
+56
View File
@@ -18,3 +18,59 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${DEFAULT_PROJ_ROOT_DIR}
CACHE PATH "Proj install prefix" FORCE)
endif()
#TODO
# for data install testing the PROJ_LIB envVar
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
if(UNIX)
include(GNUInstallDirs)
set(DEFAULT_BIN_SUBDIR ${CMAKE_INSTALL_BINDIR})
set(DEFAULT_LIB_SUBDIR ${CMAKE_INSTALL_LIBDIR})
set(DEFAULT_DATA_SUBDIR ${CMAKE_INSTALL_DATAROOTDIR}/proj)
set(DEFAULT_INCLUDE_SUBDIR ${CMAKE_INSTALL_INCLUDEDIR})
set(DEFAULT_DOC_SUBDIR ${CMAKE_INSTALL_DOCDIR})
set(DEFAULT_CMAKE_SUBDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
else()
# Common locations for Unix and Mac OS X
set(DEFAULT_BIN_SUBDIR bin)
set(DEFAULT_LIB_SUBDIR lib)
set(DEFAULT_DATA_SUBDIR share/proj)
set(DEFAULT_DOC_SUBDIR doc/proj)
set(DEFAULT_INCLUDE_SUBDIR include)
set(DEFAULT_DOC_SUBDIR share/doc/proj)
set(DEFAULT_CMAKE_SUBDIR lib/cmake/${PROJECT_NAME_LOWER})
endif()
# Locations are changeable by user to customize layout of PROJ installation
# (default values are platform-specific)
set(PROJ_BIN_SUBDIR ${DEFAULT_BIN_SUBDIR} CACHE STRING
"Subdirectory where executables will be installed")
set(PROJ_LIB_SUBDIR ${DEFAULT_LIB_SUBDIR} CACHE STRING
"Subdirectory where libraries will be installed")
set(PROJ_INCLUDE_SUBDIR ${DEFAULT_INCLUDE_SUBDIR} CACHE STRING
"Subdirectory where header files will be installed")
set(PROJ_DATA_SUBDIR ${DEFAULT_DATA_SUBDIR} CACHE STRING
"Subdirectory where data will be installed")
set(PROJ_DOC_SUBDIR ${DEFAULT_DOC_SUBDIR} CACHE STRING
"Subdirectory where doc will be installed")
set(PROJ_CMAKE_SUBDIR ${DEFAULT_CMAKE_SUBDIR} CACHE STRING
"Subdirectory where cmake proj-config file will be installed")
# Mark *DIR variables as advanced and dedicated to use by power-users only.
mark_as_advanced(
PROJ_ROOT_DIR
PROJ_BIN_SUBDIR
PROJ_LIB_SUBDIR
PROJ_INCLUDE_SUBDIR
PROJ_DATA_SUBDIR
PROJ_DOC_SUBDIR
PROJ_CMAKE_SUBDIR
)
set(DEFAULT_BINDIR "${PROJ_BIN_SUBDIR}")
set(DEFAULT_LIBDIR "${PROJ_LIB_SUBDIR}")
set(DEFAULT_DATADIR "${PROJ_DATA_SUBDIR}")
set(DEFAULT_DOCDIR "${PROJ_DOC_SUBDIR}")
set(DEFAULT_INCLUDEDIR "${PROJ_INCLUDE_SUBDIR}")
set(DEFAULT_CMAKEDIR "${PROJ_CMAKE_SUBDIR}")
+4 -6
View File
@@ -22,10 +22,8 @@ if(APPLE)
option(BUILD_FRAMEWORKS_AND_BUNDLE
"if set to ON, build a library framework and application bundle, \
otherwise install classical UNIX bin/lib" OFF)
if(BUILD_FRAMEWORKS_AND_BUNDLE)
set(CMAKE_INSTALL_BINDIR ${BUNDLEDIR})
endif()
print_variable(BUNDLEDIR)
print_variable(PROJ_INSTALL_NAME_DIR)
print_variable(FRAMEWORKDIR)
set(DEFAULT_BINDIR ${BUNDLEDIR})
boost_report_value(BUNDLEDIR)
boost_report_value(PROJ_INSTALL_NAME_DIR)
boost_report_value(FRAMEWORKDIR)
endif()
+33 -56
View File
@@ -1,73 +1,50 @@
#
# Add command-line interface tests
# add test with sh script
#
function(proj_test_set_properties TESTNAME)
set(_env "PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES"
"PROJ_DATA=${PROJ_BINARY_DIR}/data/for_tests")
if(TIFF_ENABLED)
set(_env ${_env} "TIFF_ENABLED=YES")
else()
set(_env ${_env} "TIFF_ENABLED=NO")
function(proj_add_test_script_sh SH_NAME BIN_USE)
if(UNIX)
get_filename_component(testname ${SH_NAME} NAME_WE)
set(TEST_OK 1)
if(ARGV2)
set(TEST_OK 0)
set(GRID_FULLNAME ${PROJECT_SOURCE_DIR}/data/${ARGV2})
if(EXISTS ${GRID_FULLNAME})
set(TEST_OK 1)
endif()
endif()
if(CMAKE_VERSION VERSION_LESS 2.8.4)
set(TEST_OK 0)
message(STATUS "test with bash script need a cmake version >= 2.8.4")
endif()
if(${TEST_OK})
add_test(NAME "${testname}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/data
COMMAND bash ${PROJECT_SOURCE_DIR}/test/cli/${SH_NAME}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${${BIN_USE}}
)
set_tests_properties( ${testname}
PROPERTIES ENVIRONMENT "PROJ_LIB=${PROJECT_BINARY_DIR}/data")
endif()
endif()
set_property(TEST ${TESTNAME}
PROPERTY ENVIRONMENT ${_env})
endfunction()
function(proj_add_test_script_sh SH_NAME EXE_PATH)
set(testname ${SH_NAME})
add_test(NAME ${testname}
WORKING_DIRECTORY ${PROJ_BINARY_DIR}/test/cli
COMMAND bash ${PROJ_SOURCE_DIR}/test/cli/${SH_NAME} "${${EXE_PATH}}"
)
proj_test_set_properties(${testname})
endfunction()
function(proj_run_cli_test TESTFILE EXE_PATH)
set(testname ${TESTFILE})
add_test(NAME ${testname}
WORKING_DIRECTORY ${PROJ_BINARY_DIR}/test/cli
COMMAND ${Python_EXECUTABLE}
${PROJ_SOURCE_DIR}/test/cli/run_cli_test.py
--exe "${${EXE_PATH}}"
${PROJ_SOURCE_DIR}/test/cli/${TESTFILE}
)
proj_test_set_properties(${testname})
endfunction()
function(proj_add_gie_test TESTNAME TESTCASE)
set(GIE_BIN $<TARGET_FILE_NAME:gie>)
set(TESTFILE ${PROJ_SOURCE_DIR}/test/${TESTCASE})
set(TESTFILE ${CMAKE_SOURCE_DIR}/test/${TESTCASE})
add_test(NAME ${TESTNAME}
WORKING_DIRECTORY ${PROJ_SOURCE_DIR}/test
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${GIE_BIN}
${TESTFILE}
)
proj_test_set_properties(${TESTNAME})
set_tests_properties( ${TESTNAME}
PROPERTIES ENVIRONMENT "PROJ_LIB=${PROJECT_BINARY_DIR}/data")
endfunction()
# Create user writable directory for tests
add_custom_target(create_tmp_user_writable_dir ALL
COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJ_BINARY_DIR}/tmp_user_writable_dir
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJ_BINARY_DIR}/tmp_user_writable_dir)
function(proj_add_gie_network_dependent_test TESTNAME TESTCASE)
set(GIE_BIN $<TARGET_FILE_NAME:gie>)
set(TESTFILE ${PROJ_SOURCE_DIR}/test/${TESTCASE})
add_test(NAME ${TESTNAME}
WORKING_DIRECTORY ${PROJ_SOURCE_DIR}/test
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${GIE_BIN}
${TESTFILE}
)
set_property(TEST ${TESTNAME}
PROPERTY ENVIRONMENT
"PROJ_USER_WRITABLE_DIRECTORY=${PROJ_BINARY_DIR}/tmp_user_writable_dir"
"PROJ_NETWORK=ON"
"PROJ_DATA=${PROJ_BINARY_DIR}/data/for_tests")
endfunction()
+81 -65
View File
@@ -13,88 +13,104 @@
################################################################################
# Macros in this module:
#
# print_variable
# proj_target_output_name
# configure_proj_pc
# proj_target_output_name:
#
################################################################################
#
# A big shout out to the cmake gurus @ compiz
#
function(colormsg)
string(ASCII 27 _escape)
set(WHITE "29")
set(GRAY "30")
set(RED "31")
set(GREEN "32")
set(YELLOW "33")
set(BLUE "34")
set(MAG "35")
set(CYAN "36")
foreach(color WHITE GRAY RED GREEN YELLOW BLUE MAG CYAN)
set(HI${color} "1\;${${color}}")
set(LO${color} "2\;${${color}}")
set(_${color}_ "4\;${${color}}")
set(_HI${color}_ "1\;4\;${${color}}")
set(_LO${color}_ "2\;4\;${${color}}")
endforeach()
set(str "")
set(coloron FALSE)
foreach(arg ${ARGV})
if(NOT ${${arg}} STREQUAL "")
if(CMAKE_COLOR_MAKEFILE)
set(str "${str}${_escape}[${${arg}}m")
set(coloron TRUE)
endif()
else()
set(str "${str}${arg}")
if(coloron)
set(str "${str}${_escape}[0m")
set(coloron FALSE)
endif()
set(str "${str} ")
endif()
endforeach()
message(STATUS ${str})
endfunction()
# colormsg("Colors:"
# WHITE "white" GRAY "gray" GREEN "green"
# RED "red" YELLOW "yellow" BLUE "blue" MAG "mag" CYAN "cyan"
# _WHITE_ "white" _GRAY_ "gray" _GREEN_ "green"
# _RED_ "red" _YELLOW_ "yellow" _BLUE_ "blue" _MAG_ "mag" _CYAN_ "cyan"
# _HIWHITE_ "white" _HIGRAY_ "gray" _HIGREEN_ "green"
# _HIRED_ "red" _HIYELLOW_ "yellow" _HIBLUE_ "blue" _HIMAG_ "mag"
# _HICYAN_ "cyan" HIWHITE "white" HIGRAY "gray" HIGREEN "green"
# HIRED "red" HIYELLOW "yellow" HIBLUE "blue" HIMAG "mag" HICYAN "cyan"
# "right?")
#
# pretty-prints the value of a variable so that the
# equals signs align
#
function(print_variable NAME)
function(boost_report_value NAME)
string(LENGTH "${NAME}" varlen)
math(EXPR padding_len 30-${varlen})
if(${padding_len} GREATER 0)
string(SUBSTRING " "
0 ${padding_len} varpadding)
endif()
message(STATUS "${NAME}${varpadding} = ${${NAME}}")
# LOG
#message(STATUS "boost_report_value: NAME=${NAME} (${varlen})")
#message(STATUS "boost_report_value: \${NAME}=${${NAME}}")
math(EXPR padding_len 40-${varlen})
string(SUBSTRING " "
0 ${padding_len} varpadding)
colormsg("${NAME}${varpadding} = ${${NAME}}")
endfunction()
#
# Configure a pkg-config file proj.pc
# See also ProjInstallPath.cmake
# Generates output name for given target depending on platform and version.
# For instance, on Windows, dynamic link libraries get ABI version suffix
# proj_X_Y.dll.
#
function(set_variable_from_rel_or_absolute_path var root rel_or_abs_path)
if(IS_ABSOLUTE "${rel_or_abs_path}")
set(${var} "${rel_or_abs_path}" PARENT_SCOPE)
else()
set(${var} "${root}/${rel_or_abs_path}" PARENT_SCOPE)
function(proj_target_output_name TARGET_NAME OUTPUT_NAME)
if(NOT DEFINED TARGET_NAME)
message(SEND_ERROR "Error, the variable TARGET_NAME is not defined!")
endif()
endfunction()
function(configure_proj_pc)
set(prefix ${CMAKE_INSTALL_PREFIX})
set_variable_from_rel_or_absolute_path("libdir" "$\{prefix\}" "${CMAKE_INSTALL_LIBDIR}")
set_variable_from_rel_or_absolute_path("includedir" "$\{prefix\}" "${CMAKE_INSTALL_INCLUDEDIR}")
set_variable_from_rel_or_absolute_path("datarootdir" "$\{prefix\}" "${CMAKE_INSTALL_DATAROOTDIR}")
set(datadir "$\{datarootdir\}")
set(PACKAGE "proj")
set(VERSION ${PROJ_VERSION})
# Build strings of dependencies (Libs.private, Requires.private)
set(EXTRA_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(EXTRA_REQUIRES "")
option(USE_PKGCONFIG_REQUIRES "Use 'Requires' instead 'Libs' in proj.pc" ON)
macro(add_module_or_libs MODULE)
if(USE_PKGCONFIG_REQUIRES)
list(APPEND EXTRA_REQUIRES "${MODULE}")
else()
list(APPEND EXTRA_LIBS "${ARGN}")
if(NOT DEFINED ${PROJECT_INTERN_NAME}_VERSION)
message(SEND_ERROR
"Error, the variable ${${PROJECT_INTERN_NAME}_VERSION} is not defined!")
endif()
# On Windows, ABI version is specified using binary file name suffix.
# On Unix, suffix is empty and SOVERSION is used instead.
if(WIN32)
string(LENGTH "${${PROJECT_INTERN_NAME}_ABI_VERSION}" abilen)
if(abilen GREATER 0)
set(SUFFIX "_${${PROJECT_INTERN_NAME}_ABI_VERSION}")
endif()
endmacro()
add_module_or_libs(sqlite3 -lsqlite3)
if(TIFF_ENABLED)
add_module_or_libs(libtiff-4 -ltiff)
endif()
if(CURL_ENABLED)
add_module_or_libs(libcurl -lcurl)
endif()
if(WIN32 AND NOT MINGW)
list(APPEND EXTRA_LIBS -lole32 -lshell32)
else()
set(cxx_libs "${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}")
list(REMOVE_ITEM cxx_libs ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} nonempty)
foreach(lib IN LISTS cxx_libs)
list(APPEND EXTRA_LIBS "-l${lib}")
endforeach()
endif()
if(HAVE_LIBM AND NOT "-lm" IN_LIST EXTRA_LIBS)
list(APPEND EXTRA_LIBS -lm)
endif()
if(HAVE_LIBDL)
list(APPEND EXTRA_LIBS -ldl)
endif()
# Join lists with a space
list(JOIN EXTRA_LIBS " " EXTRA_LIBS)
list(JOIN EXTRA_REQUIRES " " EXTRA_REQUIRES)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/proj.pc.in
${CMAKE_CURRENT_BINARY_DIR}/proj.pc
@ONLY)
set(${OUTPUT_NAME} ${TARGET_NAME}${SUFFIX} PARENT_SCOPE)
endfunction()
+20 -8
View File
@@ -27,15 +27,27 @@ macro(proj_version)
${ARGN})
# Set version components
set(${PROJECT_NAME}_VERSION_MAJOR ${THIS_VERSION_MAJOR})
set(${PROJECT_NAME}_VERSION_MINOR ${THIS_VERSION_MINOR})
set(${PROJECT_NAME}_VERSION_PATCH ${THIS_VERSION_PATCH})
set(${PROJECT_INTERN_NAME}_VERSION_MAJOR ${THIS_VERSION_MAJOR})
set(${PROJECT_INTERN_NAME}_VERSION_MINOR ${THIS_VERSION_MINOR})
set(${PROJECT_INTERN_NAME}_VERSION_PATCH ${THIS_VERSION_PATCH})
# Set VERSION string
set(${PROJECT_NAME}_VERSION
"${${PROJECT_NAME}_VERSION_MAJOR}.\
${${PROJECT_NAME}_VERSION_MINOR}.\
${${PROJECT_NAME}_VERSION_PATCH}")
set(${PROJECT_INTERN_NAME}_VERSION
"${${PROJECT_INTERN_NAME}_VERSION_MAJOR}.\
${${PROJECT_INTERN_NAME}_VERSION_MINOR}.\
${${PROJECT_INTERN_NAME}_VERSION_PATCH}")
print_variable(${PROJECT_NAME}_VERSION)
# Set ABI version string used to name binary output
# On Windows, ABI version is specified using binary file name suffix.
if(WIN32)
set(${PROJECT_INTERN_NAME}_ABI_VERSION
"${${PROJECT_INTERN_NAME}_VERSION_MAJOR}_\
${${PROJECT_INTERN_NAME}_VERSION_MINOR}")
endif()
message(STATUS "")
boost_report_value(${PROJECT_INTERN_NAME}_VERSION)
if(WIN32)
boost_report_value(${PROJECT_INTERN_NAME}_ABI_VERSION)
endif()
endmacro()
+41 -2
View File
@@ -1,12 +1,48 @@
/* Define to 1 if you have the `dl' library (-ldl). */
#cmakedefine HAVE_LIBDL 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1
/* Define to 1 if you have the <jni.h> header file. */
#cmakedefine HAVE_JNI_H 1
/* Define to 1 if you have the `m' library (-lm). */
#cmakedefine HAVE_LIBM 1
/* Define to 1 if you have localeconv */
#cmakedefine HAVE_LOCALECONV 1
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H 1
/* Define to 1 if you have the `strerror' function. */
#cmakedefine HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
/* Enabled for Java/JNI Support */
#cmakedefine JNI_ENABLED 1
/* Name of package */
#cmakedefine PACKAGE "${PACKAGE}"
@@ -25,5 +61,8 @@
/* Define to the version of this package. */
#cmakedefine PACKAGE_VERSION "${PACKAGE_VERSION}"
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine STDC_HEADERS 1
/* Version number of package */
#cmakedefine VERSION "${VERSION}"
+22 -5
View File
@@ -1,4 +1,4 @@
# Version checking for @PROJECT_VARIANT_NAME@
# Version checking for @PROJECT_NAME@
set (PACKAGE_VERSION "@PROJ_VERSION@")
set (PACKAGE_VERSION_MAJOR "@PROJ_VERSION_MAJOR@")
@@ -14,19 +14,26 @@ if (MSVC)
# digit.
math (EXPR MSVC_TOOLSET_MAJOR "${MSVC_TOOLSET_VERSION}/10")
endif ()
if (CMAKE_CROSSCOMPILING)
# Ensure that all "true" (resp. "false") settings are represented by
# the same string.
set (CMAKE_CROSSCOMPILING_STR "ON")
else ()
set (CMAKE_CROSSCOMPILING_STR "OFF")
endif ()
if (NOT PACKAGE_FIND_NAME STREQUAL "@PROJECT_VARIANT_NAME@")
if (NOT PACKAGE_FIND_NAME STREQUAL "@PROJECT_NAME@")
# Check package name (in particular, because of the way cmake finds
# package config files, the capitalization could easily be "wrong").
# This is necessary to ensure that the automatically generated
# variables, e.g., <package>_FOUND, are consistently spelled.
set (REASON "package = @PROJECT_VARIANT_NAME@, NOT ${PACKAGE_FIND_NAME}")
set (REASON "package = @PROJECT_NAME@, NOT ${PACKAGE_FIND_NAME}")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (NOT (APPLE OR (NOT DEFINED CMAKE_SIZEOF_VOID_P) OR
CMAKE_SIZEOF_VOID_P EQUAL "@CMAKE_SIZEOF_VOID_P@"))
CMAKE_SIZEOF_VOID_P EQUAL @CMAKE_SIZEOF_VOID_P@))
# Reject if there's a 32-bit/64-bit mismatch (not necessary with Apple
# since a multi-architecture library is built for that platform).
set (REASON "sizeof(*void) = @CMAKE_SIZEOF_VOID_P@")
set (REASON "sizeof(*void) = @CMAKE_SIZEOF_VOID_P@")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (MSVC AND NOT (
# toolset version must be at least as great as @PROJECT_NAME@'s
@@ -36,6 +43,16 @@ elseif (MSVC AND NOT (
# Reject if there's a mismatch in MSVC compiler versions
set (REASON "MSVC_TOOLSET_VERSION = @MSVC_TOOLSET_VERSION@")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (NOT CMAKE_CROSSCOMPILING_STR STREQUAL "@CMAKE_CROSSCOMPILING_STR@")
# Reject if there's a mismatch in ${CMAKE_CROSSCOMPILING}
set (REASON "cross-compiling = @CMAKE_CROSSCOMPILING@")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (CMAKE_CROSSCOMPILING AND
NOT (CMAKE_SYSTEM_NAME STREQUAL "@CMAKE_SYSTEM_NAME@" AND
CMAKE_SYSTEM_PROCESSOR STREQUAL "@CMAKE_SYSTEM_PROCESSOR@"))
# Reject if cross-compiling and there's a mismatch in the target system
set (REASON "target = @CMAKE_SYSTEM_NAME@-@CMAKE_SYSTEM_PROCESSOR@")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (PACKAGE_FIND_VERSION)
if (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
set (PACKAGE_VERSION_EXACT TRUE)
+17 -56
View File
@@ -1,71 +1,32 @@
# Configure @PROJECT_NAME@
#
# Set
# @PROJECT_VARIANT_NAME@_FOUND = 1
# @PROJECT_VARIANT_NAME@_INCLUDE_DIRS = /usr/local/include
# @PROJECT_VARIANT_NAME@_LIBRARIES = @PROJECT_VARIANT_NAME@::proj
# @PROJECT_VARIANT_NAME@_LIBRARY_DIRS = /usr/local/lib
# @PROJECT_VARIANT_NAME@_BINARY_DIRS = /usr/local/bin
# @PROJECT_VARIANT_NAME@_VERSION = 4.9.1 (for example)
if(@PROJECT_VARIANT_NAME@ STREQUAL "PROJ4")
message(DEPRECATION "find_package(PROJ4) is deprecated and will be retired soon. Please use find_package(PROJ) instead.")
endif()
# @PROJECT_NAME@_FOUND = 1
# @PROJECT_NAME@_INCLUDE_DIRS = /usr/local/include
# @PROJECT_NAME@_LIBRARIES = proj
# @PROJECT_NAME@_LIBRARY_DIRS = /usr/local/lib
# @PROJECT_NAME@_BINARY_DIRS = /usr/local/bin
# @PROJECT_NAME@_VERSION = 4.9.1 (for example)
include(CMakeFindDependencyMacro)
# We cannot have a find_dependency() call between cmake_policy(PUSH)/cmake_policy(POP)
# because find_dependency() issues a return() on failure, which results in
# imbalanced push/pop
# Cf https://gitlab.kitware.com/cmake/cmake/-/issues/17612
cmake_policy(PUSH)
cmake_policy(SET CMP0012 NEW)
if("@ENABLE_TIFF@")
set(PROJ_CONFIG_FIND_TIFF_DEP ON)
endif()
if("@CURL_ENABLED@")
set(PROJ_CONFIG_FIND_CURL_DEP ON)
endif()
cmake_policy(POP)
find_dependency(SQLite3)
if(DEFINED PROJ_CONFIG_FIND_TIFF_DEP)
find_dependency(TIFF)
endif()
if(DEFINED PROJ_CONFIG_FIND_CURL_DEP)
# Chainload CURL usage requirements
find_dependency(CURL)
endif()
function(set_variable_from_rel_or_absolute_path var root rel_or_abs_path)
if(IS_ABSOLUTE "${rel_or_abs_path}")
set(${var} "${rel_or_abs_path}" PARENT_SCOPE)
else()
set(${var} "${root}/${rel_or_abs_path}" PARENT_SCOPE)
endif()
endfunction()
message (STATUS "Reading ${CMAKE_CURRENT_LIST_FILE}")
# @PROJECT_NAME@_VERSION is set by version file
message (STATUS
"@PROJECT_NAME@ configuration, version ${@PROJECT_NAME@_VERSION}")
# Tell the user project where to find our headers and libraries
get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
get_filename_component (_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE)
# Use _ROOT as prefix here for the possibility of relocation after installation.
set_variable_from_rel_or_absolute_path("@PROJECT_VARIANT_NAME@_INCLUDE_DIRS" "${_ROOT}" "@CMAKE_INSTALL_INCLUDEDIR@")
set_variable_from_rel_or_absolute_path("@PROJECT_VARIANT_NAME@_LIBRARY_DIRS" "${_ROOT}" "@CMAKE_INSTALL_LIBDIR@")
set_variable_from_rel_or_absolute_path("@PROJECT_VARIANT_NAME@_BINARY_DIRS" "${_ROOT}" "@CMAKE_INSTALL_BINDIR@")
set (@PROJECT_NAME@_INCLUDE_DIRS "${_ROOT}/@INCLUDEDIR@")
set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/@LIBDIR@")
set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/@BINDIR@")
set (@PROJECT_VARIANT_NAME@_LIBRARIES @PROJECT_VARIANT_NAME@::proj)
set (@PROJECT_NAME@_LIBRARIES @PROJECT_NAME@::proj)
# Read in the exported definition of the library
include ("${_DIR}/@PROJECT_NAME_LOWER@-targets.cmake")
if (@INSTALL_LEGACY_CMAKE_FILES@)
include ("${_DIR}/@PROJECT_LEGACY_LOWER@-targets.cmake")
endif()
include ("${_DIR}/@PROJECT_NAME_LOWER@-namespace-targets.cmake")
unset (_ROOT)
unset (_DIR)
if ("@PROJECT_VARIANT_NAME@" STREQUAL "PROJ4")
# For backward compatibility with old releases of libgeotiff
set (@PROJECT_VARIANT_NAME@_INCLUDE_DIR
${@PROJECT_VARIANT_NAME@_INCLUDE_DIRS})
endif ()
# For backward compatibility with old releases of libgeotiff
set (@PROJECT_NAME@_INCLUDE_DIR ${@PROJECT_NAME@_INCLUDE_DIRS})
-65
View File
@@ -1,65 +0,0 @@
# install_manifest.txt is created in the top build tree, not the project one
if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"")
endif()
set(uninstall_file_list "@CMAKE_BINARY_DIR@/install_manifest.txt")
if(EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest_extra.txt")
list(APPEND uninstall_file_list "@CMAKE_CURRENT_BINARY_DIR@/install_manifest_extra.txt")
endif()
set(dir_list)
foreach (manifest_file IN ITEMS ${uninstall_file_list})
file(READ "${manifest_file}" files)
string(REGEX REPLACE "\n$" "" files "${files}")
string(REGEX REPLACE "\n" ";" files "${files}")
list(REVERSE files)
foreach (file ${files})
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
if (IS_DIRECTORY "$ENV{DESTDIR}${file}")
list(APPEND dir_list "${file}")
elseif (EXISTS "$ENV{DESTDIR}${file}")
get_filename_component(dir "${file}" DIRECTORY)
list(APPEND dir_list "${dir}")
execute_process(
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
if(NOT ${rm_retval} EQUAL 0)
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
endif (NOT ${rm_retval} EQUAL 0)
else ()
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
endif ()
endforeach(file)
endforeach()
while(NOT "${dir_list}" STREQUAL "")
list(REMOVE_DUPLICATES dir_list)
set(new_dir_list)
foreach (file IN ITEMS ${dir_list})
if (IS_DIRECTORY "$ENV{DESTDIR}${file}" AND "${file}" MATCHES "@CMAKE_INSTALL_PREFIX@[/\\].+")
file(GLOB file_list "$ENV{DESTDIR}${file}/*")
list(LENGTH file_list file_list_len)
# Only remove empty directories
if(file_list_len EQUAL 0)
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
execute_process(
COMMAND @CMAKE_COMMAND@ -E remove_directory "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
if(${rm_retval} EQUAL 0)
get_filename_component(upper_dir "${file}" DIRECTORY)
list(APPEND new_dir_list "${upper_dir}")
else()
message(STATUS "Problem when removing directory \"$ENV{DESTDIR}${file}\"")
endif()
endif()
endif()
endforeach()
set(dir_list "${new_dir_list}")
endwhile()
+336
View File
@@ -0,0 +1,336 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([PROJ], [6.3.1],
[https://github.com/OSGeo/PROJ/issues], proj, [https://proj.org])
AC_CONFIG_MACRO_DIR([m4])
AC_LANG(C)
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([subdir-objects])
AM_CONFIG_HEADER(src/proj_config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AM_PROG_LIBTOOL
dnl Enable as much warnings as possible
AX_CFLAGS_WARN_ALL(C_WFLAGS)
AX_CXXFLAGS_WARN_ALL(CXX_WFLAGS)
dnl For ICC: it needs -we10006 instead of -Werror to turn unknown options to errors
dnl Some gcc/clang versions might succeed on this test, so also include -Werror in ERROR_ON_UNKNOWN_OPTIONS
AX_CHECK_COMPILE_FLAG([-Werror -we10006],[ERROR_ON_UNKNOWN_OPTIONS="-Werror -we10006"],[ERROR_ON_UNKNOWN_OPTIONS="-Werror"])
dnl A few ICC warnings to turn off
dnl warning #188: enumerated type mixed with another type (needed on libcsf)
dnl warning #1684: conversion from pointer to same-sized integral type (potential portability problem) (needed on frmts/mrf)
dnl warning #2259: non-pointer conversion from "size_t={unsigned long}" to "int" may lose significant bits
dnl warning #2304: non-explicit constructor with single argument may cause implicit type conversion
dnl warning #3280: declaration hides member
dnl remark #11074: Inlining inhibited by limit max-size
dnl remark #11076: To get full report use -qopt-report=4 -qopt-report-phase ipo
AX_CHECK_COMPILE_FLAG([-diag-disable 188,1684,2259,2304,3280,11074,11076],[C_WFLAGS="$C_WFLAGS -diag-disable 188,1684,2259,2304,3280,11074,11076" CXX_WFLAGS="$CXX_WFLAGS -diag-disable 188,1684,2259,2304,3280,11074,11076"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wextra],[C_WFLAGS="$C_WFLAGS -Wextra" CXX_WFLAGS="$CXX_WFLAGS -Wextra"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Winit-self],[C_WFLAGS="$C_WFLAGS -Winit-self" CXX_WFLAGS="$CXX_WFLAGS -Winit-self"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [C_WFLAGS="$C_WFLAGS -Wunused-parameter" CXX_WFLAGS="$CXX_WFLAGS -Wunused-parameter" NO_UNUSED_PARAMETER_FLAG="-Wno-unused-parameter"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [C_WFLAGS="$C_WFLAGS -Wmissing-prototypes"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wmissing-declarations], [C_WFLAGS="$C_WFLAGS -Wmissing-declarations"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wformat], [C_WFLAGS="$C_WFLAGS -Wformat" CXX_WFLAGS="$CXX_WFLAGS -Wformat"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wformat -Werror=format-security -Wno-format-nonliteral], [C_WFLAGS="$C_WFLAGS -Werror=format-security -Wno-format-nonliteral" CXX_WFLAGS="$CXX_WFLAGS -Werror=format-security -Wno-format-nonliteral"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wshorten-64-to-32], [C_WFLAGS="$C_WFLAGS -Wshorten-64-to-32" CXX_WFLAGS="$CXX_WFLAGS -Wshorten-64-to-32"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wlogical-op], [C_WFLAGS="$C_WFLAGS -Wlogical-op" CXX_WFLAGS="$CXX_WFLAGS -Wlogical-op" NO_LOGICAL_OP_FLAG="-Wno-logical-op"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wshadow], [C_WFLAGS="$C_WFLAGS -Wshadow" CXX_WFLAGS="$CXX_WFLAGS -Wshadow"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl Error out on things that will fail with MSVC
AX_CHECK_COMPILE_FLAG([-Werror=vla], [C_WFLAGS="$C_WFLAGS -Werror=vla" CXX_WFLAGS="$CXX_WFLAGS -Werror=vla"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Werror=declaration-after-statement], [C_WFLAGS="$C_WFLAGS -Wdeclaration-after-statement"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl -Wclobbered is not reliable on most gcc versions
dnl AX_CHECK_COMPILE_FLAG([-Wno-clobbered], [C_WFLAGS="$C_WFLAGS -Wno-clobbered" CXX_WFLAGS="$CXX_WFLAGS -Wno-clobbered"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl Warn when macros __TIME__, __DATE__ or __TIMESTAMP__ are encountered as they might prevent bit-wise-identical reproducible compilations.
AX_CHECK_COMPILE_FLAG([-Wdate-time], [C_WFLAGS="$C_WFLAGS -Wdate-time" CXX_WFLAGS="$CXX_WFLAGS -Wdate-time"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl GCC 6 warnings
AX_CHECK_COMPILE_FLAG([-Wnull-dereference], [C_WFLAGS="$C_WFLAGS -Wnull-dereference" CXX_WFLAGS="$CXX_WFLAGS -Wnull-dereference"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], [C_WFLAGS="$C_WFLAGS -Wduplicated-cond" CXX_WFLAGS="$CXX_WFLAGS -Wduplicated-cond"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl GCC 7 warnings
dnl Do not enable yet. Causes warning in alg/gdalthinplate.cpp due to armadillo templates
dnl AX_CHECK_COMPILE_FLAG([-Wduplicated-branches], [C_WFLAGS="$C_WFLAGS -Wduplicated-branches" CXX_WFLAGS="$CXX_WFLAGS -Wduplicated-branches"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl GCC 8 warnings
AC_LANG_PUSH([C++])
AX_CHECK_COMPILE_FLAG([-Wextra-semi], [CXX_WFLAGS="$CXX_WFLAGS -Wextra-semi"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AC_LANG_POP([C++])
AX_CHECK_COMPILE_FLAG([-Wno-sign-compare], [NO_SIGN_COMPARE="-Wno-sign-compare"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl clang >= 3.9
AX_CHECK_COMPILE_FLAG([-Wcomma], [C_WFLAGS="$C_WFLAGS -Wcomma" CXX_WFLAGS="$CXX_WFLAGS -Wcomma"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl clang and gcc 5
AX_CHECK_COMPILE_FLAG([-Wfloat-conversion], [C_WFLAGS="$C_WFLAGS -Wfloat-conversion" CXX_WFLAGS="$CXX_WFLAGS -Wfloat-conversion"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl clang >= 3.2
AX_CHECK_COMPILE_FLAG([-Wdocumentation -Wno-documentation-deprecated-sync], [C_WFLAGS="$C_WFLAGS -Wdocumentation -Wno-documentation-deprecated-sync" CXX_WFLAGS="$CXX_WFLAGS -Wdocumentation -Wno-documentation-deprecated-sync"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl C++ specific stuff
AC_LANG_PUSH([C++])
AX_CHECK_COMPILE_FLAG([-Wunused-private-field], [CXX_WFLAGS="$CXX_WFLAGS -Wunused-private-field"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CXX_WFLAGS="$CXX_WFLAGS -Wmissing-prototypes"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wmissing-declarations], [CXX_WFLAGS="$CXX_WFLAGS -Wmissing-declarations"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wnon-virtual-dtor], [CXX_WFLAGS="$CXX_WFLAGS -Wnon-virtual-dtor" NO_NON_VIRTUAL_DTOR_FLAG="-Wno-non-virtual-dtor"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wold-style-cast], [WARN_OLD_STYLE_CAST="-Wold-style-cast"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Weffc++], [WARN_EFFCPLUSPLUS="-Weffc++"],,[$ERROR_ON_UNKNOWN_OPTIONS])
dnl g++-4.8 complain a bit too much with -Weffc++
if test "$WARN_EFFCPLUSPLUS" != ""; then
SAVED_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $WARN_EFFCPLUSPLUS -Werror"
AC_MSG_CHECKING([if -Weffc++ should be enabled])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
class Base {};
class A: public Base {};
]])],
[AC_MSG_RESULT([yes])],
[WARN_EFFCPLUSPLUS=""]
[AC_MSG_RESULT([no])])
CXXFLAGS="$SAVED_CXXFLAGS"
CXX_WFLAGS="$CXX_WFLAGS $WARN_EFFCPLUSPLUS"
fi
dnl Clang enables -Woverloaded-virtual if -Wall is defined, but not GCC
AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual], [CXX_WFLAGS="$CXX_WFLAGS -Woverloaded-virtual"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wweak-vtables], [CXX_WFLAGS="$CXX_WFLAGS -Wweak-vtables"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wdeprecated], [CXX_WFLAGS="$CXX_WFLAGS -Wdeprecated"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Wabstract-vbase-init], [CXX_WFLAGS="$CXX_WFLAGS -Wabstract-vbase-init"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AX_CHECK_COMPILE_FLAG([-Winconsistent-missing-destructor-override], [CXX_WFLAGS="$CXX_WFLAGS -Winconsistent-missing-destructor-override"],,[$ERROR_ON_UNKNOWN_OPTIONS])
HAVE_GCC_WARNING_ZERO_AS_NULL_POINTER_CONSTANT=no
AX_CHECK_COMPILE_FLAG([-Wzero-as-null-pointer-constant], [CXX_WFLAGS="$CXX_WFLAGS -Wzero-as-null-pointer-constant" HAVE_GCC_WARNING_ZERO_AS_NULL_POINTER_CONSTANT=yes NO_ZERO_AS_NULL_POINTER_CONSTANT_FLAG="-Wno-zero-as-null-pointer-constant"],,[$ERROR_ON_UNKNOWN_OPTIONS])
if test "$HAVE_GCC_WARNING_ZERO_AS_NULL_POINTER_CONSTANT" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_GCC_WARNING_ZERO_AS_NULL_POINTER_CONSTANT, 1,
[Define to 1 if the compiler supports -Wzero-as-null-pointer-constant])
fi
AC_LANG_POP([C++])
dnl ---------------------------------------------------------------------------
dnl Check for --enable-lto
dnl ---------------------------------------------------------------------------
AC_MSG_CHECKING([to enable LTO (link time optimization) build])
AC_ARG_ENABLE(lto,
AS_HELP_STRING([--enable-lto],
[enable LTO(link time optimization) (disabled by default)]))
FLTO_FLAG=""
if test "x$enable_lto" = "xyes"; then
AC_LANG_PUSH([C++])
AX_CHECK_COMPILE_FLAG([-flto], [FLTO_FLAG="-flto"],,[$ERROR_ON_UNKNOWN_OPTIONS])
if test "$FLTO_FLAG" != ""; then
SAVED_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $FLTO_FLAG -Werror"
AC_MSG_CHECKING([if -flto is available at link time])
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[]])],
[AC_MSG_RESULT([yes])],
[FLTO_FLAG=""]
[AC_MSG_RESULT([no])])
CXXFLAGS="$SAVED_CXXFLAGS"
fi
AC_LANG_POP([C++])
AX_CHECK_COMPILE_FLAG([-Wodr], [CXX_WFLAGS="$CXX_WFLAGS -Wodr"],,[$ERROR_ON_UNKNOWN_OPTIONS])
else
AC_MSG_RESULT([no])
fi
AC_SUBST(FLTO_FLAG,$FLTO_FLAG)
dnl Result in better inlining, but larger file
dnl AX_CHECK_COMPILE_FLAG([-fno-semantic-interposition], [CFLAGS="$CFLAGS -fno-semantic-interposition" CXXFLAGS="$CXXFLAGS -fno-semantic-interposition"],,[$ERROR_ON_UNKNOWN_OPTIONS])
AC_SUBST(C_WFLAGS,$C_WFLAGS)
AC_SUBST(CXX_WFLAGS,$CXX_WFLAGS)
AC_SUBST(NO_ZERO_AS_NULL_POINTER_CONSTANT_FLAG,$NO_ZERO_AS_NULL_POINTER_CONSTANT_FLAG)
CFLAGS="${CFLAGS} -fvisibility=hidden"
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
dnl Checks for libraries.
save_CFLAGS="$CFLAGS"
CFLAGS=`echo "$CFLAGS" | sed "s/-Werror/ /"`
AC_CHECK_LIB(m,exp,,,)
CFLAGS="$save_CFLAGS"
dnl We check for headers
AC_HEADER_STDC
dnl Check flag for accurate arithmetic with Intel compiler. This is
dnl needed to stop the compiler from ignoring parentheses in expressions
dnl like (a + b) + c and from simplifying 0.0 + x to x (which is wrong if
dnl x = -0.0).
AX_CHECK_COMPILE_FLAG([-fp-model precise],
[CFLAGS="$CFLAGS -fp-model precise"],,[-Werror])
AC_SEARCH_LIBS([sqrt], [m])
AC_CHECK_FUNC(localeconv, [AC_DEFINE(HAVE_LOCALECONV,1,[Define to 1 if you have localeconv])])
AC_CHECK_FUNCS([strerror])
dnl ---------------------------------------------------------------------------
dnl Check for JNI support.
dnl ---------------------------------------------------------------------------
JNI_INCLUDE=
export JNI_INCLUDE
AC_ARG_WITH(jni,
[AS_HELP_STRING([--with-jni=dir],
[Include Java/JNI support, add optional include dir])
],,)
if test "$with_jni" = "yes" ; then
AC_DEFINE(JNI_ENABLED,1,[Enabled for Java/JNI Support])
AC_MSG_CHECKING(whether to enable Java/JNI support)
AC_MSG_RESULT([enabled])
elif test "$with_jni" != "no" -a "$with_jni" != "" ; then
AC_MSG_CHECKING(whether to enable Java/JNI support)
if test \! -r "$with_jni/jni.h" ; then
AC_MSG_ERROR(Did not find $with_jni/jni.h)
fi
AC_DEFINE(JNI_ENABLED,1,[Enabled for Java/JNI Support])
AC_MSG_RESULT([enabled])
JNI_INCLUDE="-I$with_jni"
elif test "$with_jni" = "" ; then
AC_CHECK_HEADERS(jni.h)
AC_MSG_CHECKING(whether to enable Java/JNI support)
if test "$ac_cv_header_jni_h" = "no" ; then
AC_MSG_RESULT([disabled])
else
AC_MSG_RESULT([enabled])
AC_DEFINE(JNI_ENABLED,1,[Enabled for Java/JNI Support])
fi
else
AC_MSG_CHECKING(whether to enable Java/JNI support)
AC_MSG_RESULT([disabled])
fi
AC_SUBST(JNI_INCLUDE,$JNI_INCLUDE)
dnl ---------------------------------------------------------------------------
dnl Provide a mechanism to disable real mutex support (if lacking win32 or
dnl posix mutexes for instance).
dnl ---------------------------------------------------------------------------
AC_ARG_WITH([mutex],
AS_HELP_STRING([--without-mutex],
[Disable real mutex locks (lacking pthreads)]),,)
AC_MSG_CHECKING([for mutexes])
THREAD_LIB=""
if test "$with_mutex" = yes -o x"$with_mutex" = x ; then
MUTEX_SETTING=pthread
AC_CHECK_LIB(pthread,pthread_create,PTHREAD_EXISTS=YES,,,)
if test -n "$PTHREAD_EXISTS" ; then
THREAD_LIB="-lpthread"
fi
AC_CHECK_LIB(pthread,pthread_mutexattr_settype,,,)
AC_CHECK_DECL(PTHREAD_MUTEX_RECURSIVE,
AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE, [], [Define if your pthreads implementation have PTHREAD_MUTEX_RECURSIVE]),
,
[#include <pthread.h>])
AC_MSG_RESULT([enabled, pthread])
else
MUTEX_SETTING=stub
AC_MSG_RESULT([disabled by user])
fi
AC_SUBST(MUTEX_SETTING,$MUTEX_SETTING)
AC_SUBST(THREAD_LIB,$THREAD_LIB)
dnl ---------------------------------------------------------------------------
dnl Check for sqlite3 library and binary
dnl ---------------------------------------------------------------------------
if test "x$SQLITE3_CFLAGS$SQLITE3_LIBS" = "x" ; then
dnl Would build and run with older versons, but with horrible performance
dnl See https://github.com/OSGeo/PROJ/issues/1718
PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.11])
fi
AC_SUBST(SQLITE3_CFLAGS,$SQLITE3_CFLAGS)
AC_SUBST(SQLITE3_LIBS,$SQLITE3_LIBS)
AC_CHECK_PROG(SQLITE3_CHECK,sqlite3,yes)
if test x"$SQLITE3_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install sqlite3 binary.])
fi
dnl ---------------------------------------------------------------------------
dnl Check for external Google Test
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(external-gtest,
AS_HELP_STRING([--with-external-gtest],
[Whether to use external Google Test]),,)
if test "x$with_external_gtest" = "xyes" ; then
AC_MSG_RESULT([using external GTest.])
PKG_CHECK_MODULES([GTEST], [gtest >= 1.8.0])
else
AC_MSG_RESULT([using internal GTest.])
GTEST_CFLAGS="-I\$(top_srcdir)/test/googletest/include"
GTEST_LIBS="\$(top_builddir)/test/googletest/libgtest.la"
fi
AM_CONDITIONAL(USE_EXTERNAL_GTEST, [test "x$with_external_gtest" = "xyes"])
AC_SUBST(GTEST_CFLAGS,$GTEST_CFLAGS)
AC_SUBST(GTEST_LIBS,$GTEST_LIBS)
dnl ---------------------------------------------------------------------------
dnl Generate files
dnl ---------------------------------------------------------------------------
AC_CONFIG_FILES([Makefile cmake/Makefile src/Makefile include/Makefile include/proj/Makefile include/proj/internal/Makefile
include/proj/internal/nlohmann/Makefile
test/Makefile test/cli/Makefile test/gie/Makefile test/gigs/Makefile test/unit/Makefile
man/Makefile man/man1/Makefile man/man3/Makefile data/Makefile
jniwrap/Makefile jniwrap/org.osgeo.proj/Makefile jniwrap/org.osgeo.proj/org/Makefile jniwrap/org.osgeo.proj/org/proj4/Makefile])
if ! test "x$with_external_gtest" = "xyes" ; then
AC_CONFIG_FILES([test/googletest/Makefile test/googletest/include/Makefile
test/googletest/include/gtest/Makefile
test/googletest/include/gtest/internal/Makefile
test/googletest/include/gtest/internal/custom/Makefile
test/googletest/src/Makefile])
fi
AC_CONFIG_FILES([proj.pc])
AC_OUTPUT
+4 -3
View File
@@ -3,7 +3,8 @@
# See: https://shop.swisstopo.admin.ch/en/products/geo_software/GIS_info
#
# You'll need to download the grids separately and put in a directory
# scanned by libproj.
# scanned by libproj. Directories may be added to the scan list through
# the PROJ_LIB environment variable
#
# Note that an independent effort was made to derive an usable grid
# from the CH1903->CH1903+ grid initially available from the Swisstopo
@@ -17,6 +18,6 @@
#
<metadata> +origin=Swisstopo +lastupdate=2012-02-27
# CH1903/LV03
<1903_LV03> +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +units=m +nadgrids=CHENyx06_ETRS.gsb +no_defs
<1903_LV03> +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +units=m +nadgrids=CHENYX06_etrs.gsb +no_defs
# CH1903
<1903> +proj=longlat +ellps=bessel +nadgrids=CHENyx06_ETRS.gsb +no_defs <>
<1903> +proj=longlat +ellps=bessel +nadgrids=CHENYX06_etrs.gsb +no_defs <>
+29 -72
View File
@@ -2,17 +2,18 @@
# files containing dictionary of useful projection
#
set(PROJ_DB_CACHE_DIR "" CACHE PATH "Directory used to cache proj.db")
if(NOT IS_DIRECTORY ${PROJ_DB_CACHE_DIR})
if(NOT "${PROJ_DB_CACHE_DIR}" STREQUAL "")
message(WARNING
"PROJ_DB_CACHE_DIR (${PROJ_DB_CACHE_DIR}) not set to a directory")
set(PROJ_DB_CACHE_DIR "")
endif()
endif()
set(PROJ_INI
proj.ini
set(PROJ_DICTIONARY
null
world
other.extra
nad27
GL27
nad83
nad.lst
CH
ITRF2000
ITRF2008
ITRF2014
)
#
@@ -23,27 +24,28 @@ file(GLOB GSB_FILES *.gsb)
file(GLOB GTX_FILES *.gtx)
set(GRIDSHIFT_FILES ${GSB_FILES} ${GTX_FILES})
file(GLOB SCHEMA_FILES *.json)
file(GLOB GEOTIFF_FILES *.tif)
set(ALL_SQL_IN "${CMAKE_CURRENT_BINARY_DIR}/all.sql.in")
set(PROJ_DB "${CMAKE_CURRENT_BINARY_DIR}/proj.db")
include(sql_filelist.cmake)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
"${CMAKE_CURRENT_LIST_DIR}/sql/proj.db.sql.expected.md5"
add_custom_command(
OUTPUT ${ALL_SQL_IN}
COMMAND ${CMAKE_COMMAND} "-DALL_SQL_IN=${ALL_SQL_IN}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/generate_all_sql_in.cmake"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS ${SQL_FILES}
COMMENT "Generating all.sql.in"
VERBATIM
)
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/sql/proj.db.sql.expected.md5" PROJ_DB_SQL_EXPECTED_MD5 LIMIT_COUNT 1)
add_custom_target(generate_all_sql_in ALL DEPENDS ${ALL_SQL_IN})
add_custom_command(
OUTPUT ${PROJ_DB}
COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJ_DB}
COMMAND ${CMAKE_COMMAND} "-DALL_SQL_IN=${ALL_SQL_IN}" "-DEXE_SQLITE3=${EXE_SQLITE3}" "-DPROJ_DB=${PROJ_DB}" "-DPROJ_VERSION=${PROJ_VERSION}" "-DPROJ_DB_CACHE_DIR=${PROJ_DB_CACHE_DIR}" "-DPROJ_DB_SQL_EXPECTED_MD5=${PROJ_DB_SQL_EXPECTED_MD5}" "-DDATA_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/generate_proj_db.cmake"
COMMAND ${CMAKE_COMMAND} -E copy ${PROJ_DB} ${CMAKE_CURRENT_BINARY_DIR}/for_tests
DEPENDS ${SQL_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/generate_proj_db.cmake"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND ${EXE_SQLITE3} -init ${ALL_SQL_IN} ${PROJ_DB} .quit
# note: we didn't port yet the foreign_key_check done in Makefile.am
DEPENDS generate_all_sql_in ${ALL_SQL_IN}
COMMENT "Generating proj.db"
VERBATIM
)
@@ -51,65 +53,20 @@ add_custom_command(
add_custom_target(generate_proj_db ALL DEPENDS ${PROJ_DB})
if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
foreach(FILE ${PROJ_INI} ${PROJ_DICTIONARY} ${GRIDSHIFT_FILES})
foreach(FILE ${PROJ_DICTIONARY} ${GRIDSHIFT_FILES})
configure_file(${FILE} ${FILE} COPYONLY)
endforeach()
endif()
# Copy select resource files in a for_tests subdirectory so that we are not
# influenced by the presence of other grids
# Note: this is done at configure/cmake time, not build time.
# So if you install new grids in the source data/ subdirectory, run cmake again
set(DATA_FOR_TESTS
GL27
nad27
nad83
ITRF2000)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/for_tests)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/for_tests/tests)
foreach(FILE ${DATA_FOR_TESTS} ${PROJ_INI})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${CMAKE_CURRENT_BINARY_DIR}/for_tests/${FILE} COPYONLY)
endforeach()
file(GLOB DATA_TESTS tests/*)
foreach(FILE ${DATA_TESTS})
get_filename_component(FILENAME ${FILE} NAME)
configure_file(${FILE} ${CMAKE_CURRENT_BINARY_DIR}/for_tests/tests/${FILENAME} COPYONLY)
endforeach()
set(DATA_FOR_TESTS_FROM_TESTS_SUBDIR
alaska
BETA2007.gsb
conus
MD
ntf_r93.gsb
ntv1_can.dat)
foreach(FILE ${DATA_FOR_TESTS_FROM_TESTS_SUBDIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/${FILE} ${CMAKE_CURRENT_BINARY_DIR}/for_tests/${FILE} COPYONLY)
endforeach()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/egm96_15_downsampled.gtx ${CMAKE_CURRENT_BINARY_DIR}/for_tests/egm96_15.gtx COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/ntv2_0_downsampled.gsb ${CMAKE_CURRENT_BINARY_DIR}/for_tests/ntv2_0.gsb COPYONLY)
# test_cs2cs_datumfile has a special case
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/for_tests/dir with space")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/conus "${CMAKE_CURRENT_BINARY_DIR}/for_tests/dir with space/myconus" COPYONLY)
#
#install
#
set(ALL_DATA_FILE
${PROJ_DICTIONARY}
${GRIDSHIFT_FILES}
${SCHEMA_FILES}
${GEOTIFF_FILES}
${PROJ_DB}
)
if (NOT USE_ONLY_EMBEDDED_RESOURCE_FILES)
list(APPEND ALL_DATA_FILE ${PROJ_INI} ${PROJ_DB} ${PROJ_DICTIONARY})
endif()
install(
FILES ${ALL_DATA_FILE}
DESTINATION ${CMAKE_INSTALL_DATADIR}/proj
DESTINATION ${DATADIR}
)
+3 -36
View File
@@ -42,53 +42,20 @@
<CARB> +proj=helmert +drx=0.000049 +dry=-0.001088 +drz=0.000664 +convention=position_vector
<EURA> +proj=helmert +drx=-0.000083 +dry=-0.000534 +drz=0.000750 +convention=position_vector
<EURA> +proj=helmert +drx=-0.000083 +dry=0.000534 +drz=0.000750 +convention=position_vector
<INDI> +proj=helmert +drx=0.001232 +dry=0.000303 +drz=0.001540 +convention=position_vector
<NAZC> +proj=helmert +drx=-0.000330 +dry=-0.001551 +drz=0.001625 +convention=position_vector
<NOAM> +proj=helmert +drx=0.000035 +dry=-0.000662 +drz=-0.0001 +convention=position_vector
<NOAM> +proj=helmert +drx=0.000035 +dry=-0.000662 +drz=0.0001 +convention=position_vector
<NUBI> +proj=helmert +drx=0.000095 +dry=-0.000598 +drz=0.000723 +convention=position_vector
<PCFC> +proj=helmert +drx=-0.000411 +dry=0.001036 +drz=-0.002166 +convention=position_vector
<PCFC> +proj=helmert +drx=0.000411 +dry=0.001036 +drz=-0.002166 +convention=position_vector
<SOAM> +proj=helmert +drx=-0.000243 +dry=-0.000311 +drz=-0.000154 +convention=position_vector
<SOMA> +proj=helmert +drx=-0.000080 +dry=-0.000745 +drz=0.000897 +convention=position_vector
<SUND> +proj=helmert +drx=0.000047 +dry=-0.001 +drz=0.000975 +convention=position_vector
# Plate names suffixed by _T (for Translation) that includes the translation
# rates +dx=0.00041 +dy=0.00022 +dz=0.00041 given by Table 2 of the ITRF2008 plate motion model
# paper
<AMUR_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=-0.000190 +dry=-0.000442 +drz=0.000915 +convention=position_vector
<ANTA_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=-0.000252 +dry=-0.000302 +drz=0.000643 +convention=position_vector
<ARAB_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=0.001202 +dry=-0.000054 +drz=0.001485 +convention=position_vector
<AUST_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=0.001504 +dry=0.001172 +drz=0.001228 +convention=position_vector
<CARB_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=0.000049 +dry=-0.001088 +drz=0.000664 +convention=position_vector
<EURA_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=-0.000083 +dry=-0.000534 +drz=0.000750 +convention=position_vector
<INDI_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=0.001232 +dry=0.000303 +drz=0.001540 +convention=position_vector
<NAZC_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=-0.000330 +dry=-0.001551 +drz=0.001625 +convention=position_vector
<NOAM_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=0.000035 +dry=-0.000662 +drz=-0.0001 +convention=position_vector
<NUBI_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=0.000095 +dry=-0.000598 +drz=0.000723 +convention=position_vector
<PCFC_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=-0.000411 +dry=0.001036 +drz=-0.002166 +convention=position_vector
<SOAM_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=-0.000243 +dry=-0.000311 +drz=-0.000154 +convention=position_vector
<SOMA_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=-0.000080 +dry=-0.000745 +drz=0.000897 +convention=position_vector
<SUND_T> +proj=helmert +dx=0.00041 +dy=0.00022 +dz=0.00041 +drx=0.000047 +dry=-0.001 +drz=0.000975 +convention=position_vector
+4 -4
View File
@@ -7,11 +7,11 @@
<ITRF2000> +proj=helmert +x=0.0007 +y=0.0012 +z=-0.0261 +s=0.00212 +dx=0.0001 +dy=0.0001 +dz=-0.0019 +ds=0.00011 +t_epoch=2010.0 +convention=position_vector
<ITRF97> +proj=helmert +x=0.0074 +y=-0.0005 +z=-0.0628 +s=0.0038 +rz=0.00026 +dx=0.0001 +dy=-0.0005 +dz=-0.0033 +ds=0.00012 +drz=0.00002 +t_epoch=2010.0 +convention=position_vector
<ITRF97> +proj=helmert +x=0.0074 +y=-0.0005 +z=-0.0628 +d=0.0038 +rz=0.00026 +dx0.0001 +dy=-0.0005 +dz=-0.0033 +ds=0.00012 +drz=0.00002 +t_epoch=2010.0 +convention=position_vector
<ITRF96> +proj=helmert +x=0.0074 +y=-0.0005 +z=-0.0628 +s=0.0038 +rz=0.00026 +dx=0.0001 +dy=-0.0005 +dz=-0.0033 +ds=0.00012 +drz=0.00002 +t_epoch=2010.0 +convention=position_vector
<ITRF96> +proj=helmert +x=0.0074 +y=-0.0005 +z=-0.0628 +s=0.0038 +rz=0.00026 +dx=0.0001 +dy=-0.0005 +dz=-0.0033 +ds=0.00012 +t_epoch=2010.0 +convention=position_vector
<ITRF94> +proj=helmert +x=0.0074 +y=-0.0005 +z=-0.0628 +s=0.0038 +rz=0.00026 +dx=0.0001 +dy=-0.0005 +dz=-0.0033 +ds=0.00012 +drz=0.00002 +t_epoch=2010.0 +convention=position_vector
<ITRF94> +proj=helmert +x=0.0074 +y=-0.0005 +z=-0.0628 +s=0.0038 +rz=0.00026 +dx=0.0001 +dy=-0.0005 +dz=-0.0033 +ds=0.00012 +t_epoch=2010.0 +convention=position_vector
<ITRF93> +proj=helmert +x=-0.0504 +y=0.0033 +z=-0.0602 +s=0.00429 +rx=-0.00281 +ry=-0.00338 +rz=0.0004 +dx=-0.0028 +dy=-0.0001 +dz=-0.0025 +ds=0.00012 +drx=-0.00011 +dry=-0.00019 +drz=0.00007 +t_epoch=2010.0 +convention=position_vector
@@ -23,7 +23,7 @@
<ITRF89> +proj=helmert +x=0.0304 +y=0.0355 +z=-0.1308 +s=0.00819 +rz=0.00026 +dx=0.0001 +dy=-0.0005 +dz=-0.0033 +ds=0.00012 +drz=0.00002 +t_epoch=2010.0 +convention=position_vector
<ITRF88> +proj=helmert +x=0.0254 +y=-0.0005 +z=-0.1548 +s=0.01129 +rx=0.0001 +rz=0.00026 +dx=0.0001 +dy=-0.0005 +dz=-0.0033 +ds=0.00012 +drz=0.00002 +t_epoch=2010.0 +convention=position_vector
<ITRF88> +proj=helmert +x=0.0254 +y=-0.0005 +z=-0.1548 +s=0.01129 +rx=0.0001 +rz= +dx=0.00026 +dy=0.0001 +dx=-0.0005 +dz=-0.0033 +ds=0.00012 +drz=0.00002 +t_epoch=2010.0 +convention=position_vector
# ITRF2014 Plate Motion Model parameters
#
-91
View File
@@ -1,91 +0,0 @@
# ITRF2020 params are in mm/year, PJ_helmert uses m/year
# Generated with generate_itrf2020.py from EPSG database
<ITRF2014> +proj=helmert +x=-0.0014 +y=-0.0009 +z=0.0014 +s=-0.00042 +dy=-0.0001 +dz=0.0002 +t_epoch=2015 +convention=position_vector
<ITRF2008> +proj=helmert +x=0.0002 +y=0.001 +z=0.0033 +s=-0.00029 +dy=-0.0001 +dz=0.0001 +ds=3e-05 +t_epoch=2015 +convention=position_vector
<ITRF2005> +proj=helmert +x=0.0027 +y=0.0001 +z=-0.0014 +s=0.00065 +dx=0.0003 +dy=-0.0001 +dz=0.0001 +ds=3e-05 +t_epoch=2015 +convention=position_vector
<ITRF2000> +proj=helmert +x=-0.0002 +y=0.0008 +z=-0.0342 +s=0.00225 +dx=0.0001 +dz=-0.0017 +ds=0.00011 +t_epoch=2015 +convention=position_vector
<ITRF97> +proj=helmert +x=0.0065 +y=-0.0039 +z=-0.0779 +rz=0.00036 +s=0.00398 +dx=0.0001 +dy=-0.0006 +dz=-0.0031 +drz=2e-05 +ds=0.00012 +t_epoch=2015 +convention=position_vector
<ITRF96> +proj=helmert +x=0.0065 +y=-0.0039 +z=-0.0779 +rz=0.00036 +s=0.00398 +dx=0.0001 +dy=-0.0006 +dz=-0.0031 +drz=2e-05 +ds=0.00012 +t_epoch=2015 +convention=position_vector
<ITRF94> +proj=helmert +x=0.0065 +y=-0.0039 +z=-0.0779 +rz=0.00036 +s=0.00398 +dx=0.0001 +dy=-0.0006 +dz=-0.0031 +drz=2e-05 +ds=0.00012 +t_epoch=2015 +convention=position_vector
<ITRF93> +proj=helmert +x=-0.0658 +y=0.0019 +z=-0.0713 +rx=-0.00336 +ry=-0.00433 +rz=0.00075 +s=0.00447 +dx=-0.0028 +dy=-0.0002 +dz=-0.0023 +drx=-0.00011 +dry=-0.00019 +drz=7e-05 +ds=0.00012 +t_epoch=2015 +convention=position_vector
<ITRF92> +proj=helmert +x=0.0145 +y=-0.0019 +z=-0.0859 +rz=0.00036 +s=0.00327 +dx=0.0001 +dy=-0.0006 +dz=-0.0031 +drz=2e-05 +ds=0.00012 +t_epoch=2015 +convention=position_vector
<ITRF91> +proj=helmert +x=0.0265 +y=0.0121 +z=-0.0919 +rz=0.00036 +s=0.00467 +dx=0.0001 +dy=-0.0006 +dz=-0.0031 +drz=2e-05 +ds=0.00012 +t_epoch=2015 +convention=position_vector
<ITRF90> +proj=helmert +x=0.0245 +y=0.0081 +z=-0.1079 +rz=0.00036 +s=0.00497 +dx=0.0001 +dy=-0.0006 +dz=-0.0031 +drz=2e-05 +ds=0.00012 +t_epoch=2015 +convention=position_vector
<ITRF89> +proj=helmert +x=0.0295 +y=0.0321 +z=-0.1459 +rz=0.00036 +s=0.00837 +dx=0.0001 +dy=-0.0006 +dz=-0.0031 +drz=2e-05 +ds=0.00012 +t_epoch=2015 +convention=position_vector
<ITRF88> +proj=helmert +x=0.0245 +y=-0.0039 +z=-0.1699 +rx=0.0001 +rz=0.00036 +s=0.01147 +dx=0.0001 +dy=-0.0006 +dz=-0.0031 +drz=2e-05 +ds=0.00012 +t_epoch=2015 +convention=position_vector
# ITRF2020 Plate Motion Model parameters
#
# As described in https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2023GL106373
# (and also in https://itrf.ign.fr/docs/solutions/itrf2020/ITRF2020-PMM.dat, but with
# different units)
<AMUR> +proj=helmert +drx=-0.000131 +dry=-0.000551 +drz=0.000837 +convention=position_vector
<ANTA> +proj=helmert +drx=-0.000269 +dry=-0.000312 +drz=0.000678 +convention=position_vector
<ARAB> +proj=helmert +drx=0.001129 +dry=-0.000146 +drz=0.001438 +convention=position_vector
<AUST> +proj=helmert +drx=0.001487 +dry=0.001175 +drz=0.001223 +convention=position_vector
<CARB> +proj=helmert +drx=0.000207 +dry=-0.001422 +drz=0.000726 +convention=position_vector
<EURA> +proj=helmert +drx=-0.000085 +dry=-0.000519 +drz=0.000753 +convention=position_vector
<INDI> +proj=helmert +drx=0.001137 +dry=0.000013 +drz=0.001444 +convention=position_vector
<NAZC> +proj=helmert +drx=-0.000327 +dry=-0.001561 +drz=0.001605 +convention=position_vector
<NOAM> +proj=helmert +drx=0.000045 +dry=-0.000666 +drz=-0.000098 +convention=position_vector
<NUBI> +proj=helmert +drx=0.000090 +dry=-0.000585 +drz=0.000717 +convention=position_vector
<PCFC> +proj=helmert +drx=-0.000404 +dry=0.001021 +drz=-0.002154 +convention=position_vector
<SOAM> +proj=helmert +drx=-0.000261 +dry=-0.000282 +drz=-0.000157 +convention=position_vector
<SOMA> +proj=helmert +drx=-0.000081 +dry=-0.000719 +drz=0.000864 +convention=position_vector
# Plate names suffixed by _T (for Translation) that includes the translation
# rates +dx=0.00037 +dy=0.00035 +dz=0.00074 given by Table 2 of the ITRF2020 plate motion model
# paper
<AMUR_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=-0.000131 +dry=-0.000551 +drz=0.000837 +convention=position_vector
<ANTA_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=-0.000269 +dry=-0.000312 +drz=0.000678 +convention=position_vector
<ARAB_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=0.001129 +dry=-0.000146 +drz=0.001438 +convention=position_vector
<AUST_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=0.001487 +dry=0.001175 +drz=0.001223 +convention=position_vector
<CARB_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=0.000207 +dry=-0.001422 +drz=0.000726 +convention=position_vector
<EURA_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=-0.000085 +dry=-0.000519 +drz=0.000753 +convention=position_vector
<INDI_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=0.001137 +dry=0.000013 +drz=0.001444 +convention=position_vector
<NAZC_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=-0.000327 +dry=-0.001561 +drz=0.001605 +convention=position_vector
<NOAM_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=0.000045 +dry=-0.000666 +drz=-0.000098 +convention=position_vector
<NUBI_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=0.000090 +dry=-0.000585 +drz=0.000717 +convention=position_vector
<PCFC_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=-0.000404 +dry=0.001021 +drz=-0.002154 +convention=position_vector
<SOAM_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=-0.000261 +dry=-0.000282 +drz=-0.000157 +convention=position_vector
<SOMA_T> +proj=helmert +dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=-0.000081 +dry=-0.000719 +drz=0.000864 +convention=position_vector
+107
View File
@@ -0,0 +1,107 @@
DATAPATH = $(top_srcdir)/data
pkgdata_DATA = GL27 nad.lst nad27 nad83 world other.extra \
CH null \
ITRF2000 ITRF2008 ITRF2014 proj.db \
projjson.schema.json
SQL_ORDERED_LIST = sql/begin.sql \
sql/proj_db_table_defs.sql \
sql/conversion_triggers.sql \
sql/metadata.sql \
sql/unit_of_measure.sql \
sql/area.sql \
sql/coordinate_system.sql \
sql/axis.sql \
sql/ellipsoid.sql \
sql/prime_meridian.sql \
sql/geodetic_datum.sql \
sql/vertical_datum.sql \
sql/conversion.sql \
sql/geodetic_crs.sql \
sql/projected_crs.sql \
sql/vertical_crs.sql \
sql/compound_crs.sql \
sql/helmert_transformation.sql \
sql/grid_transformation.sql \
sql/grid_transformation_custom.sql \
sql/other_transformation.sql \
sql/concatenated_operation.sql \
sql/concatenated_operation_step.sql \
sql/alias_name.sql \
sql/supersession.sql \
sql/deprecation.sql \
sql/esri.sql \
sql/ignf.sql \
sql/grid_alternatives.sql \
sql/grid_alternatives_generated.sql \
sql/customizations.sql \
sql/commit.sql
EXTRA_DIST = GL27 nad.lst nad27 nad83 \
world other.extra \
CH \
ITRF2000 ITRF2008 ITRF2014 \
projjson.schema.json \
CMakeLists.txt tests/test_nodata.gtx null \
generate_all_sql_in.cmake sql_filelist.cmake \
$(SQL_ORDERED_LIST)
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
@for gridfile in $(DATAPATH)/*.gsb $(DATAPATH)/*.gtx $(DATAPATH)/ntv1_can.dat dummy \
$(DATAPATH)/alaska $(DATAPATH)/conus $(DATAPATH)/hawaii $(DATAPATH)/null \
$(DATAPATH)/prvi $(DATAPATH)/stgeorge $(DATAPATH)/stlrnc $(DATAPATH)/stpaul \
$(DATAPATH)/FL $(DATAPATH)/MD $(DATAPATH)/TN $(DATAPATH)/WI $(DATAPATH)/WO; do \
if test "$$gridfile" != "dummy" -a -f "$$gridfile" ; then \
echo $(INSTALL_DATA) $$gridfile $(DESTDIR)$(pkgdatadir)/`basename $$gridfile`; \
$(INSTALL_DATA) $$gridfile $(DESTDIR)$(pkgdatadir)/`basename $$gridfile`; \
fi; \
done
# head -c1 not handled on Solaris
proj.db: $(DATAPATH)/sql/*.sql
@echo "Make proj.db"
$(RM) proj.db
@export SQL_EXPANDED_LIST=""; \
for x in $(SQL_ORDERED_LIST); do \
export SQL_EXPANDED_LIST="$${SQL_EXPANDED_LIST} $(DATAPATH)/$$x"; \
done; \
if test "x$(PROJ_DB_CACHE_DIR)" != "x" -a -x "$$(command -v md5sum)" -a -f "$(PROJ_DB_CACHE_DIR)/proj.db" -a -f "$(PROJ_DB_CACHE_DIR)/proj.db.sql.md5" ; then \
cat $${SQL_EXPANDED_LIST} | md5sum | diff - "$(PROJ_DB_CACHE_DIR)/proj.db.sql.md5" > /dev/null \
&& (echo "Reusing cached proj.db"; cp "$(PROJ_DB_CACHE_DIR)/proj.db" proj.db); \
fi; \
if test ! -f proj.db ; then \
cat $${SQL_EXPANDED_LIST} | sqlite3 proj.db; \
fi; \
if [ $$? -ne 0 ] ; then \
echo "Build of proj.db failed"; \
$(RM) proj.db; \
exit 1; \
fi; \
echo "" | head -c1; \
if [ $$? -eq 0 ] ; then \
echo "Running foreign_key_check"; \
if [[ $$(echo "pragma foreign_key_check;" | sqlite3 proj.db | head -c1 | wc -c) -ne 0 ]]; then \
echo "Foreign key check failed"; \
$(RM) proj.db; \
exit 1; \
else \
if test "x$(PROJ_DB_CACHE_DIR)" != "x" -a -x "$$(command -v md5sum)" ; then \
mkdir -p "$(PROJ_DB_CACHE_DIR)"; \
cat $${SQL_EXPANDED_LIST} | md5sum > "$(PROJ_DB_CACHE_DIR)/proj.db.sql.md5"; \
cp proj.db "$(PROJ_DB_CACHE_DIR)"; \
fi \
fi \
fi
# For out-of-tree builds, link all file of the source data dir to the generated data
check-local:
@if [ ! -f GL27 ]; then \
for x in $(DATAPATH)/*; do \
ln -sf $$x .; \
done \
fi
clean-local:
$(RM) proj.db
+16 -1
View File
@@ -4,6 +4,16 @@ File Contents:
README --- This file
epsg --- Translation of EPSG GCS/PCS codes into PROJ via init= mechanism.
epsg-deprecated --- EPSG definitions that have been deprecated. They are
not part of 'epsg' anymore, but may have been delivered
with earlier versions of 'epsg'.
Thus, they might occur e.g. in WMS (Web Mapping Services)
running with old EPSG definitions.
This file is not complete at all - it contains just
definitions that were individually reported.
nad27 --- North American Datum 1927 for "init=" definition of
State Plane Coordinate Systems (SPCS).
@@ -15,4 +25,9 @@ world --- Proj specifications for several international grid systems.
nad.lst --- Reference list of SPCS States and NGS datum identifiers
Additional data files are available in https://github.com/OSGeo/PROJ-data
IGNF --- Translation of French Mapping Agency codes into PROJ via init= mechanism.
install --- Unix shell (sh) script to install proj init files.
Read beginning for usage instructions.
Additional data files are available in https://github.com/OSGeo/proj-datumgrid/
-582
View File
@@ -1,582 +0,0 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Schema for deformation models",
"type": "object",
"properties": {
"file_type": {
"type": "string",
"enum": [
"deformation_model_master_file"
],
"description": "File type. Always \"deformation_model_master_file\""
},
"format_version": {
"type": "string",
"enum": [
"1.0"
]
},
"name": {
"type": "string",
"description": "A brief descriptive name of the deformation model"
},
"version": {
"type": "string",
"description": "A string identifying the version of the deformation model. The format for specifying version will be defined by the agency responsible for the deformation model"
},
"publication_date": {
"$ref": "#/definitions/datetime",
"description": "The date on which this version of the deformation model was published (or possibly the date on which it takes effect?)"
},
"license": {
"type": "string",
"description": "License under which the model is published"
},
"description": {
"type": "string",
"description": "A text description of the model"
},
"authority": {
"type": "object",
"description": "Basic information about the agency responsible for the data set",
"properties": {
"name": {
"type": "string",
"description": "The name of the agency"
},
"url": {
"type": "string",
"description": "The url of the agency website",
"format": "uri"
},
"address": {
"type": "string",
"description": "The postal address of the agency"
},
"email": {
"type": "string",
"description": "An email contact address for the agency",
"format": "email"
}
},
"required": [
"name"
],
"additionalProperties": false
},
"links": {
"type": "array",
"description": "Links to related information",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The URL holding the information",
"format": "uri"
},
"rel": {
"type": "string",
"description": "The relationship to the dataset. Proposed relationships are:\n- \"about\": a web page for human consumption describing the model\n- \"source\": the authoritative source data from which the deformation model is built.\n- \"metadata\": ISO 19115 XML metadata regarding the deformation model."
},
"type": {
"type": "string",
"description": "MIME type"
},
"title": {
"type": "string",
"description": "Description of the link"
}
},
"required": [
"href"
],
"additionalProperties": false
}
},
"source_crs": {
"$ref": "#/definitions/crs",
"description": "The coordinate reference system to which the deformation model applies"
},
"target_crs": {
"$ref": "#/definitions/crs",
"description": "For a time dependent coordinate transformation the coordinate reference system resulting from applying the deformation"
},
"definition_crs": {
"$ref": "#/definitions/crs",
"description": "The coordinate reference system used to define the component spatial models. This proposal only supports using the same value for the source and definition coordinate reference system."
},
"reference_epoch": {
"$ref": "#/definitions/datetime",
"description": "A nominal reference epoch of the deformation model. This is not necessarily used to calculate the deformation model - each component defines its own time function."
},
"uncertainty_reference_epoch": {
"$ref": "#/definitions/datetime",
"description": "The uncertainties of the deformation model are calculated in terms of this epoch. This is described below in the Time functions section."
},
"horizontal_offset_unit": {
"type": "string",
"enum": [
"metre",
"degree"
]
},
"vertical_offset_unit": {
"type": "string",
"enum": [
"metre"
]
},
"horizontal_uncertainty_type": {
"type": "string",
"enum": [
"circular 95% confidence limit"
]
},
"horizontal_uncertainty_unit": {
"type": "string",
"enum": [
"metre"
]
},
"vertical_uncertainty_type": {
"type": "string",
"enum": [
"95% confidence limit"
]
},
"vertical_uncertainty_unit": {
"type": "string",
"enum": [
"metre"
]
},
"horizontal_offset_method": {
"type": "string",
"description": "Defines how the horizontal offsets are applied to geographic coordinates",
"enum": [
"addition",
"geocentric"
]
},
"extent": {
"$ref": "#/definitions/extent",
"description": "Defines the region within which the deformation model is defined. It cannot be calculated outside this region. The region is specified by a type and value. This proposal only supports using a bounding box as an array of [west,south,east,north] coordinate values"
},
"time_extent": {
"type": "object",
"description": "Defines the range of times for which the model is valid, specified by a first and a last value. The deformation model is undefined for dates outside this range.",
"properties": {
"first": {
"$ref": "#/definitions/datetime"
},
"last": {
"$ref": "#/definitions/datetime"
}
},
"required": [
"first",
"last"
],
"additionalProperties": false
},
"components": {
"type": "array",
"items": {
"$ref": "#/definitions/component"
}
}
},
"required": [
"file_type",
"format_version",
"source_crs",
"target_crs",
"definition_crs",
"extent",
"time_extent",
"components"
],
"additionalProperties": false,
"definitions": {
"component": {
"type": "object",
"definition": "A component describes an aspect of the deformation, such as glacial isostatic adjustment, secular deformation, earthquakes, etc.",
"properties": {
"description": {
"type": "string",
"description": "A text description of this component of the model"
},
"extent": {
"$ref": "#/definitions/extent",
"description": "The region within the component is defined. Outside this region the component evaluates to 0. The region is specified by a type and value. This proposal only supports using a bounding box as an array of [west,south,east,north] coordinate values"
},
"displacement_type": {
"type": "string",
"description": "The displacement parameters defined by the model. The \"none\" option allows for a component which defines uncertainty with different grids to those defining displacement",
"enum": [
"none",
"horizontal",
"vertical",
"3d"
]
},
"uncertainty_type": {
"type": "string",
"description": "The uncertainty parameters defined by the model",
"enum": [
"none",
"horizontal",
"vertical",
"3d"
]
},
"horizontal_uncertainty": {
"type": "number",
"description": "The horizontal uncertainty to use if it is not defined explicitly in the spatial model"
},
"vertical_uncertainty": {
"type": "number",
"description": "The vertical uncertainty to use if it is not defined explicitly in the spatial model"
},
"spatial_model": {
"type": "object",
"description": "Defines the spatial model",
"properties": {
"type": {
"type": "string",
"description": "Specifies the type of the spatial model data file. Initially it is proposed that only GeoTIFF is supported",
"enum": [
"GeoTIFF"
]
},
"interpolation_method": {
"type": "string",
"description": "Interpolation method",
"enum": [
"bilinear",
"geocentric_bilinear"
]
},
"filename": {
"type": "string",
"description": "Specifies location of the spatial model GeoTIFF file relative to this JSON file"
},
"md5_checksum": {
"type": "string",
"description": "A hex encoded MD5 checksum of the grid file that can be used to validate that it is the correct version of the file"
}
},
"required": [
"type",
"interpolation_method",
"filename"
],
"additionalProperties": false
},
"time_function": {
"$ref": "#/definitions/time_function"
}
},
"required": [
"description",
"extent",
"displacement_type",
"spatial_model",
"time_function"
],
"additionalProperties": false
},
"crs": {
"type": "string",
"pattern": "^[a-zA-Z]+:[a-zA-Z0-9]+$"
},
"datetime": {
"type": "string",
"format": "date-time",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
},
"extent": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"bbox"
]
},
"parameters": {
"type": "object",
"properties": {
"bbox": {
"type": "array",
"minItems": 4,
"maxItems": 4,
"items": {
"type": "number"
}
}
}
}
},
"required": [
"type",
"parameters"
],
"additionalProperties": false
},
"time_function": {
"description": "Function describing a multiplicative factor to apply to the spatial_model depending on the time",
"oneOf": [
{
"$ref": "#/definitions/time_function_constant"
},
{
"$ref": "#/definitions/time_function_velocity"
},
{
"$ref": "#/definitions/time_function_step"
},
{
"$ref": "#/definitions/time_function_reverse_step"
},
{
"$ref": "#/definitions/time_function_piecewise"
},
{
"$ref": "#/definitions/time_function_exponential"
}
]
},
"time_function_constant": {
"description": "The valuation of this function is 1 at any epoch",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"constant"
]
},
"parameters": {
"type": "object",
"properties": {
},
"additionalProperties": false
}
},
"required": [
"type"
],
"additionalProperties": false
},
"time_function_velocity": {
"description": "The valuation of this function is 0 at reference_epoch, and proportional to the time difference to it at other times",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"velocity"
]
},
"parameters": {
"type": "object",
"properties": {
"reference_epoch": {
"$ref": "#/definitions/datetime"
}
},
"required": [
"reference_epoch"
],
"additionalProperties": false
}
},
"required": [
"type",
"parameters"
],
"additionalProperties": false
},
"time_function_step": {
"description": "The valuation of this function is 0 before step_epoch, and 1 starting from it",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"step"
]
},
"parameters": {
"type": "object",
"properties": {
"step_epoch": {
"$ref": "#/definitions/datetime"
}
},
"required": [
"step_epoch"
],
"additionalProperties": false
}
},
"required": [
"type",
"parameters"
],
"additionalProperties": false
},
"time_function_reverse_step": {
"description": "The valuation of this function is 1 before step_epoch, and 0 starting from it",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"reverse_step"
]
},
"parameters": {
"type": "object",
"properties": {
"step_epoch": {
"$ref": "#/definitions/datetime"
}
},
"required": [
"step_epoch"
],
"additionalProperties": false
}
},
"required": [
"type",
"parameters"
],
"additionalProperties": false
},
"time_function_piecewise": {
"description": "Piecewise time function",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"piecewise"
]
},
"parameters": {
"type": "object",
"properties": {
"before_first": {
"type": "string",
"description": "Defines the behaviour of the function before the first defined epoch",
"enum": [
"zero",
"constant",
"linear"
]
},
"after_last": {
"type": "string",
"description": "Defines the behaviour of the function after the last defined epoch",
"enum": [
"zero",
"constant",
"linear"
]
},
"model": {
"type": "array",
"description": "A sorted array data points each defined by two elements, \"epoch\" defines the date/time of the data point, and \"scale_factor\" is the corresponding function value. The array is sorted in order of increasing epoch. Note: where the time function includes a step it is represented by two consecutive data points with the same epoch. The first defines the scale factor that applies before the epoch and the second the scale factor that applies after the epoch",
"items": {
"type": "object",
"properties": {
"epoch": {
"$ref": "#/definitions/datetime"
},
"scale_factor": {
"type": "number"
}
},
"required": [
"epoch",
"scale_factor"
],
"additionalProperties": false
},
"minItems": 2
}
},
"required": [
"before_first",
"after_last",
"model"
],
"additionalProperties": false
}
},
"required": [
"type",
"parameters"
],
"additionalProperties": false
},
"time_function_exponential": {
"description": "The valuation of this function is an exponential function with a time-based relaxation constant",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"exponential"
]
},
"parameters": {
"type": "object",
"properties": {
"reference_epoch": {
"$ref": "#/definitions/datetime",
"description": "The date/time at which the exponential decay starts"
},
"end_epoch": {
"$ref": "#/definitions/datetime",
"description": "The date/time at which the exponential decay ends (optional)"
},
"relaxation_constant": {
"type": "number",
"description": "Relaxation constant in years"
},
"before_scale_factor": {
"type": "number",
"description": "The scale factor that applies before the reference epoch"
},
"initial_scale_factor": {
"type": "number",
"description": "The initial scale factor"
},
"final_scale_factor": {
"type": "number",
"description": "The scale factor the exponential function approaches"
}
},
"required": [
"reference_epoch",
"relaxation_constant",
"before_scale_factor",
"initial_scale_factor",
"final_scale_factor"
],
"additionalProperties": false
}
},
"required": [
"type",
"parameters"
],
"additionalProperties": false
}
}
}
+2
View File
@@ -0,0 +1,2 @@
# DHDN / Germany zone 3
<31493> +proj=tmerc +lat_0=0.000000000 +lon_0=9.000000000 +k=1.000000 +x_0=3500000.000 +y_0=0.000 +ellps=bessel +units=m no_defs <>
+10
View File
@@ -0,0 +1,10 @@
function(cat IN_FILE OUT_FILE)
file(READ ${IN_FILE} CONTENTS)
file(APPEND ${OUT_FILE} "${CONTENTS}")
endfunction()
file(WRITE "${ALL_SQL_IN}" "")
include(sql_filelist.cmake)
foreach(SQL_FILE ${SQL_FILES})
cat(${SQL_FILE} "${ALL_SQL_IN}")
endforeach()
-81
View File
@@ -1,81 +0,0 @@
function(cat IN_FILE OUT_FILE)
file(READ ${IN_FILE} CONTENTS)
file(APPEND ${OUT_FILE} "${CONTENTS}")
endfunction()
# Generates a all.sql.in file from all the individual .sql files, taking
# into account if extra validation checks must be done before inserting data
# records
function(generate_all_sql_in ALL_SQL_IN_FILENAME EXTRA_VALIDATION OUT_MD5)
set(PROJ_DB_EXTRA_VALIDATION ${EXTRA_VALIDATION})
file(WRITE "${ALL_SQL_IN_FILENAME}" "")
include(sql_filelist.cmake)
foreach(SQL_FILE ${SQL_FILES})
cat(${SQL_FILE} "${ALL_SQL_IN_FILENAME}")
endforeach()
# Compute the MD5 before any records in the metadata table, to avoid
# refreshing the MD5 if we bump PROJ_VERSION or PROJ_DATA.VERSION
file(READ ${ALL_SQL_IN_FILENAME} CONTENTS)
string(REGEX REPLACE "INSERT INTO \\\"metadata\\\"[^\n]*\n?" "" CONTENTS_WITHOUT_METADATA "${CONTENTS}")
string(MD5 OUT_MD5_LOCAL "${CONTENTS_WITHOUT_METADATA}")
set(${OUT_MD5} "${OUT_MD5_LOCAL}" PARENT_SCOPE)
# Do ${PROJ_VERSION} substitution
string(REPLACE "\${PROJ_VERSION}" "${PROJ_VERSION}" CONTENTS_MOD "${CONTENTS}")
file(WRITE "${ALL_SQL_IN_FILENAME}" "${CONTENTS_MOD}")
endfunction()
generate_all_sql_in("${ALL_SQL_IN}" OFF PROJ_DB_SQL_MD5)
file(WRITE "${DATA_BINARY_DIR}/PROJ_DB_SQL_MD5.h" "const char* PROJ_DB_SQL_MD5=\"${PROJ_DB_SQL_MD5}\";\n")
if (NOT "${PROJ_DB_SQL_MD5}" STREQUAL "${PROJ_DB_SQL_EXPECTED_MD5}")
message(WARNING "all.sql.in content has changed. Running extra validation checks when building proj.db...")
set(ALL_SQL_IN_EXTRA_VALIDATION "${ALL_SQL_IN}.extra_validation")
generate_all_sql_in("${ALL_SQL_IN_EXTRA_VALIDATION}" ON PROJ_DB_SQL_EXTRA_VALIDATION_MD5)
set(PROJ_DB_EXTRA_VALIDATION_FILENAME "${PROJ_DB}.extra_validation")
file(REMOVE "${PROJ_DB_EXTRA_VALIDATION_FILENAME}")
execute_process(COMMAND "${EXE_SQLITE3}" "${PROJ_DB_EXTRA_VALIDATION_FILENAME}"
INPUT_FILE "${ALL_SQL_IN_EXTRA_VALIDATION}"
RESULT_VARIABLE STATUS)
if(STATUS AND NOT STATUS EQUAL 0)
message(FATAL_ERROR "Build of proj.db from ${ALL_SQL_IN_EXTRA_VALIDATION} failed")
else()
message(FATAL_ERROR "Database is valid; please update data/sql/proj.db.sql.expected.md5 with ${PROJ_DB_SQL_MD5}")
endif()
endif()
set(generate_proj_db ON)
if(IS_DIRECTORY ${PROJ_DB_CACHE_DIR})
set(USE_PROJ_DB_CACHE_DIR TRUE)
set(PROJ_DB_SQL_MD5_FILE "${PROJ_DB_CACHE_DIR}/proj.db.sql.md5")
if(EXISTS "${PROJ_DB_SQL_MD5_FILE}")
file(STRINGS "${PROJ_DB_SQL_MD5_FILE}" CACHED_PROJ_DB_SQL_MD5 LIMIT_COUNT 1)
endif()
file(MD5 "${ALL_SQL_IN}" PROJ_DB_SQL_MD5)
set(CACHED_PROJ_DB "${PROJ_DB_CACHE_DIR}/proj.db")
if("${PROJ_DB_SQL_MD5}" STREQUAL "${CACHED_PROJ_DB_SQL_MD5}" AND EXISTS "${CACHED_PROJ_DB}")
message(STATUS "Reusing cached proj.db from ${PROJ_DB_CACHE_DIR}")
get_filename_component(PROJ_DB_DIR "${PROJ_DB}" DIRECTORY)
file(COPY "${CACHED_PROJ_DB}" DESTINATION "${PROJ_DB_DIR}")
file(TOUCH "${PROJ_DB}")
set(generate_proj_db OFF)
endif()
endif()
if (generate_proj_db)
execute_process(COMMAND "${EXE_SQLITE3}" "${PROJ_DB}"
INPUT_FILE "${ALL_SQL_IN}"
RESULT_VARIABLE STATUS)
if(STATUS AND NOT STATUS EQUAL 0)
message(FATAL_ERROR "Build of proj.db failed")
elseif(USE_PROJ_DB_CACHE_DIR)
message(STATUS "Saving cache: ${CACHED_PROJ_DB}")
file(COPY "${PROJ_DB}" DESTINATION "${PROJ_DB_CACHE_DIR}")
file(WRITE "${PROJ_DB_SQL_MD5_FILE}" "${PROJ_DB_SQL_MD5}\n")
endif()
endif()
BIN
View File
Binary file not shown.
-59
View File
@@ -1,59 +0,0 @@
[general]
; Lines starting by ; are commented lines.
;
; Network capabilities disabled by default.
; Can be overridden with the PROJ_NETWORK=ON environment variable.
; Cf https://proj.org/en/latest/usage/network.html
; Valid values = on, off
network = off
; Endpoint of the Content Delivery Network where remote resources might
; be accessed. Only used if network access is allowed (cf above "network"
; option)
; Can be overridden with the PROJ_NETWORK_ENDPOINT environment variable.
cdn_endpoint = https://cdn.proj.org
; Whether to enable a cache of remote resources that are accessed, on the
; local file system
; Valid values = on, off
cache_enabled = on
; Size of the cache in megabytes
cache_size_MB = 300
; Time-to-live delay in seconds before already accessed remote resources are
; accessed again to check if they have been updated.
cache_ttl_sec = 86400
; Can be set to on so that by default the lack of a known resource files needed
; for the best transformation PROJ would normally use causes an error, or off
; to accept missing resource files without errors or warnings.
; This default value itself is overridden by the PROJ_ONLY_BEST_DEFAULT environment
; variable if set, and then by the ONLY_BEST setting that can be
; passed to the proj_create_crs_to_crs() method, or with the --only-best
; option of the cs2cs program.
; (added in PROJ 9.2)
; Valid values = on, off
only_best_default = off
; Filename of the Certificate Authority (CA) bundle.
; Can be overridden with the PROJ_CURL_CA_BUNDLE / CURL_CA_BUNDLE environment variable.
; (added in PROJ 9.0)
; ca_bundle_path = /path/to/cabundle.pem
; When this is set to on, the operating systems native CA store will be used for certificate verification
; If you set this option to on and also set ca_bundle_path then during verification those certificates are
; searched in addition to the native CA store.
; (added in PROJ 9.6)
; Valid values = on, off
;native_ca = on
; Transverse Mercator (and UTM) default algorithm: auto, evenden_snyder or poder_engsager
; * evenden_snyder is the fastest, but less accurate far from central meridian
; * poder_engsager is slower, but more accurate far from central meridian
; * default will auto-select between the two above depending on the coordinate
; to transform and will use evenden_snyder if the error in doing so is below
; 0.1 mm (for an ellipsoid of the size of Earth)
tmerc_default_algo = poder_engsager
+34
View File
@@ -0,0 +1,34 @@
3d18'0.31206816" 43d26'52.07156484" 0.0 3d18'0.91471" 43d26'52.077" 0.000
600000.0000 2600545.4523 0.0000 652760.737 7033791.245 0.000
135638.3592 2418760.4094 0.0000 187194.062 6855928.882 0.000
998137.3947 2413822.2844 0.0000 1049052.257 6843776.562 0.000
600000.0000 2200000.0000 0.0000 649398.871 6633524.192 0.000
311552.5340 1906457.4840 0.0000 358799.172 6342652.486 0.000
960488.4138 1910172.8812 0.0000 1007068.686 6340907.237 0.000
600000.0000 1699510.8340 0.0000 645204.279 6133556.746 0.000
1203792.5981 626873.17210 0.0000 1247610.438 6055822.838 0.000
600000.0000 2600545.4523 0.0000 179040.148 5610495.275 0.000
135638.3592 2418760.4094 0.0000 -303729.363 5410118.356 0.000
998137.3947 2413822.2844 0.0000 592842.792 5410120.554 0.000
600000.0000 2200000.0000 0.0000 179041.670 5209746.080 0.000
311552.5340 1906457.4840 0.0000 -96825.465 4909184.136 0.000
960488.4138 1910172.8812 0.0000 523880.019 4909191.141 0.000
600000.0000 1699510.8340 0.0000 179047.633 4708817.007 0.000
1203792.5981 626873.17210 0.0000 658287.395 3623739.237 0.000
2d20'11.4239243" 50d23'59.7718445" 0.0 179040.151 5610495.281 0.000
-3d57'49.4051448" 48d35'59.7121716" 0.0 -303729.365 5410118.352 0.000
7d44'12.1439796" 48d35'59.7832558" 0.0 592842.794 5410120.550 0.000
2d20'11.4951975" 46d47'59.8029841" 0.0 179041.668 5209746.077 0.000
-1d15'48.9240599" 44d05'59.8251878" 0.0 -96825.467 4909184.138 0.000
6d50'12.2276489" 44d06'00.0517019" 0.0 523880.022 4909191.143 0.000
2d20'11.7754730" 42d18'00.0824436" 0.0 179047.634 4708817.010 0.000
9d32'12.6680218" 41d24'00.3542556" 0.0 730783.054 4608637.873 0.000
2d20'11.4239243" 50d23'59.7718445" 0.0 260098.730 6140682.441 0.000
-3d57'49.4051448" 48d35'59.7121716" 0.0 -441239.699 5880610.004 0.000
7d44'12.1439796" 48d35'59.7832558" 0.0 861246.246 5880612.827 0.000
2d20'11.4951975" 46d47'59.8029841" 0.0 260100.934 5625762.156 0.000
-1d15'48.9240599" 44d05'59.8251878" 0.0 -140662.197 5252490.165 0.000
6d50'12.2276489" 44d06'00.0517019" 0.0 761061.291 5252498.745 0.000
2d20'11.7754730" 42d18'00.0824436" 0.0 260109.601 5009175.714 0.000
9d32'12.6680218" 41d24'00.3542556" 0.0 1061637.534 4889066.592 0.000
3356123.5400 1303218.3090 5247430.6050 3353421.023 1304074.545 5248934.985

Some files were not shown because too many files have changed in this diff Show More