Skip to content

Missing postgis_sfcgal in alpine image #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Cactusbone opened this issue May 4, 2022 · 6 comments · Fixed by #343
Closed

Missing postgis_sfcgal in alpine image #293

Cactusbone opened this issue May 4, 2022 · 6 comments · Fixed by #343

Comments

@Cactusbone
Copy link

Using docker run --rm --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis:14-3.2-alpine AND docker run -it --rm --link some-postgres postgres psql postgresql://postgres:mysecretpassword@some-postgres -c "CREATE EXTENSION postgis_sfcgal;" -c "SELECT ST_AsGeoJSON(ST_StraightSkeleton(ST_GeomFromText('POLYGON (( 190 190, 10 190, 10 10, 190 10, 190 20, 160 30, 60 30, 60 130, 190 140, 190 190 ))')))"

I end up with

ERROR:  could not open extension control file "/usr/local/share/postgresql/extension/postgis_sfcgal.control": No such file or directory
ERROR:  function st_straightskeleton(geometry) does not exist
LINE 1: SELECT ST_AsGeoJSON(ST_StraightSkeleton(ST_GeomFromText('POL...

This works well with the debian version of the same image.

@ImreSamu
Copy link
Member

ImreSamu commented May 8, 2022

confirmed;
in the Alpine PostGIS build - the: SFCGAL support is disabled; ( as I see in the build log )

 --------------- Extensions --------------- 
  PostGIS Raster:                     enabled
  PostGIS Topology:                   enabled
  SFCGAL support:                     disabled
  Address Standardizer support:       enabled

Adding "SFCGAL support" is not so easy (now);

so NOW: the "debian version" is recommended.

@orca-hydromancer
Copy link

Adding "SFCGAL support" is not so easy (now);

How about now?

@ImreSamu
Copy link
Member

@orca-hydromancer :

How about now?

in the curent alpine:3.17 no cgal package yet:

@orca-hydromancer
Copy link

orca-hydromancer commented Jan 23, 2023

Is it a requirement it be a package in alpine? CGAL is headers only library now, easy to include. Its soft dependencies gmp and mpfr are available in Alpine.

@ImreSamu
Copy link
Member

ImreSamu commented Feb 1, 2023

Hi @orca-hydromancer

Is it a requirement it be a package in alpine?

(my personal opinion)
Ideally:

  • it is advisable to use the existing packages,
  • and try to build as few programs as possible.

In practice, it is not always possible to apply this strategy.

The best thing would be to have SFCGAL as a supported package in Alpine in the future:
https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/34158

CGAL is headers only library now, easy to include.

Yes, I'm currently testing with -master image ( #337 ),
and if there is no other solution, we really need to think about the pros and cons of the local SFCGAL builds in the Alpine.

If you have any specific suggestions on these, please let me know.

@ImreSamu
Copy link
Member

good news: sfcgal in the alpine:edge ( "edge" is a development branch )

~$ docker run -it --rm --network=host alpine:edge

/ # cat /etc/alpine-release
3.18_alpha20230208

/ # apk add sfcgal
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
(1/7) Installing libgcc (12.2.1_git20220924-r9)
(2/7) Installing boost1.81-serialization (1.81.0-r1)
(3/7) Installing gmp (6.2.1-r2)
(4/7) Installing libstdc++ (12.2.1_git20220924-r9)
(5/7) Installing libgmpxx (6.2.1-r2)
(6/7) Installing mpfr4 (4.2.0-r0)
(7/7) Installing sfcgal (1.4.1-r2)
OK: 20 MiB in 22 packages
/ # 

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

Successfully merging a pull request may close this issue.

3 participants