<commit_before>// Package mapserver builds Mapnik .xml files.
package mapnik

import (
	"encoding/xml"
	"fmt"
	"io"
	"log"
	"os"
	"regexp"
	"strconv"
	"strings"

	"github.com/omniscale/magnacarto/builder"
	"github.com/omniscale/magnacarto/builder/sql"
	"github.com/omniscale/magnacarto/color"
	"github.com/omniscale/magnacarto/config"
	"github.com/omniscale/magnacarto/mml"
	"github.com/omniscale/magnacarto/mss"
)

type Map struct {
	fontSets       map[string]string
	XML            *XMLMap
	locator        config.Locator
	scaleFactor    float64
	autoTypeFilter bool
	mapnik2        bool
	zoomScales     []int
}

type maker struct {
	mapnik2 bool
}

func (m maker) Type() string       { return "mapnik" }
func (m maker) FileSuffix() string { return ".xml" }
func (m maker) New(locator config.Locator) builder.MapWriter {
	mm := New(locator)
	if m.mapnik2 {
		mm.SetMapnik2(true)
	}
	mm.zoomScales = webmercZoomScales
	return mm
}

var Maker2 = maker{mapnik2: true}
var Maker3 = maker{}

func New(locator config.Locator) *Map {
	return &Map{
		fontSets:    make(map[string]string),
		XML:         &XMLMap{SRS: "+init=epsg:3857"},
		locator:     locator,
		scaleFactor: 1.0,
	}
}

func (m *Map) SetAutoTypeFilter(enable bool) {
	m.autoTypeFilter = enable
}

func (m *Map) SetBackgroundColor(c color.Color) {
	m.XML.BgColor = fmtColor(c, true)
}

func (m *Map) SetMapnik2(enable bool) {<commit_msg>mapnik: fix default zoomScales<commit_after>// Package mapserver builds Mapnik .xml files.
package mapnik

import (
	"encoding/xml"
	"fmt"
	"io"
	"log"
	"os"
	"regexp"
	"strconv"
	"strings"

	"github.com/omniscale/magnacarto/builder"
	"github.com/omniscale/magnacarto/builder/sql"
	"github.com/omniscale/magnacarto/color"
	"github.com/omniscale/magnacarto/config"
	"github.com/omniscale/magnacarto/mml"
	"github.com/omniscale/magnacarto/mss"
)

type Map struct {
	fontSets       map[string]string
	XML            *XMLMap
	locator        config.Locator
	scaleFactor    float64
	autoTypeFilter bool
	mapnik2        bool
	zoomScales     []int
}

type maker struct {
	mapnik2 bool
}

func (m maker) Type() string       { return "mapnik" }
func (m maker) FileSuffix() string { return ".xml" }
func (m maker) New(locator config.Locator) builder.MapWriter {
	mm := New(locator)
	if m.mapnik2 {
		mm.SetMapnik2(true)
	}
	return mm
}

var Maker2 = maker{mapnik2: true}
var Maker3 = maker{}

func New(locator config.Locator) *Map {
	return &Map{
		fontSets:    make(map[string]string),
		XML:         &XMLMap{SRS: "+init=epsg:3857"},
		locator:     locator,
		scaleFactor: 1.0,
		zoomScales:  webmercZoomScales,
	}
}

func (m *Map) SetAutoTypeFilter(enable bool) {
	m.autoTypeFilter = enable
}

func (m *Map) SetBackgroundColor(c color.Color) {
	m.XML.BgColor = fmtColor(c, true)
}

func (m *Map) SetMapnik2(enable bool) {
{'fraction_non_alphanumeric': 0.12642450142450143, 'fraction_numerical': 0.011396011396011397, 'mean_word_length': 3.697324414715719, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '7191334', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1117, 'n_words': 237}