Giter Club home page Giter Club logo

featureserver's People

Contributors

ahamilt avatar brightgarden avatar butchgis avatar calvinmetcalf avatar dependabot[bot] avatar dhatcher avatar greenkeeper[bot] avatar hparkertt avatar lawriege avatar mbrownkinetica avatar rengaprakash avatar renovate[bot] avatar rgwozdz avatar rrabb avatar rsjones avatar schmidtk avatar thomas-hervey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

featureserver's Issues

Providers with metadata that includes an idField get faulty fields array

If a provider denotes an idField in its metadata, the FeatureServers layer info service returns a fields array that contains both an OBJECTID field object as well as a separate object representing the provider's idField. For example, if the provider's metadata has idField: 'featureId' the the layer services field array will contain:

[       
  {
    "name": "OBJECTID",
    "type": "esriFieldTypeOID",
    "alias": "OBJECTID",
    "defaultValue": null,
    "domain": null,
    "editable": false,
    "nullable": false,
    "sqlType": "sqlTypeOther"
  },
  {
    "name": "featureId",
    "type": "esriFieldTypeInteger",
    "alias": "featureId",
    "defaultValue": null,
    "domain": null,
    "editable": false,
    "nullable": false,
    "sqlType": "sqlTypeOther"
  }
]

However, the query service squashes the two above field objects together into one object in the fields array.

{
  "name": "featureId",
  "type": "esriFieldTypeOID",
  "alias": "featureId",
  "sqlType": "sqlTypeOther",
  "domain": null,
  "defaultValue": null
}

The upshot is that the layer and query services have fields arrays of different lengths, and the query service doesn't have a field with name OBJECTID which causes client errors.

An in-range update of winnow is breaking the build 🚨

Version 1.12.6 of winnow was just published.

Branch Build failing 🚨
Dependency winnow
Current Version 1.12.5
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

