PHPackages                             mapsight/pulp-datex-fuel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mapsight/pulp-datex-fuel

ActiveLibrary

mapsight/pulp-datex-fuel
========================

MTS-K DATEX II fuel-station helpers for Pulp pipelines.

01↑2900%PHP

Since Aug 28Pushed todayCompare

[ Source](https://github.com/open-mapsight/pulp-datex-fuel)[ Packagist](https://packagist.org/packages/mapsight/pulp-datex-fuel)[ RSS](/packages/mapsight-pulp-datex-fuel/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Pulp DATEX Fuel
===============

[](#pulp-datex-fuel)

MTS-K DATEX II v2 petrol-station helpers for Pulp pipelines. Two layers: Mobilithek source defaults, then presentation-neutral XML → GeoJSON.

This is the parse / bbox / GeoJSON layer only. It is not a city job and it is not AFIR charging (`mapsight/pulp-datex-energy`).

Features
--------

[](#features)

- **Mobilithek src helper:** Configures `Pulp::srcHttp` with the default subscription URL, `Accept-Encoding: gzip`, and P12 client-cert curl options. Certificate path, password, and subscription ID stay caller-supplied.
- **Grunddaten → GeoJSON:** One point feature per `PetrolStation` from a `PetrolStationPublication`.
- **Preisdaten:** `FuelPrice` records for Super E5, Super E10, and Diesel, joined to stations on the station GUID.
- **Bounding box filtering:** Limits stations to `[minLon, minLat, maxLon, maxLat]`.
- **Presentation-neutral output:** Source and data properties only. Applications add icons, HTML descriptions, and localized labels afterwards.

Access
------

[](#access)

Consumer pull of the aggregated MTS-K collector feeds requires Verbraucher-Informationsdienst admission under § 6 MTSKraftV (nationwide, permanent, unrestricted) or a VID third-party regional feed (the VID stays liable). This package only parses publications you already have a right to fetch. It does not apply for VID status and does not check legal eligibility at runtime.

- [§ 5 MTSKraftV](https://www.gesetze-im-internet.de/mtskraftv/__5.html)
- [§ 6 MTSKraftV](https://www.gesetze-im-internet.de/mtskraftv/__6.html)
- [Hinweise der MTS-K zur Nutzung der Mobilithek (Stand April 2026)](https://www.bundeskartellamt.de/SharedDocs/Publikation/DE/Sonstiges/MTS-K/MTS_Hinweis_Nutzung_Mobilithek.pdf?__blob=publicationFile&v=3)
- [Info VID Verbraucher (26 Feb 2025)](https://www.bundeskartellamt.de/SharedDocs/Publikation/DE/Sonstiges/MTS-K/Info_VID_Verbraucher.pdf?__blob=publicationFile&v=4)
- [Schema (DATEX II v2, v01-01)](https://mobilithek.info/cms/downloads/datenmodell-mts-k-01-01)
- [WSDL](https://mobilithek.info/cms/downloads/wsdl-mtsk)

Installation
------------

[](#installation)

```
composer require mapsight/pulp-datex-fuel
```

This package depends on `mapsight/pulp`.

Fetch a subscription
--------------------

[](#fetch-a-subscription)

```
use OpenMapsight\Pulp;
use OpenMapsight\PulpCache;
use OpenMapsight\PulpDatexFuel;
use OpenMapsight\PulpJSON;

$source = Pulp::start()
    ->pipe(PulpDatexFuel::srcMobilithek(
        $subscriptionId,
        $certPath,
        $certPassword,
        $ifModifiedSince,
    ));

$files = Pulp::start()
    ->pipe(PulpCache::remember($source, __DIR__ . '/cache', [
        'key' => 'datex-fuel-stations',
        'ttl' => 86400,
        'fallbackToStale' => true,
    ]))
    ->pipe(PulpDatexFuel::stationsGeoJson(
        [6.05, 50.76, 6.08, 50.82],
        'https://example.com/open-data-docs',
        'DATEX Fuel',
        'https://example.com/open-data-docs',
        'https://example.com/open-data-docs',
    ))
    ->run();
```

`Pulp::srcHttp` still loads the full response body as a string. A nationwide dump may need a disk sink in core pulp later. That belongs in core pulp, not this package.

Stations GeoJSON
----------------

[](#stations-geojson)

```
use OpenMapsight\Pulp;
use OpenMapsight\PulpDatexFuel;
use OpenMapsight\PulpJSON;

Pulp::start()
    ->pipe(Pulp::src('stations.xml', __DIR__ . '/input'))
    ->pipe(PulpDatexFuel::stationsGeoJson(
        [6.05, 50.76, 6.08, 50.82],
        'https://example.com/open-data-docs',
    ))
    ->pipe(PulpJSON::encodeJSON(JSON_PRETTY_PRINT))
    ->pipe(Pulp::dest(__DIR__ . '/result'))
    ->run();
```

The handler accepts a DATEX II v2 XML string, a Mobilithek SOAP container, or an already-decoded array. Stations without coordinates are dropped.

Price merge
-----------

[](#price-merge)

```
$prices = PulpDatexFuel::extractPrices($publication);
$cache = PulpDatexFuel::applyPricePacketToCache($cache, $prices, $packetType, $lastModified);
$merged = PulpDatexFuel::mergePricesIntoFeatureCollection($featureCollection, $cache['prices']);
```

Or in a pipeline:

```
Pulp::start()
    ->pipe(Pulp::src('prices.xml', __DIR__ . '/input'))
    ->pipe(PulpDatexFuel::priceRecords())
    ->run();
```

A `SNAPSHOT` packet replaces the station-price cache. A `DELTA` packet upserts by station GUID. Published MTS-K examples are snapshots; the DELTA path is the hook if a collector later sends increments.

Station properties
------------------

[](#station-properties)

Station features include:

- `stationId` (GUID)
- `name`
- `brand`, `operator` (empty string when the publication omits them)
- `addressLine`, `postcode`, `city`, `countryCode`
- `openingHours` (DATEX-derived list of `{days, periods}` blocks; `days` use DATEX `DayEnum` values such as `monday` and `publicHoliday`)
- `stationUpdatedAt`
- `source`, `sourceUrl`

After a price merge, matched features also include:

- `e5`, `e10`, `diesel` (float with up to three decimals, or `null` when that product is absent)
- `pricesUpdatedAt` (`dateOfPrice` / Änderungszeitpunkt)

Notes
-----

[](#notes)

- Do not put a `.p12` or city-specific subscription IDs in this package.
- Keep German copy, Mapsight icons, “cheapest nearby” text, and VID application flow in the consuming city job.
- `srcMobilithek()` only configures `Pulp::srcHttp`. Cache with `PulpCache::remember`.

###  Health Score

21

—

LowBetter than 17% of packages

Maintenance65

Regular maintenance activity

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/684458?v=4)[Paul Golmann](/maintainers/pjeweb)[@pjeweb](https://github.com/pjeweb)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![pjeweb](https://avatars.githubusercontent.com/u/684458?v=4)](https://github.com/pjeweb "pjeweb (1 commits)")

### Embed Badge

![Health badge](/badges/mapsight-pulp-datex-fuel/health.svg)

```
[![Health](https://phpackages.com/badges/mapsight-pulp-datex-fuel/health.svg)](https://phpackages.com/packages/mapsight-pulp-datex-fuel)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
