-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Element Processors
This page documents the various element processors used in Arnis to convert OpenStreetMap (OSM) data into Minecraft blocks. Each processor is responsible for handling specific types of map elements and applying appropriate rendering logic.
Element processors form the core of Arnis's terrain generation capability. They translate abstract geographic data into tangible Minecraft structures by:
- Interpreting OSM tags and attributes
- Selecting appropriate block types and structures
- Placing blocks using the WorldEditor interface
- Applying specialized rendering algorithms for different element types
The buildings processor handles all structures tagged as buildings in OSM data. It's one of the most complex processors, handling:
- Generation of building shells with walls and roofs
- Interior layouts using predefined templates
- Different architectural styles based on building tags
- Multi-story buildings with appropriate floor divisions
- Special rendering for landmark buildings
Buildings can vary from simple residential structures to complex commercial buildings with internal layouts. The processor considers:
- Building height (when available)
- Building type/use (residential, commercial, etc.)
- Architectural details from building:material tags
The highways processor handles roads, paths, and related infrastructure:
- Different road widths based on highway type (motorway, primary, residential, etc.)
- Appropriate materials (concrete for major roads, gravel for minor roads)
- Sidewalks for urban roads
- Street furniture (lamps, signs)
- Traffic signals and crossings
- Bus stops and transit infrastructure
The processor uses the highway type to determine width and materials, creating a road network that reflects the real-world hierarchy.
This processor handles bodies of water like:
- Lakes
- Ponds
- Reservoirs
- Swimming pools
Water areas are typically rendered as filled polygons of water blocks, with appropriate shorelines and depth gradients when possible.
Unlike water areas, waterways process flowing water features:
- Rivers
- Streams
- Canals
- Ditches
Waterways are rendered as linear features with appropriate width according to their type, and can include bridges where they intersect with roads.
The landuse processor handles different types of land use areas:
- Residential zones (represented with appropriate urban textures)
- Commercial and industrial areas
- Parks and recreational spaces
- Agricultural land (farmland)
- Forests and greenspace
- Construction sites
- Military areas
- Railways
Each landuse type receives appropriate block types, with some types (like forests) getting additional decorations like trees.
This processor handles natural features:
- Tree placements
- Beach and coastline rendering
- Rock and stone formations
- Cliffs and natural elevations
- Scrubland and heath
The processor uses specialized algorithms for organic-looking terrain features.
The amenities processor handles points of interest and facilities:
- Benches
- Waste bins
- Fountains
- Public services
- ATMs and banking facilities
- Fire hydrants
These are typically rendered as small structures or marker blocks at the specific node locations.
This processor handles various barrier types:
- Fences and walls
- Gates
- Bollards
- City walls and historic barriers
- Highway barriers and guardrails
Barriers are rendered as linear structures following their defined paths.
The bridges processor creates structures where highways or railways cross waterways:
- Different bridge types based on bridge:type tag
- Appropriate supporting structures
- Clearance for water passage underneath
Bridges coordinate with highway and waterway processors to create coherent crossings.
This processor handles railway infrastructure:
- Train tracks with appropriate spacing
- Railway stations and platforms
- Rail signals and switches
- Metro and tram lines
Railway tracks are rendered as continuous lines with specific block patterns to represent rails.
The leisure processor handles recreational areas:
- Parks
- Playgrounds
- Sports fields and courts
- Swimming pools
- Golf courses
Each leisure type gets specialized rendering appropriate to its purpose.
This processor handles tourist attractions and accommodations:
- Hotels and guest houses
- Camping sites
- Museums and art galleries
- Viewpoints
- Information centers
Tourism features may get special marker blocks or simplified representative structures.
While part of natural features, trees have their dedicated processor due to their complexity:
- Different tree types based on species tags
- Random variations in tree shape and size
- Forest density calculations
- Seasonal variations (when specified)
Trees are generated using predefined templates or algorithmic patterns based on the tree type.
This specialized processor handles:
- Building entrances
- Gates
- Access points
It works in coordination with buildings and barriers to place doors at appropriate locations.
Each element processor follows a similar pattern:
- Receive an OSM element and WorldEditor reference
- Extract relevant tags to determine rendering style
- Calculate geometry (points, lines, or polygons)
- Place blocks using appropriate algorithms
- Add decorative elements and details
Processors may use helpers like:
-
bresenham_linefor drawing linear features -
flood_fill_areafor filling enclosed areas - Random number generators for variation in natural elements