3

I am making a GET call to the following table: https://data.cityofnewyork.us/Social-Services/Halloween-Noise-Lat-Long/25yv-wyir

It has 715 entries.

When I make the GET call however, it only returns 463 entries.

var map = L.map('map').setView([40.7518685, -73.984857], 11);

L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
    subdomains: 'abcd',
    maxZoom: 19})
    .addTo(map);


var halloweenData = "https://data.cityofnewyork.us/resource/25yv-wyir.json?";
$.getJSON(halloweenData, function(data) {
    for (var i = 0; i < data.length; i++){
        var m = L.circleMarker(new L.LatLng(data[i].latitude, data[i].longitude)).setRadius(4).addTo(map).bindPopup(data[i].created_date);
    }
})
console.log(halloweenData);

Is anyone familiar enough with Socrata/SODA API to explain and help me correct this discrepancy? I'm using jquery and leaflet.js

4

1 回答 1

2

It looks like there might be an error in how that dataset is being exported, and our engineers are taking a look.

In the meantime, I'd recommend checking out the SODA API for that dataset, since you'll probably be happier with those results.

I reproduced that filter as a SoQL query, and got the correct count of 715:

https://data.cityofnewyork.us/resource/fhrw-4uyv.json?descriptor=Loud Music/Party&$where=UPPER(city) NOT LIKE "%STATEN%" AND created_date BETWEEN '2015-10-29T17:00:00' AND '2015-11-01T08:00:00'

Example: https://www.runscope.com/public/bff63de8-1862-45a9-888d-2b10741eacfa/b76280f5-0865-4beb-b05b-9808d5acbcef

Let me know if that works better for you!

于 2015-11-16T21:58:13.303 回答