winnow is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 6 commits.

  • 6b5fee6 :package: 1.12.6
  • 4de7581 update changelog
  • cfa88c7 Feature / Use AST to translate WHERE clause (#54)
  • 92c8f16 chore(package): update buble to version 0.17.0 (#49)
  • bc0bfcc fix(package): update @turf/centroid to version 5.0.4 (#51)
  • dd805fb fix exception in sql w/ null feature (#52)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Error when returnCountOnly=true and resulting count=0

When processing a request where returnCountOnly=true but the where clause is such that no features match so the resulting count is 0, I get the following error:

SELECT properties as attributes, esriGeom(geometry) as geometry FROM ? LIMIT 2000 { returnCountOnly: true,
  limit: 2000,
  toEsri: true,
  collection: undefined,
  where: undefined,
  geometry: undefined,
  spatialPredicate: undefined,
  fields: undefined,
  order: undefined,
  aggregates: undefined,
  groupBy: undefined,
  offset: undefined,
Trace: TypeError: features.some is not a function
  projection: undefined,
    at limitQuery (/koop-provider-marklogic/build/koop/node_modules/winnow/dist/executeQuery.js:39:12)
  classification: undefined,
    at Object.Winnow.query (/koop-provider-marklogic/build/koop/node_modules/winnow/dist/index.js:34:36)
  dateFields: [] }
    at query (/koop-provider-marklogic/build/koop/node_modules/featureserver/dist/query.js:32:56)
    at execQuery (/koop-provider-marklogic/build/koop/node_modules/featureserver/dist/route.js:43:16)
    at Object.route (/koop-provider-marklogic/build/koop/node_modules/featureserver/dist/route.js:32:14)
    at /koop-provider-marklogic/build/koop/node_modules/koop-output-geoservices/index.js:9:24
    at /koop-provider-marklogic/build/koop/node_modules/koop/dist/models/index.js:15:9
    at mq.providerGetData.then.data (/koop-provider-marklogic/build/koop/marklogic.js:41:8)
    at execQuery (/koop-provider-marklogic/build/koop/node_modules/featureserver/dist/route.js:45:52)
    at Object.route (/koop-provider-marklogic/build/koop/node_modules/featureserver/dist/route.js:32:14)
    at /koop-provider-marklogic/build/koop/node_modules/koop-output-geoservices/index.js:9:24
    at /koop-provider-marklogic/build/koop/node_modules/koop/dist/models/index.js:15:9
    at mq.providerGetData.then.data (/koop-provider-marklogic/build/koop/marklogic.js:41:8)

Changing the query to return a count other than 0 works fine.

The result returned from the getData() function looks like this

{ type: 'FeatureCollection',
  metadata: { name: 'GDeltGKG' },
  filtersApplied: { geometry: true, where: true, offset: true },
  count: 0 }

The layer descriptor does not set the "id" property

When requesting the descriptor for a layer like

/<service>/FeatureServer/3

The id property in the response is always 0 but it should be the id of the layer requested. My provider implementation returns an id attribute in the metadata section but this is ignored as well.

Dynamic assignment of string and date length properties

In the fields array of responses, objects of type string and date have a length property that is automatically set to 128 and 36, respectively. We might want to consider having the set value sourced to the provider with a default and a max value check.

POST to FeatureServer returns 404

Request:

POST http://koop.dc.esri.com/github/smartchicago/chicago-atlas/db::import::zipcodes/FeatureServer/0/query HTTP/1.1
Accept: */*
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: ArcGIS Pro 1.3.1 - ArcGIS Pro
Host: koop.dc.esri.com
Content-Length: 66
Connection: Keep-Alive
Pragma: no-cache

f=json&returnCountOnly=true&where=1%20%3d%201&returnGeometry=false

Response: Cannot POST /github/smartchicago/chicago-atlas/db::import::zipcodes/FeatureServer/0/query

image

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Can't Elect to Skip Winnow Query

Would it be possible to add a new property to the filtersApplied object that would optionally skip the Winnow query all together?

Maybe something like (open to suggestions):
filtersApplied.skipWinnowQuery

Background
I'm currently using Koop as a pass-through provider where we are doing all of the filtering, offset, and limiting directly in the database call. I marked the filtersApplied.where and filtersApplied.geometry to true, but I received an error like this:

OFFSET >= features length: [object Object]

After some digging, I deduced that Winnow was trying to execute an additional query against my dataset, which we don't need for our application of Koop. Adding an optional parameter that allows the user to skip that query would be a huge help.

I am happy to provide the PR if requested. Thanks!

Update
I think there is more to this issue than I previously thought. I am going to close it for now until I can dig a little deeper.

Object IDs collide when FeatureServer/Winnow generates them

When there is nothing specified in metadata.idField FeatureServer (by way of Winnow) will generate objectids automatically starting from zero. Because it always starts from zero you could have different source features given the same objectid. This results in bugs due to caching by ArcGIS clients.

Relevant code is here:

https://github.com/koopjs/winnow/blob/master/src/executeQuery.js#L66
https://github.com/koopjs/winnow/blob/master/src/executeQuery.js#L79-L84

FeatureServer and Winnow should avoid this situation with a more intelligent way of generating object ids.

Some options:

  1. don't generate an objectid automatically at all (this may break some clients)
  2. calculate a numeric hash of a feature (this may hurt performance)
  3. generate a random object id per feature (unknown effect on arcgis clients)
  4. add a numeric prefix that maps to the source request where the source features were requested (may be some complex logic here if the clients try to query the source for the same individual feature)

The FeatureServer/layers route is not working for tables

There is code that tries to recognize when a layer is actually a table but this is not working when the metadata is actually for a table.

The provider returns this for the metadata:

          id: 1,
          name: 'All',
          decription: 'All US ZIP code boundaries (table-only)',
          idField: 'OBJECTID',
          displayField: 'zipcode',

No extents and no geometryType are set.

This results in the following stack trace:

Trace: TypeError: features.forEach is not a function
    at module.exports (/koop/node_modules/esri-extent/index.js:8:12)
    at Object.getExtent (/koop/node_modules/featureserver/dist/utils.js:24:17)
    at /koop/node_modules/featureserver/dist/info.js:83:29
    at Array.forEach (native)
    at Object.layersInfo (/koop/node_modules/featureserver/dist/info.js:82:10)
    at execInfo (/koop/node_modules/featureserver/dist/route.js:73:21)
    at Object.route (/koop/node_modules/featureserver/dist/route.js:36:14)
    at /koop/node_modules/koop-output-geoservices/index.js:9:24
    at /koop/node_modules/koop/dist/models/index.js:15:9
    at mq.providerGetData.then.data (/koop/marklogic.js:45:8)
    at execInfo (/koop/node_modules/featureserver/dist/route.js:80:52)
    at Object.route (/koop/node_modules/featureserver/dist/route.js:36:14)
    at /koop/node_modules/koop-output-geoservices/index.js:9:24
    at /koop/node_modules/koop/dist/models/index.js:15:9
    at mq.providerGetData.then.data (/koop/marklogic.js:45:8)

Add ability to send custom symbology for feature server

You currently have to over the point.json (or line, fill-symbol, polygon) files in \node_modules\featureserver\templates\renderers\symbology to override FeatureServer symbology. Please add the ability to pass a custom json file at the provider level.

Allow providers to control the fields in the /FeatureServer/<layer num> response

Per the http://<featureservice-url>/<layerId> spec here http://resources.arcgis.com/en/help/arcgis-rest-api/#/Layer/02r3000000w6000000/, there are many properties that can be returned to describe each layer. Some of these would be dictated by the features that koop supports but many of them are really the responsibility of the provider to specify them.

For example, timeInfo and relationships should be able to be specified via the provider.

At a minimum, can you specify which of the properties the provider can control and what metadata property to use to set them?

`exceededTransferLimit` is always false

Related to #53...

We have a pass-through Koop provider, with a maxRecordCount of 1000.

Unfortunately the Koop Feature Service is always showing exceededTransferLimit as false, even when the SCF API returns a total record count of 26,810 (e.g.). I've verified (via console logging) that geojson.metadata.limitExceeded is correcting being set to true inside our Koop provider.

Has anyone else had any problems like this?

Draft timeInfo needs

adding a timeInfo object as an optional addition to the Feature Service endpoint would allow koop-based services to appear to be time-aware for ArcGIS clients. timeInfo defines several basic items:

  • startTimeField: field used as the start timestamp for a feature
  • endTimeField: field used as the end timestamp for a feature
  • timeExtent: [, ] in epoch milliseconds
  • timeReference
    • timeZone
    • respectsDaylightSaving
  • timeRelation
  • defaultTimeInterval
  • defaultTimeIntervalUnits
  • defaultTimeWindow
  • hasLiveData

Support conversion of ISO 8601 dates to esriFieldTypeDate

The feature server currently recognizes strings that are formatted as ISO 8601 date formats in provider features as esriFieldTypeDate. The values for these fields should actually be milliseconds since epoch (January 1, 1970) in UTC though so they need to be converted in the response.

This creates a defined contract between the FeatureServer and koop providers that says that all date fields returned by a provider must be in ISO 8601 formatted strings and that the FeatureServer will convert those to milliseconds since epoch in UTC.

The OBJECTID field type is not set correctly

When generating a layer descriptor response using field metadata from a provider, OBJECTID fields are set to type esriFieldTypeInteger.

My provider is setting the field type for the OBJECTID field to "Integer" and this results in a the type in the layer descriptor response to be esriFieldTypeInteger. If I do not include field metadata for OBJECTID, koop sets it to the correct type of esriFieldTypeOID.

Is there a type that the provider should specify in the metadata to indicate that the field is an OID?

Query with OutStatistics - No results returned

Using Koop 3.5.1

Request: https://koop-three.herokuapp.com/chicagoFood/FeatureServer/0/query?f=json&where=&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=*&groupByFieldsForStatistics=risk&outStatistics=%5B%7B%22statisticType%22%3A%22count%22%2C%22onStatisticField%22%3A%22risk%22%2C%22outStatisticFieldName%22%3A%22countOFrisk%22%7D%5D&outSR=102100

The call doesn't fail, but there are no results returned. There should be multiple categories that come back such has "Risk 1 (High)" and "Risk 3 (Low)". Noticed this when trying to bring in this Koop URL to the web map viewer and symbolize by the "risk" column.

Source GeoJSON @ https://data.cityofchicago.org/resource/cwig-ma7x.geojson

Some sample results for this column come back in a simple query: https://koop-three.herokuapp.com/chicagoFood/FeatureServer/0/query?where=1=1&outFields=risk

Time enabled layer

i am curious how to set up the feature service output to be time enabled (and z value for that matter) so that we can use the time sliders in portal for arcgis or agol.

I have hacked together a provider that does this but would much rather this be part of the core product.

An in-range update of mocha is breaking the build 🚨

Version 3.4.0 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v3.4.0

Mocha is now moving to a quicker release schedule: when non-breaking changes are merged, a release should happen that week.

This week's highlights:

  • allowUncaught added to commandline as --allow-uncaught (and bugfixed)
  • warning-related Node flags

🎉 Enhancements

🐛 Fixes

🔩 Other

Commits

The new version differs by 9 commits0.

  • 7554b31 Add Changelog for v3.4.0
  • 9f7f7ed Add --trace-warnings flag
  • 92561c8 Add --no-warnings flag
  • ceee976 lint test/integration/fixtures/simple-reporter.js
  • dcfc094 Revert "use semistandard directly"
  • 93392dd no special case for macOS running Karma locally
  • 4d1d91d --allow-uncaught cli option
  • fb1e083 fix allowUncaught in browser
  • 4ed3fc5 Add license report and scan status

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Why are string field lengths set to 128?

A recent change set the length property of string fields to 128. Why was that done? Is 128 characters the maximum length of a string field? I do not see that documented anywhere.

geometryType of esriGeometryPoint not supported

According to the Esri documentation https://resources.arcgis.com/en/help/rest/apiref/fsservicequery.html, queries like

query?geometryType=esriGeometryPoint&geometry=-122.2465038,37.5073428

should be supported but they result in the following stacktarce :

Error: bbox must be an Array of 4 or 6 numbers
at Object.validateBBox (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules//main.js:694:55)
at bboxPolygon (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules//main.js:20:13)
at module.exports (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/winnow/dist/geometry/transform-array.js:3:10)
at normalizeGeometry (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/winnow/dist/options/normalizeOptions.js:66:16)
at Object.prepare (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/winnow/dist/options/index.js:23:15)
at Model.getData (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/marklogic.js:25:28)
at /Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/koop/dist/models/index.js:13:14
at Cache.retrieve (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/koop-cache-memory/dist/index.js:75:38)
at Model.pull (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/koop/dist/models/index.js:9:14)
at Controller.Geoservices.featureServer (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/koop-output-geoservices/index.js:7:14)
at Layer.handle [as handle_request] (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/express/lib/router/layer.js:95:5)
at next (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/express/lib/router/layer.js:95:5)
at /Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/express/lib/router/index.js:281:22
at param (/Projects/github/ESRI/koop44/koop-provider-marklogic/build/koop/node_modules/express/lib/router/index.js:354:14)

Note that spatialRel is not specified so it should default to esriSpatialRelIntersects

Empty URL parameters result in 0 value in provider parameters

Is it expected behavior for koop to turn empty parameters into 0 in the params passed to the provider? E.g., the following URL:

GDeltGKG/FeatureServer/3/query?f=json&orderByFields=

results in the following JSON params passed to the provider:

params: { id: GDeltGKG, layer: 3, method: query }, query: { f: json, orderByFields: 0 } }

Note that orderByFields is the number 0.

AGOL integration

CLOSE THIS: This has to do with self signed HTTPS cert. Tested with a good SSL and all works fine.

--- original text----

I am not sure what is going on AGOL side but when loading up a koop map (webmap viewer) it makes a call back to AGOL for server side parsing of the koop layer definition file
ex. https://myOrg.maps.arcgis.com/sharing/proxy?https://100.14.60.227:12004/koop/arcgis/rest/services/koop/htrack-locations/FeatureServer/0?f=json
And only on that request does it 500. All the rest of the requests goto koop directly and work fine. I am not sure if that is critical or not. It seems to be some sort of feature detection server side. Oddly enough it seems like that only affects the rendering of the data if that call comes back instantaneous. If its is slowed down enough that the layer queries come back at roughly the same time things render properly. If I find anything I will update this ticket.

I am not sure this is relevant to the project but I thought I would throw it out there.

Logging of request objects appeared in a recent update

After one of the recent updates (I'm not sure which one), there is logging that is outputting the query object to the console. It appears that it is code that is executed after the provider responds that is logging the requests.

Is there a way to disable it?

Queries that return no results throw an error

If the provider returns a response with an empty features array, the following error response is returned from koop:

{"error":"Cannot read property 'properties' of undefined"}

This happens a lot when extents are broken into a grid and each region is request separately as there will likely be some regions that have zero results.

Here's the trace

Trace: TypeError: Cannot read property 'properties' of undefined
    at normalizeCollection (/home/jkerr/projects/koop-provider-marklogic/node_modules/winnow/dist/options.js:36:41)
    at Object.prepare (/home/jkerr/projects/koop-provider-marklogic/node_modules/winnow/dist/options.js:15:17)
    at Object.Winnow.query (/home/jkerr/projects/koop-provider-marklogic/node_modules/winnow/dist/index.js:22:21)
    at query (/home/jkerr/projects/koop-provider-marklogic/node_modules/featureserver/dist/query.js:24:28)
    at execQuery (/home/jkerr/projects/koop-provider-marklogic/node_modules/featureserver/dist/route.js:44:16)
    at Object.route (/home/jkerr/projects/koop-provider-marklogic/node_modules/featureserver/dist/route.js:30:14)
    at /home/jkerr/projects/koop-provider-marklogic/node_modules/koop-output-geoservices/index.js:9:24
    at /home/jkerr/projects/koop-provider-marklogic/node_modules/koop/dist/models/index.js:15:9
    at mq.providerGetData.then.data (/home/jkerr/projects/koop-provider-marklogic/marklogic.js:40:8)
    at execQuery (/home/jkerr/projects/koop-provider-marklogic/node_modules/featureserver/dist/route.js:46:52)
    at Object.route (/home/jkerr/projects/koop-provider-marklogic/node_modules/featureserver/dist/route.js:30:14)
    at /home/jkerr/projects/koop-provider-marklogic/node_modules/koop-output-geoservices/index.js:9:24
    at /home/jkerr/projects/koop-provider-marklogic/node_modules/koop/dist/models/index.js:15:9
    at mq.providerGetData.then.data (/home/jkerr/projects/koop-provider-marklogic/marklogic.js:40:8)

An in-range update of winnow is breaking the build 🚨

Version 1.10.0 of winnow just got published.

Branch Build failing 🚨
Dependency winnow
Current Version 1.9.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

winnow is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v1.10.0

Added

  • Detect field types if they are not passed in with geojson.metadata
  • Translate ISO Date Strings to Unix Timestamps when options.toEsri is true
  • Add Object IDs if there is no ID field set with options.toEsri is true
Commits

The new version differs by 3 commits.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Specifying only one object id in a query fails

When using the objectIds query field, if only one id is specified, an error is returned from koop.

When this url is passed in

FeatureServer/0/query?objectIds=1

this error is returned

{"error":"oids.map is not a function"}

It looks like it's not parsing the object ids to an array if there is just one value.

Support variable coordinate precision

From @slibby
For geojson exports (and other formats) of large datasets, I think we may want to consider reducing decimal degree precision to reduce filesize. For complex polygon layers, the geometry section of the geojson file will take up the vast majority of the text space, and currently koop exports with 16-17 significant digits of precision:

"geometry": { "type": "Polygon", "coordinates": [ [ [ 85.275995105195037, 27.708265241160536 ], [ 85.273401891751973, 27.704288656786961 ], [ 85.268215466662468, 27.704288656786961 ], [ 85.265622253219405, 27.708265241160536 ], [ 85.268215466662468, 27.712241680589148 ], [ 85.273401891751973, 27.712241680589148 ], [ 85.275995105195037, 27.708265241160536 ] ] ] } }

Wikipedia shows us that 8 degrees of precision is down to 1mm of detail, which should be sufficient for most applications. Is it worth considering this when generating geojson, to save on disk and transfer overhead?

Support provider-generated service and layer info responses

Allow the provider to control more of the service info response. It should be able to set/override all of the available fields including the available layers and tables.

Allow the provider to control more of the layer/table info response for each of the layers/tables. It should be able to set/override all of the available fields.

Error: Input classification type invalid:undefined-winnow/dist/options/normalizeClassification.js

  • It needs to convert "options.classificationDef" to Javascript Object
    function normalizeGeoservicesClassBreaks (options) in
    /build/koop/node_modules/winnow/dist/options/normalizeClassification.js

  • URL : /marklogic/GDeltGKG/FeatureServer/0/generateRenderer?classificationDef=%7B%22type%22%3A%22classBreaksDef%22%2C%22classificationField%22%3A%22OBJECTID%22%2C%22classificationMethod%22%3A%22esriClassifyGeometricalInterval%22%2C%22breakCount%22%3A10%7D&f=json&where=1%3D1&

  • req.query
    { classificationDef: '{"type":"classBreaksDef","classificationField":"OBJECTID","classificationMethod":"esriClassifyGeometricalInterval","breakCount":10}',
    f: 'json',
    where: '1=1' }

  • Error :
    Error: Input classification type invalid:undefined
    at normalizeGeoservicesClassBreaks (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/winnow/dist/options/normalizeClassification.js:26:18)
    at normalizeClassification (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/winnow/dist/options/normalizeClassification.js:3:48)
    at Object.prepare (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/winnow/dist/options/index.js:32:21)
    at Model.getData (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/marklogic.js:24:28)
    at /Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/koop/dist/models/index.js:13:14
    at Cache.retrieve (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/koop-cache-memory/dist/index.js:75:38)
    at Model.pull (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/koop/dist/models/index.js:9:14)
    at Controller.Geoservices.featureServer (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/koop-output-geoservices/index.js:7:14)
    at Layer.handle [as handle_request] (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/layer.js:95:5)
    at next (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/layer.js:95:5)
    at /Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/index.js:281:22
    at param (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/index.js:354:14)
    at param (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/index.js:365:14)
    at param (/Projects/github/ESRI/koop12/21032018/koop-provider-marklogic/build/koop/node_modules/express/lib/router/index.js:365:14)

Poor error handling

return res.status(500).json({ error: e.message })

return res.status(500).json({ error: e.message })

return res.status(500).json({ error: e.message })

You can't tell what is the issue, what is the error about, and where it appears.
I had to use debugger and trace every single error.
Please add logs here or use single error handler and output error trace and message, and as much info as possible for error handling.
This will save a lot of time and we will be more efficient this way!

Cannot run koop now

When I install from scratch and try to run a koop provider, I now get the following stack trace

module.js:557
    throw err;
    ^

Error: Cannot find module 'featureserver'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/projects/koop-sample-app/node_modules/koop-output-geoservices/index.js:1:83)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)

This happens for both the MarkLogic provider I am working on as well as the koop-sample-app. The featureserver directory is there but there is no dist folder after running npm install.

Polygon Crossing positive/negative longitude

If I have a polygon that crosses the positive/negative longitude line the feature server "normalizes" the points, which makes the polygon wrap around the entire world instead of crossing the boundary.
Example, this:
[
[179.83539094650206, -18.623051084066553 ],
[179.91769547325103,-18.487906116222785],
[180.08230452674894,-18.487906116222785],
[180.16460905349794,-18.623051084066553],
[180.08230452674894,-18.75808871660612],
[179.91769547325103,-18.75808871660612],
[179.83539094650206, -18.623051084066553 ]
]

Is turned into this:
[
[179.83539094650206, -18.623051084066553 ],
[179.91769547325103,-18.487906116222785],
[-179.917695473,-18.487906116222785],
[-179.835390947,-18.623051084066553],
[-179.917695473,-18.75808871660612],
[179.91769547325103,-18.75808871660612],
[179.83539094650206, -18.623051084066553 ]
]

Error setting displayField when there are no fields

Trace: TypeError: Cannot read property 'name' of undefined
at renderLayer (/Users//koop/providers/yelp/server/node_modules/featureserver/dist/templates.js:67:88)
at Object.layerInfo (/Users//koop/providers/yelp/server/node_modules/featureserver/dist/info.js:37:10)

Can't get name of undefined

Using koop-provider-sample when you hit /sample/FeatureServer this what you get:

{
    "error": "Cannot read property 'name' of undefined"
}

No logs are written to console and no easy way to find the reason, I had to use debugger and trace up to this:

function serverLayerInfo (geojson = {}, id) {
const metadata = geojson.metadata || {}
const geometryType = metadata.geometryType || Utils.getGeomType(geojson)
return {
id,
name: geojson.metadata.name,
parentLayerId: -1,
defaultVisibility: true,
subLayerIds: null,
minScale: 0,
maxScale: 0,
geometryType: geometryMap[geometryType] || geometryType
}
}

40 name: geojson.metadata.name

You should provide defaults somewhere in the very beginning of the way (for example where router starts and receives geojson) and not to try to do it locally in every function, or use adequate getter like in lodash#get or ramda#path

Too many fields in query featureset response

@jkerr5 @dmfenton

For a koop query request, we get back invalid fields. Notice the outFields in the request.

Here is the request params.

f:json
geometry:{"xmin":-13633964.480821775,"ymin":4540069.018923454,"xmax":-13618753.512193045,"ymax":4553904.1210430525}
geometryType:esriGeometryEnvelope
inSR:102100
spatialRel:esriSpatialRelIntersects
outFields:date,OBJECTID //NOTICE WE ONLY ASK FOR 2 FIELDS (date, OBJECTID)
returnGeometry:true
maxAllowableOffset:38
outSR:102100
resultOffset:0
resultRecordCount:1000
where:1=1

Instead of Koop returning just the fields requested, it will send back additional (all the fields) in the response.

Here is a sample response. Notice the fields list contains too many fields (per above request).

{
	"objectIdFieldName": "OBJECTID",
	"globalIdFieldName": "",
	"hasZ": false,
	"hasM": false,
	"geometryType": "esriGeometryPoint",
	"spatialReference": {
		"wkid": 102100,
		"latestWkid": 3857
	},
	"fields": [{
		"name": "date",
		"type": "esriFieldTypeDate",
		"alias": "date",
		"length": null,
		"editable": false,
		"nullable": true,
		"domain": null
	}, {
		"name": "description",
		"type": "esriFieldTypeString",
		"alias": "description",
		"length": null,
		"editable": false,
		"nullable": true,
		"domain": null
	}, {
		"name": "title",
		"type": "esriFieldTypeString",
		"alias": "title",
		"length": null,
		"editable": false,
		"nullable": true,
		"domain": null
	}, {
		"name": "OBJECTID",
		"type": "esriFieldTypeOID",
		"alias": "ID",
		"length": null,
		"editable": false,
		"nullable": false,
		"domain": null
	}],
	"features": [{
		"type": "Feature",
		"attributes": {
			"date": 1045440000000,
			"OBJECTID": 1
		},
		"geometry": {
			"x": -13628245.578950467,
			"y": 4551415.036767305
		}
	}, {
		"type": "Feature",
		"attributes": {
			"date": 1045526400000,
			"OBJECTID": 2
		},
		"geometry": {
			"x": -13627745.45678585,
			"y": 4549486.239246354
		}
	}, {
		"type": "Feature",
		"attributes": {
			"date": 1045612800000,
			"OBJECTID": 3
		},
		"geometry": {
			"x": -13627759.946509149,
			"y": 4548404.142409862
		}
	}, {
		"type": "Feature",
		"attributes": {
			"date": 1045699200000,
			"OBJECTID": 4
		},
		"geometry": {
			"x": -13624472.414064351,
			"y": 4542558.103199204
		}
	}]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.