Page:
BoundsClipping
Pages
A perfect testcase
API changes between v2.0 and v2.1
API changes between v3.0 and v3.1
AWS Lambda
About Mapnik
AlsoFilter
Api changes between v2.1 and v2.2
Api changes between v2.2 and v2.3
Api changes between v2.3 and v3.0
ArchInstallation
Aspect Fix Mode
Benchmark Notes
BoundsClipping
BrokenExceptions
BuildingSymbolizer
CSV Plugin
CairoVersions
CentOS_RHEL
ChangeLog
Code sprint
CodingStandards
Compiler Notes
Compositing
Contributing
DebianInstallation
DebugSymbolizer
DebuggingMapnik
DemoGallery
DeveloperTopics
DevelopingPlugins
Development
ElseFilter
ExampleCode
Expression
FasterCompiling
Fasterlabeling
Filter
FontSet
FreeBSDInstallation
GDAL
GEOS
GSOC Ideas
GSOC2010
GSOC2010_Application
GSOC2010_Ideas
GSOC2011
GSOC2011_Ideas
GeoJSON Plugin
GettingStarted
GettingStartedInPython
GettingStartedInXML
GlyphSymbolizer
GroupSymbolizer
Grouped rendering
Gsoc2012 application
Gsoc2012
HaitiStyles
Home
Ideas
Ideas_Compositing
Ideas_FutureMapnik
Image IO
InstallationTroubleshooting
InternationalText
IntroductionToGIS
Kismet
LabelingSupport
Layer
LearningMapnik
Legending
LinePatternSymbolizer
LineSymbolizer
LinuxInstallation
Logging
MacInstallation
MacInstallationSource
MacInstallation_Homebrew
MacPostGIS_Setup
MacPythonUpgradeIssues
ManagingLargeXmlFiles
MapDesign
Mapnik Development
Mapnik Installation
Mapnik with wxPython
Mapnik2
Mapnik2_Changes
MapnikCodeSprint
MapnikCodeSprint_MCS01
MapnikCodeSprint_MCS01_Location
MapnikCodeSprint_MCS01_Results
MapnikCodeSprint_MCS01_Schedule
MapnikCodeSprint_MCS02
MapnikCoreConcepts
MapnikDependencies
MapnikInstallationSvn
MapnikReferences
MapnikReleaseSteps
MapnikReleases
MapnikRenderers
MapnikTutorials
MapnikUtilities
MapnikViewer
Mapnikinstallation
MarkersSymbolizer
MaxScaleDenominator
MemoryDatasource
MetaWriter
MinScaleDenominator
ModServer
Nik2Img
Notes and caveats
OCCI
OGR
OpenSolarisInstallation
OpenSolarisInstallation_32bit
OpenSolarisInstallation_64bit
OpenSolarisInstallation_TroubleShooting
OpenSuse
OpenSuseInstallation
OptimizeRenderingWithPostGIS
OsmPlugin
OutputFormats
PackageBuilding
Paleoserver
Path Expression
PgRaster
PluginArchitecture
PointSymbolizer
PolygonPatternSymbolizer
PolygonSymbolizer
PostGIS
Postgis async
Python Plugin
Python3k
RFC: Raster color interpretation
Raster
RasterColorizer
RasterSymbolizer
Rasterlite
Related projects and utilities
Release0.6.0
Release0.6.1
Release0.7.0
Release0.7.1
Release0.7.2
Release2.0.0
Release2.0.1
Release2.0.2
Release2.1.0
Release2.2.0
Runtime Logging
SQLite
SVG support
Scale factor
ScaleAndPpi
ShapeFile
ShieldSymbolizer
ShieldSymbolizerTests
Style
StyleShare
Svg rendering gochas
SymbologySupport
Text Rendering Overview
TextSymbolizer
Trac to Github wiki migration notes
Troubleshooting
UbuntuInstallation
UbuntuInstallationOld
UsingCustomFonts
UsingScons
WindowsInstallation
World population tutorial
XMLConfigReference
XmlFormatDiscussion
iOS
mapnik.Datasource
mapnik.Layer
mapnik.Map
my choice
No results
6
BoundsClipping
springmeyer edited this page 2012-05-04 07:01:02 -07:00
BoundsClipping
This is a page to document bounding box clipping in the Mapnik codebase.
Clipping is used primarily to ensure valid
and appropriate coordinate bounds are sent to layer datasource plugins when fetching features to render, and is necessary when checking for intersection between a map bbox and its layers when projections differ (since proj4 will fail if invalid extents are used for a given projection).
Clipping can interact in subtle and important ways with a variety of other map and layer level parameters, and became more error prone (but powerful) with the introduction of support for Proj4 in r330.
Tickets related to bounding box clipping over time include:
- #127 BBox clipping fails when there's no intersection
- #204 map.buffer_size() does not seem to fetch data within buffer zone
- #308 Mapnik bug when features with invalid coordinates for target projection are encountered
- #402 Some points from PointDatasource get lost on reprojection
- #486 Bounds clipping likely to fail if using map_buffer after r1348
- #506 Add a Map level custom extent or max_extent to enhance clipping ability
- #548 Layer query bbox not correct on Lambert Map
- #549 Problem with local projections and worldwide data extent
- #751 Better handling of bounding box transform (avoids need for 'maximum-extent').
Key Changesets include:
- r522 - initial impl of clipping in feature_style_processor.hpp
- r770 - conditional use of proj_transform and clipping
- r789 - Check for layer intersection
- r851 - ensure clipping always happens against layer extent
- r853 - switched to use the buffered map extent (map bbox + map.buffer_size)
- r1348 - changed bounds clipping to buffered map extent, created #486
- r2776 - added maximum-extent attribute to map (#506)
- r2782 - if maximum-extent is provided, clip map query to it (#506), which provides one potential, performant, solution to #549
- r2784 - switch to first attempt to clip and intersect against map extent, then falling back to layer extent
- The fallback to layer clipping should now be rarely needed except where a map buffer pushes potential map extent outside of valid bounds but this can now be solved by supplying
maximum-extent
(#506) - r2785 - skip rendering specific coordinates which cannot be back projected from the layer srs into the map srs, avoiding the previous outcome of full skipping of features (this is at the cost of potentially odd looking polygons, but should not impact performance)
- r3048 - fixed bug in fallback intersection checking that lead to false positive and uneeded clip
IRC discussions:
Discussion of fixing clipping after addition of map_buffer to avoid truncated text at tile edges:
- introduction of
maximum-extent
: http://www.mail-archive.com/mapnik-devel@lists.berlios.de/msg00913.html - http://mapnik.dbsgeo.com/mapnik_logs/2009/02/01/ - prediction of #486