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

fortyninemaps / picogeojson / 42
95%

Build:
DEFAULT BRANCH: master
Ran 24 Apr 2017 03:22AM UTC
Jobs 8
Files 28
Run time 1min
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

pending completion
42

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

Jobs
ID Job ID Ran Files Coverage
1 42.1 (PICOGEOJSON_PYJSON=0) 24 Apr 2017 03:22AM UTC 0
94.67
Travis Job 42.1
2 42.2 (PICOGEOJSON_PYJSON=1) 24 Apr 2017 03:22AM UTC 0
94.47
Travis Job 42.2
3 42.3 (PICOGEOJSON_PYJSON=0) 24 Apr 2017 03:22AM UTC 0
94.67
Travis Job 42.3
4 42.4 (PICOGEOJSON_PYJSON=1) 24 Apr 2017 03:22AM UTC 0
94.47
Travis Job 42.4
5 42.5 (PICOGEOJSON_PYJSON=0) 24 Apr 2017 03:23AM UTC 0
94.67
Travis Job 42.5
6 42.6 (PICOGEOJSON_PYJSON=1) 24 Apr 2017 03:24AM UTC 0
94.47
Travis Job 42.6
7 42.7 (PICOGEOJSON_PYJSON=0) 24 Apr 2017 03:23AM UTC 0
94.67
Travis Job 42.7
8 42.8 (PICOGEOJSON_PYJSON=1) 24 Apr 2017 03:23AM UTC 0
94.47
Travis Job 42.8
Source Files on build 42
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #42
  • 17730464 on github
  • Prev Build on master (#40)
  • Next Build on master (#43)
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