Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Perfection is achieved only on the point of collapse. -- C. N. Parkinson


devel / comp.lang.python / Shapely Polygon creating empty polygon

SubjectAuthor
o Shapely Polygon creating empty polygonIsrael Brewster

1
Shapely Polygon creating empty polygon

<mailman.100.1641337052.3079.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=20995&group=comp.lang.python#20995

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ijbrewster@alaska.edu (Israel Brewster)
Newsgroups: comp.lang.python
Subject: Shapely Polygon creating empty polygon
Date: Tue, 4 Jan 2022 13:57:26 -0900
Lines: 49
Message-ID: <mailman.100.1641337052.3079.python-list@python.org>
References: <2DB2FC25-8FEC-4063-BAFD-068AFC6DC89D@alaska.edu>
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de cjBzvLLUQmK2kh/4wJHJ5QlC8RDZzgwKSlkckzgdAK7A==
Return-Path: <ijbrewster@alaska.edu>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=alaska.edu header.i=@alaska.edu header.b=YY26g5gC;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.018
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'engineer': 0.02; '3.8':
0.05; 'cell:': 0.05; 'skip:5 30': 0.05; 'fact,': 0.09; 'output:':
0.09; 'skip:[ 20': 0.09; 'import': 0.15; '1),': 0.16; 'israel':
0.16; 'skip:5 20': 0.16; 'subject:creating': 0.16; 'work:': 0.16;
'python': 0.16; 'helvetica;': 0.19; 'to:addr:python-list': 0.20;
'issue': 0.21; 'code': 0.23; 'skip:p 30': 0.23; 'skip:- 10': 0.25;
'flask': 0.26; '>>>': 0.28; 'attempt': 0.31; 'empty': 0.32;
'to:name:python': 0.32; 'skip:2 10': 0.32; '0);': 0.33; 'rgb(0,':
0.33; 'someone': 0.34; 'same': 0.34; 'received:google.com': 0.34;
'running': 0.34; 'handling': 0.35; 'request': 0.35; 'missing':
0.37; 'received:209.85': 0.37; 'put': 0.38; 'received:209': 0.39;
'exact': 0.40; 'font-family:': 0.60; 'me.': 0.62; 'none;': 0.62;
'gives': 0.62; 'here': 0.62; 'font-weight:': 0.62; '0px;': 0.63;
'skip:b 10': 0.63; 'text-indent:': 0.64; 'normal;': 0.66; 'skip:e
20': 0.67; 'skip:9 10': 0.68; 'bounds': 0.84; 'geophysical': 0.84;
'skip:p 50': 0.84; 'received:10.25': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alaska.edu; s=google;
h=from:mime-version:subject:message-id:date:to;
bh=g7PNxKWozcq+3xRwtS24T7jibrH6qGG7eCSt617/0yo=;
b=YY26g5gC2nWa/xBIpXkkHPq00FYlZYk23v1v4myogShtxGXL7h5gzldgy8trIcDHcg
6LiZN0ZnPYYZaHjd8/JQoYzuna5YgQUmoz6IPtAg6Sa2mMqwIgxi82Pg5/POs88G5pzz
LVO7yADvI5VAbKyP+h/c7iUkbX8v/SGQu71O6BsZloUIfx6dujpOJTEDGUeJYTp5hwHv
+yVp2dfCrOBelG8foxPteViEAw9v80cjsQDApic0z8tW8DDFxJoGY7uIe/ntpdHz9nDJ
tebfKbMmQPoMYa18SbrNxYJtXPdkQOHr1PyY6dvwYupXgUTI4Xp+WknWl4+gZdLso9wR
nVQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:from:mime-version:subject:message-id:date:to;
bh=g7PNxKWozcq+3xRwtS24T7jibrH6qGG7eCSt617/0yo=;
b=JQxE3rBeWmXuLZYjiQ5JRgxoa9+wrU/E4rjl2VKuS4Nn4rEN7W1V649ONXhKMdWYSF
t/C/Ri2p5kZXfqVlzGnkfrE4sjMzMRC6PivtNNcARQ58JTWZbU0gfc9I9HNYoM1e6hIG
PouFWtSSlTXCaECzHxbAJmsWsw6X56cNwvUDhe93Atfv8l+GdExUESTkKhcTwD4UqliN
jKtG+YYkAXIEJUssAuOldY2ZK7FiOCa0QKIlexLjbSPssRouA9mIYWjHHxkWeuVqohhw
aCnpoRmwpyuWpZrN7DwlEpb6pVcLkWFviJ2zpesc8mT+Il1DZEclJ2Ia0Y+GEhjFfl6B
7LTQ==
X-Gm-Message-State: AOAM532UHxyBd9pUDl4BYEc8ouRdYDa8+3u72GGsmPy0YGIxsbmc9BfM
lgAEVW8cYXHpR6o5+TtMdCf2njeTs48KmaXbydTF3c5kV0SCTBm5aC46dhtekvzDtcAsEjFmd63
WMBbPUwW4cliNRJ7idrAb27sX9Vyiz/85058VzfoasBClivjPfNyaJ9tPb2+mZuhx2Xhx3w==
X-Google-Smtp-Source: ABdhPJxMpmTGWLDxxP8CH7hewAGO21OD8oacHfqwPTkftlvdBEZwvJIWTvb5QvbgYhTIOeG/9iutHQ==
X-Received: by 2002:a17:90a:fa0a:: with SMTP id
cm10mr642215pjb.222.1641337047973;
Tue, 04 Jan 2022 14:57:27 -0800 (PST)
X-Mailer: Apple Mail (2.3608.120.23.2.7)
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <2DB2FC25-8FEC-4063-BAFD-068AFC6DC89D@alaska.edu>
 by: Israel Brewster - Tue, 4 Jan 2022 22:57 UTC

I’m running into an issue with shapely that is baffling me. Perhaps someone here can help out?

When running shapely directly from a python 3.8 interpreter, it works as expected:

>>> import shapely
>>> shapely.__version__
'1.8.0'
>>> from shapely.geometry import Polygon
>>> bounds = [-164.29635821669632, 54.64251856269729, -163.7631779798799, 54.845450778742546]
>>> print(Polygon.from_bounds(*bounds))
POLYGON ((-164.2963582166963 54.64251856269729, -164.2963582166963 54.84545077874255, -163.7631779798799 54.84545077874255, -163.7631779798799 54.64251856269729, -164.2963582166963 54.64251856269729))

However, if I put this exact same code into my Flask app (currently running under the Flask development environment) as part of handling a request, I get an empty polygon:

>>> import shapely
>>> print(shapely.__version__)
>>> from shapely.geometry import Polygon
>>> print(Polygon.from_bounds(*bounds))

Output:

1.8.0
POLYGON EMPTY

In fact, *any* attempt to create a polygon gives the same result:
>>> test = Polygon(((1, 1), (2, 1), (2, 2)))
>>> print(test)
POLYGON EMPTY

What am I missing here? Why doesn’t it work as part of a Flask request call?
---
Israel Brewster
Software Engineer
Alaska Volcano Observatory
Geophysical Institute - UAF
2156 Koyukuk Drive
Fairbanks AK 99775-7320
Work: 907-474-5172
cell: 907-328-9145


devel / comp.lang.python / Shapely Polygon creating empty polygon

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor