koopjs / koop

Transform, query, and download geospatial data on the web.
http://koopjs.github.io
Other
654 stars 125 forks source link

Best way to access the info doc in FeatureService.js? #274

Closed sirws closed 7 years ago

sirws commented 8 years ago

I am looking to make a change to the koop provider to do a better job of handling field types. I am logging field types to the info doc. I want to get access to the info doc in FeatureService.js but I don't want to break the API. Any suggestions?

Thanks! Scott

dmfenton commented 8 years ago

I recommend passing in the field information you need with params https://github.com/koopjs/koop/blob/master/lib/FeatureServices.js#L305 It's going to require modifying the req.params object, but I think that's the only option you have. This module is due for a major refactor anyways, so I don't have a big problem with it.

sirws commented 8 years ago

How do you recommend accessing koop.cache from the BaseController so we can access the info doc?

dmfenton commented 8 years ago

I wouldn't recommend doing that at all. You should pass in whatever you need inside the params object.

sirws commented 8 years ago

It looks to me like the base controller sends in the params object. This is where I am confused.

dmfenton commented 8 years ago

You would need to modify the params object before calling controller.processFeatureServer. you should have already retrieved data from the db at that point

dmfenton commented 8 years ago

@sirws Params is on the req object here https://github.com/koopjs/koop-socrata/blob/master/controller/index.js#L209

dmfenton commented 7 years ago

All the feature server code has moved over to https://github.com/featureserver/featureserver