<commit_before>/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *    (C) 2017, Open Source Geospatial Foundation (OSGeo)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */
package org.geotools.mbstyle.source;

import org.geotools.mbstyle.parse.MBFormatException;
import org.geotools.mbstyle.parse.MBObjectParser;
import org.json.simple.JSONObject;

/**
 * 
 * Wrapper around a {@link JSONObject} containing the "sources" in a Mapbox style. Mapbox sources supply data to be shown on the map. The type of
 * source is specified by the "type" property, and must be one of vector, raster, geojson, image, video, canvas.
 * 
 * "Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer."
 * 
 * @see <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/#sources">https://www.mapbox.com/mapbox-gl-js/style-spec/#sources</a>
 *
 */
public abstract class MBSource {
    
    protected JSONObject json;
    protected MBObjectParser parser;

    public MBSource(JSONObject json) {<commit_msg>source example referencing gwc vector tiles<commit_after>/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *    (C) 2017, Open Source Geospatial Foundation (OSGeo)
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */
package org.geotools.mbstyle.source;

import org.geotools.mbstyle.parse.MBFormatException;
import org.geotools.mbstyle.parse.MBObjectParser;
import org.json.simple.JSONObject;

/**
 * 
 * Wrapper around a {@link JSONObject} containing the "sources" in a Mapbox style. Mapbox sources supply data to be shown on the map. The type of
 * source is specified by the "type" property, and must be one of vector, raster, geojson, image, video, canvas.
 *  
 * "Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer."
 * 
 * <p>Internally we use a wtms end-point to refer to the data source:
 * <pre>
 * "us-states": {
 *    "type": "vector",
 *    "url": "https://localhost:8080/geoserver/gwc/service/wmts#us:states"
 * }
 * </pre>
 * </p>
 * This is based on the following request for a single file::
 * <pre>http://localhost:8080/geoserver/gwc/service/wmts?
 *   REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&
 *   LAYER=dfs:ne_110m_coastline&STYLE=&TILEMATRIX=EPSG:4326:2&TILEMATRIXSET=EPSG:4326&
 *   FORMAT=application/x-protobuf;type=mapbox-vector
 *   &TILECOL=3&TILEROW=1</pre>
 * 
 * @see <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/#sources">https://www.mapbox.com/mapbox-gl-js/style-spec/#sources</a>
 *
 */
public abstract class MBSource {
    
    protected JSONObject json;
    protected MBObjectParser parser;

    public MBSource(JSONObject json) {
{'fraction_non_alphanumeric': 0.09503806773431347, 'fraction_numerical': 0.009713835652402206, 'mean_word_length': 3.6921182266009853, 'pattern_counts': {'":': 3, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 5, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7395458', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1129, 'n_words': 419}