message:'Specify an ohsome-api filter text (e.g. building=* and building!=no and geometry:polygon):\n More info on syntax: https://docs.ohsome.org/ohsome-api/stable/filter.html \n>'
message:'filter: Specify an ohsome-api filter text. (Syntax: e.g. building=* and building!=no and geometry:polygon):\n More info on syntax: https://docs.ohsome.org/ohsome-api/stable/filter.html \n>',
message:'filter: Specify an ohsome-api filter text. This will define the denominator value for the ratio result. (Syntax: e.g. building=* and building!=no and geometry:polygon):\n More info on syntax: https://docs.ohsome.org/ohsome-api/stable/filter.html \n>',
message:'filter2: Specify an ohsome-api filter text. This will define the nominator value for the ratio result. (Syntax: e.g. building=* and building!=no and geometry:polygon):\n More info on syntax: https://docs.ohsome.org/ohsome-api/stable/filter.html \n>',
//not all properties exist, test cannot be made -> keep feature
returntrue;
}
}
return!allValuesTrue;
}
}
);
featureCollection.features=filteredFeatures;
returnfeatureCollection;
}
/**
* Creates a GeoJSON Feature Collection with either geometry:null, with original geometries from the query if sourceFeatureCollection is provided or with reprojected geometries if sourceFeatureCollection AND transformToWebmercator is given
* @param ohsomeGroupByBoundaryResponse response from ohsome-API, either ohsomeJSON or ohsomeGroupByBoundaryCSV
* @param sourceIdType the data type of the source feature ids. Necessary because in the case that numbers are stored as stings this cannot inferred from the ohsome csv-response.
* @param horizontal boolean if the result featureType should have many or one timestamp column
* @param sourceFeatureCollection if not undefined, will be used to join input geometry (bpolys) and ohsome-API results
* @param transformToWebmercator if sourceFeatureCollection is provided, should output be reprojected from WGS84 to (EPSG:4326) to Webmercator (EPSG:3857)?
dynamicTyping:(isContributionView)?(col:any)=>(!(col==0||col==1)):(col:any)=>(col!=0),//first (or first two) column is timestamp and should remain string not auto converted to Date
header:false,
skipEmptyLines:true,
comments:'#',
newline:'\n'
};
// PapaParse config
letohsomeGroupByBoundaryCSV;
ohsomeGroupByBoundaryCSV={
delimiter:';',
dynamicTyping:(isContributionView!)?(col:any)=>(!(col==0||col==1)):(col:any)=>(col!=0),//first (or first two) column is timestamp and should remain string not auto converted to Date
constfirstValueColumnIndex=(isContributionView)?2:1;// for snapshotView start reading values at column index 1, for contributionView start at column index 2
constfirstValueColumnIndex=(isContributionView)?2:1;// for snapshotView start reading values at column indeex 1, for contributionView start at column index 2
constfirstValueColumnIndex=(isContributionView!)?2:1;// for snapshotView start reading values at column indeex 1, for contributionView start at column index 2