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

fortyninemaps / picogeojson / 41 / 6
95%
master: 95%

Build:
Build:
LAST BUILD BRANCH: travis-matrix
DEFAULT BRANCH: master
Ran 24 Apr 2017 03:17AM UTC
Files 7
Run time 0s
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

24 Apr 2017 03:16AM UTC coverage: 94.467%. First build
PICOGEOJSON_PYJSON=1

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.

461 of 488 relevant lines covered (94.47%)

0.94 hits per line

Source Files on job 41.6 (PICOGEOJSON_PYJSON=1)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 41
  • Travis Job 41.6
  • 17730464 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