• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

fortyninemaps / picogeojson
95%
master: 95%

Build:
Build:
LAST BUILD BRANCH: travis-matrix
DEFAULT BRANCH: master
Repo Added 22 Jan 2017 05:26AM UTC
Files 53
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH result_type
branch: result_type
CHANGE BRANCH
x
Reset
  • result_type
  • attrs
  • coveralls
  • generators
  • master
  • travis-matrix
  • v0.2.2
  • v0.3.0
  • v0.3.1
  • v0.4.0
  • v0.4.1
  • v0.4.2
  • v0.4.3
  • v0.4.4
  • v0.4.x
  • v0.5.0
  • v0.6.0
  • v0.6.1
  • v0.6.2
  • v0.6.3
  • v0.7.0

pending completion
41

push

travis-ci

njwilson23
implement GeoJSONResult type

GeoJSONResult makes it easier to read data from unknown sources
defensively. Rather than needing to carefully check the types of the
values returns from `fromstring` or `fromfile`, GeoJSONResult provides
generators to visit all geometries of a particular type in a result.

For example, if a string *s* is expected to contain at
GeometryCollection with multple Points, a bad approach is

    coords = [pt.coordinates for pt in fromstring(s).geometries]

while will fail at runtime if the types were not what we expected.
Previously we would have had to do something like

    geojson = fromstring(s)
    coords = []
    if isinstance(geojson, picogeojson.GeometryCollection):
        for item in geojson.geometries:
            if isinstance(item, picogeojson.Point):
                coords.append(geojson.coordinates)

raising the appropriate errors as needed. Now, we can do instead

    coords = [pt.coordinates for pt in result_fromstring(s)]

which collects all non-feature Points. Currently, GeoJSONResult provides
generators for Point, LineString, and Polygon types. MultiPoint,
MultiLineString, MultiPolygon, and Features will come in the future.

1856 of 1952 relevant lines covered (95.08%)

1.89 hits per line

Relevant lines Covered
Build:
Build:
1952 RELEVANT LINES 1856 COVERED LINES
1.89 HITS PER LINE
Source Files on result_type
Detailed source file information is not available for this build.

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
41 result_type implement GeoJSONResult type GeoJSONResult makes it easier to read data from unknown sources defensively. Rather than needing to carefully check the types of the values returns from `fromstring` or `fromfile`, GeoJSONResult provides generators to... push 24 Apr 2017 03:17AM UTC njwilson23 travis-ci pending completion  
See All Builds (76)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc