koopjs / koop-app-example

A Koop express application example with some common providers.
Other
23 stars 35 forks source link

clicking 'map gist' on koop homepage blows up the application #26

Closed jgravois closed 7 years ago

jgravois commented 8 years ago

koop-sample-app - db8d876723c5bb23bca91f6ee88a0c5a572cc446 koop - 2.7.2 koop-gist - 1.1.1 datastore - postgis

console:

$ npm start
> koop-sample-app@1.0.3 start /Users/john6251/github/koop-sample-app
> node server.js
...
info: registered provider: Gist 1.1.1
...
debug: Selecting data select id, feature->'properties' as props, feature->'geometry' as geom from "Gist:6178185:0" WHERE 1=1 AND ST_GeomFromGeoJSON(feature->>'geometry') && ST_SetSRID('BOX3D(0 66.51326044311188,90 85.0511287798066)'::box3d,4326) ORDER BY id
_http_outgoing.js:335
    throw new Error('Can\'t set headers after they are sent.');
    ^

Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
    at ServerResponse.header (/Users/john6251/github/koop-sample-app/node_modules/express/lib/response.js:718:10)
    at ServerResponse.send (/Users/john6251/github/koop-sample-app/node_modules/express/lib/response.js:163:12)
    at ServerResponse.jsonp (/Users/john6251/github/koop-sample-app/node_modules/express/lib/response.js:317:15)
    at Object.processFeatureServer (/Users/john6251/github/koop-sample-app/node_modules/koop-gist/node_modules/koop-provider/controller.js:27:35)
    at /Users/john6251/github/koop-sample-app/node_modules/koop-gist/controller/index.js:83:12
    at /Users/john6251/github/koop-sample-app/node_modules/koop-gist/model/index.js:46:29
    at /Users/john6251/github/koop-sample-app/node_modules/koop/lib/Cache.js:22:27
    at /Users/john6251/github/koop-sample-app/node_modules/koop-pgcache/index.js:818:11
    at null.callback (/Users/john6251/github/koop-sample-app/node_modules/koop-pgcache/index.js:1104:11)
ungoldman commented 8 years ago

That ain't good. thanks for spotting that @jgravois, I'll look into it.

ungoldman commented 8 years ago

Should work now.

ungoldman commented 8 years ago

Actually I think I'm wrong, I switched the test gist. 6178185 has multiple geojson files and the one I replaced it with for my local testing does not. I think there may be an issue between koop-gist and koop-pgcache in relation to gists with multiple geojson files.

dmfenton commented 7 years ago

koop-gist is no longer included in the sample application.