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

fortyninemaps / picogeojson / 41
95%
master: 95%

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

Jobs
ID Job ID Ran Files Coverage
1 41.1 (PICOGEOJSON_PYJSON=0) 24 Apr 2017 03:17AM UTC 0
94.67
Travis Job 41.1
2 41.2 (PICOGEOJSON_PYJSON=1) 24 Apr 2017 03:17AM UTC 0
94.47
Travis Job 41.2
3 41.3 (PICOGEOJSON_PYJSON=0) 24 Apr 2017 03:17AM UTC 0
94.67
Travis Job 41.3
4 41.4 (PICOGEOJSON_PYJSON=1) 24 Apr 2017 03:17AM UTC 0
94.47
Travis Job 41.4
5 41.5 (PICOGEOJSON_PYJSON=0) 24 Apr 2017 03:17AM UTC 0
94.67
Travis Job 41.5
6 41.6 (PICOGEOJSON_PYJSON=1) 24 Apr 2017 03:17AM UTC 0
94.47
Travis Job 41.6
7 41.7 (PICOGEOJSON_PYJSON=0) 24 Apr 2017 03:17AM UTC 0
94.67
Travis Job 41.7
8 41.8 (PICOGEOJSON_PYJSON=1) 24 Apr 2017 03:17AM UTC 0
94.47
Travis Job 41.8
Source Files on build 41
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #41
  • 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