Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

union return null #172

Open
Boka opened this issue Jan 13, 2020 · 5 comments
Open

union return null #172

Boka opened this issue Jan 13, 2020 · 5 comments

Comments

@Boka
Copy link

Boka commented Jan 13, 2020

Hi,
I ran the following code example and I keep having null in $combined_poly var...
is there something that I'm doing wrong?
sorry to bother
ciao
GL

            $poly1 = \geoPHP::load('POLYGON((30 10,10 20,20 40,40 40,30 10))','wkt');
            $poly2 = \geoPHP::load('POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30, 35 35, 30 20, 20 30))','wkt');
            $combined_poly = $poly1->union($poly2);
            $kml = $combined_poly->out('kml');
@mprins
Copy link
Contributor

mprins commented Apr 30, 2021

union requires the native Geos module with PHP bindings compiled

@MurzNN
Copy link

MurzNN commented Oct 22, 2021

Thanks for the tip! Will be good to throw an exception of missing Geos module, instead of silently returning null.

@BathoryPeter
Copy link

You may give a try to my fork. It also throws exception if Geos is missing.

See the union method:
https://github.com/funiq/geoPHP/blob/master/src/Geometry/Geometry.php#L672

@MurzNN
Copy link

MurzNN commented Oct 22, 2021

Wow, cool, thanks @BathoryPeter! Maybe create a PR to main repo with this your exception enhancement?

@BathoryPeter
Copy link

I had a pull request: #125.

Unfortunately, this repo hasn't been maintained for years.

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

No branches or pull requests

4 participants