<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sanish Kumar</title>
    <description>The latest articles on DEV Community by Sanish Kumar (@sanish_kumar).</description>
    <link>https://dev.to/sanish_kumar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3994121%2F89955bfb-a426-44c6-82e2-d7531e68942d.jpg</url>
      <title>DEV Community: Sanish Kumar</title>
      <link>https://dev.to/sanish_kumar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sanish_kumar"/>
    <language>en</language>
    <item>
      <title>I asked a mapping API for lakes named Huron. It sent me Lake Baikal.</title>
      <dc:creator>Sanish Kumar</dc:creator>
      <pubDate>Thu, 20 Aug 2026 12:17:33 +0000</pubDate>
      <link>https://dev.to/sanish_kumar/i-asked-a-mapping-api-for-lakes-named-huron-it-sent-me-lake-baikal-3ac6</link>
      <guid>https://dev.to/sanish_kumar/i-asked-a-mapping-api-for-lakes-named-huron-it-sent-me-lake-baikal-3ac6</guid>
      <description>&lt;p&gt;I was testing a geospatial library against a public demo server and sent it a filter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /collections/lakes/items?filter=name LIKE '%Huron%'&amp;amp;filter-lang=cql2-text
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It replied &lt;code&gt;200 OK&lt;/code&gt;. It reported 25 matches. Here is what came back:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F376db6dezr4253wui1fa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F376db6dezr4253wui1fa.png" alt="curl against the pygeoapi demo returning every lake in the collection for a Huron filter" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lake Baikal. Lake Winnipeg. Great Slave Lake. Lake Victoria. Lake Tanganyika.&lt;/p&gt;

&lt;p&gt;Not one of them is Lake Huron. The server had ignored my filter and handed back the entire collection. No error. No warning. No header saying "I don't do that."&lt;/p&gt;

&lt;p&gt;This is the public pygeoapi demo, and it is not broken. It was being honest in a way I wasn't listening to.&lt;/p&gt;

&lt;h2&gt;
  
  
  The spec has a footgun
&lt;/h2&gt;

&lt;p&gt;OGC API - Features puts filtering in a separate part of the standard. A service publishes what it supports at &lt;code&gt;/conformance&lt;/code&gt;, and pygeoapi's list includes these two:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://www.opengis.net/spec/cql2/1.0/conf/cql2-text
http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and does &lt;strong&gt;not&lt;/strong&gt; include this one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/filter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first two mean &lt;em&gt;"I understand the CQL2 text encoding."&lt;/em&gt; The third means &lt;em&gt;"my items endpoint will actually apply a filter you send it."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Those are very different promises and they look nearly identical in a list of forty-four URIs. I read the first two and assumed the third.&lt;/p&gt;

&lt;p&gt;An unknown query parameter is not an error in HTTP. So &lt;code&gt;filter=&lt;/code&gt; gets dropped on the floor, you get a &lt;code&gt;200&lt;/code&gt;, and you get everything. If you aren't counting rows, it is indistinguishable from success.&lt;/p&gt;

&lt;p&gt;Point the same request at ldproxy's demo, which does implement Part 3, and it behaves exactly as you'd expect. Same query, same encoding, same status code, completely different meaning:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffee6fyrmzde0lv4v1tlo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffee6fyrmzde0lv4v1tlo.png" alt="Side-by-side conformance comparison: pygeoapi missing conf/filter returns 25 of 25 features, ldproxy returns 1 of 1" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I care more than I used to
&lt;/h2&gt;

&lt;p&gt;For a human clicking through a web map, this is a bug you would probably catch. Twenty-five results when you expected one is the kind of thing that makes you squint.&lt;/p&gt;

&lt;p&gt;For an agent, it's poison.&lt;/p&gt;

&lt;p&gt;Give a model access to a spatial API and it will write queries with total confidence. It has no way to distinguish &lt;em&gt;"the filter matched 25 things"&lt;/em&gt; from &lt;em&gt;"the filter was discarded and you're looking at the whole table."&lt;/em&gt; It will summarise Lake Baikal as a result about Huron and move on to the next tool call. Nothing downstream catches it, because nothing downstream knows what the right answer looked like.&lt;/p&gt;

&lt;p&gt;The dangerous failure mode was never an API returning an error. It's an API returning something plausible.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed
&lt;/h2&gt;

&lt;p&gt;I've been building &lt;a href="https://github.com/SanishKumar/VoiceGIS" rel="noopener noreferrer"&gt;VoiceGIS&lt;/a&gt;, which compiles plain-language requests into typed, checked operations against spatial data. It has a notion of &lt;em&gt;capabilities&lt;/em&gt; — what a given layer can actually do — and until recently I populated those by hand.&lt;/p&gt;

&lt;p&gt;Now they're derived from the service itself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;catalogFromOgcService&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;voicegis/adapters&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;conformance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;warnings&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;catalogFromOgcService&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://demo.pygeoapi.io/master&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;conformance&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// { cql2Text: true, basicCql2: true, filter: false, canFilter: false }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;canFilter: false&lt;/code&gt;, so the derived catalog gets &lt;code&gt;layer.visibility&lt;/code&gt;, &lt;code&gt;query.clear&lt;/code&gt;, &lt;code&gt;selection.clear&lt;/code&gt; and &lt;code&gt;data.export&lt;/code&gt; — and no query operations whatsoever. Ask it to filter and it refuses before a single request leaves the process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"needs_input"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"executed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"issues"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"catalog_capability_missing"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;along with a warning that spells it out in English:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This service does not advertise OGC API - Features Part 3 filtering with CQL2-Text. Attribute queries are NOT enabled: a service in this state has been observed to accept a filter, answer 200, and return every feature as though it had been applied.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Run the same function against ldproxy and you get twenty-one layers with full query capabilities, field types pulled from &lt;code&gt;/queryables&lt;/code&gt;, and the geometry property detected per collection — ldproxy calls it &lt;code&gt;geom&lt;/code&gt;, pygeoapi calls it &lt;code&gt;geometry&lt;/code&gt;, and hardcoding either one is its own quiet little bug waiting to happen.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape underneath
&lt;/h2&gt;

&lt;p&gt;The pattern I keep returning to is: &lt;strong&gt;make the system refuse rather than approximate.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A request moves through four stages, and the design work is entirely in what each stage is permitted to assume.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4bkdxn1vg5cqmfabddi4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4bkdxn1vg5cqmfabddi4.png" alt="Pipeline diagram: request, compiler, validate and policy, adapter, receipt — with the catalog derived from conformance feeding the validation step" width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nothing is a string. &lt;code&gt;"area is greater than 2 hectares"&lt;/code&gt; becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;comparison&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;field&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;area_ha&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;operator&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;unit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hectare&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which is something you can validate, log, diff, and re-check server-side. There is no moment at which a generated SQL string exists to be wrong.&lt;/p&gt;

&lt;p&gt;The rule that took me longest to accept: &lt;strong&gt;a half-understood request executes none of its parts.&lt;/strong&gt; &lt;code&gt;go to Delhi and show hydrants&lt;/code&gt; used to fly to Delhi and quietly skip the layer it didn't recognise. Now it does nothing and explains why. It feels worse in the moment. It is correct — a partial side effect nobody asked for is much harder to notice than a refusal.&lt;/p&gt;

&lt;p&gt;Writing the tests for that rule turned up three more of the same species in my own code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;show hospitals and schools&lt;/code&gt; toggled hospitals and silently dropped schools.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;zoning is 5 star retail&lt;/code&gt; on a text field parsed as the number 5 carrying the unit &lt;code&gt;"star retail"&lt;/code&gt;, matched zero rows, and reported success.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;magnitude &amp;gt; 5 bananas&lt;/code&gt; treated &lt;code&gt;bananas&lt;/code&gt; as a unit and behaved exactly like &lt;code&gt;&amp;gt; 5&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All three returned &lt;code&gt;ready&lt;/code&gt;. All three were wrong. I had written every one of them myself while being quite pleased about type safety.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part I'd defend in a code review
&lt;/h2&gt;

&lt;p&gt;Deriving capabilities from &lt;code&gt;/conformance&lt;/code&gt; means some services end up with a nearly useless catalog. pygeoapi comes out read-only. Sooner or later someone will open an issue asking me to just send the filter and hope for the best.&lt;/p&gt;

&lt;p&gt;I won't, and the Lake Baikal result is the reason. A tool that answers 80% of questions correctly and 20% wrongly-but-plausibly is worse than a tool that answers 80% and refuses the rest, because from the outside you cannot tell those two categories apart. The refusal is the feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it doesn't do
&lt;/h2&gt;

&lt;p&gt;The compiler is deterministic — a grammar, not a model. That makes it fast: about &lt;strong&gt;0.02 ms&lt;/strong&gt; to compile, and constant regardless of dataset size, because it only ever touches the catalog, never the features. It's also never creatively wrong.&lt;/p&gt;

&lt;p&gt;It is also narrow. High precision, low recall. It says &lt;code&gt;needs_input&lt;/code&gt; more often than I would like.&lt;/p&gt;

&lt;p&gt;The fix is not to loosen it. It's to put a model in front that proposes a plan, and keep the validator behind it refusing anything ungrounded. That's the next thing I'm building, and the validator is the half that already exists.&lt;/p&gt;

&lt;p&gt;The OGC adapter has been tested end to end against exactly one conformant service, which is why it's marked experimental. One data point is not a compatibility matrix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Live demo, real USGS earthquake data, no signup: &lt;strong&gt;&lt;a href="https://voicemap-three.vercel.app/" rel="noopener noreferrer"&gt;https://voicemap-three.vercel.app/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Type &lt;code&gt;show earthquakes where magnitude is greater than 5&lt;/code&gt;. Then switch off the &lt;code&gt;export&lt;/code&gt; permission and ask it to export something. Watch it stop at Authorize and tell you why.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;voicegis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Zero runtime dependencies, MIT. Source and issues: &lt;strong&gt;&lt;a href="https://github.com/SanishKumar/VoiceGIS" rel="noopener noreferrer"&gt;https://github.com/SanishKumar/VoiceGIS&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you maintain an OGC API - Features service, it's worth checking what your &lt;code&gt;/conformance&lt;/code&gt; claims against what your items endpoint actually does with a &lt;code&gt;filter&lt;/code&gt; parameter. I'd genuinely like to know how common this is — I've only surveyed two.&lt;/p&gt;

</description>
      <category>gis</category>
      <category>javascript</category>
      <category>api</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How I built an Offline-First Voice-Controlled Map Engine in JavaScript</title>
      <dc:creator>Sanish Kumar</dc:creator>
      <pubDate>Mon, 22 Jun 2026 20:30:00 +0000</pubDate>
      <link>https://dev.to/sanish_kumar/how-i-built-an-offline-first-voice-controlled-map-engine-in-javascript-if8</link>
      <guid>https://dev.to/sanish_kumar/how-i-built-an-offline-first-voice-controlled-map-engine-in-javascript-if8</guid>
      <description>&lt;p&gt;&lt;em&gt;Have you ever tried to drag a map on your phone while carrying groceries? Or tried to annotate a field survey map while wearing gloves? Traditional GIS UIs assume you always have two free hands and perfect focus. I wanted to change that.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Today I'm open-sourcing &lt;a href="https://npmjs.com/package/voicegis" rel="noopener noreferrer"&gt;&lt;strong&gt;VoiceGIS&lt;/strong&gt;&lt;/a&gt; — a robust, offline-capable JavaScript library that lets you control Leaflet and OpenLayers maps using natural voice commands.&lt;/p&gt;

&lt;p&gt;Here's how I solved the hardest parts of building a production-grade voice mapping engine.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem with "Just use Web Speech API"
&lt;/h2&gt;

&lt;p&gt;If you've ever played with &lt;code&gt;window.SpeechRecognition&lt;/code&gt;, you know it's a neat toy, but it has two massive flaws for production GIS apps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;It requires an internet connection.&lt;/strong&gt; If you are doing an environmental survey in the woods, or using a tablet on a remote construction site, it instantly breaks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It's deeply tied to Google/Apple servers.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To solve this, VoiceGIS ships with a &lt;strong&gt;hybrid engine architecture&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;By default, it uses the browser's native Web Speech API. But the moment the user goes offline (or explicitly requests privacy), VoiceGIS seamlessly falls back to an &lt;strong&gt;on-device Whisper AI model&lt;/strong&gt; using &lt;code&gt;@huggingface/transformers&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;The &lt;code&gt;onnx-community/whisper-tiny.en&lt;/code&gt; model is downloaded directly into the browser's Cache API (~40MB). It processes your speech entirely locally using WebAssembly or WebGPU. No audio ever leaves the user's device.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Middleware Pipeline: More Than Just Parsing
&lt;/h2&gt;

&lt;p&gt;Voice commands are messy. You might say: &lt;em&gt;"Zoom to Paris and show the satellite layer."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most tutorials solve this with a massive &lt;code&gt;switch&lt;/code&gt; statement. I wanted VoiceGIS to be extensible like an Express.js server. &lt;/p&gt;

&lt;p&gt;So, I built a Koa-style middleware pipeline right into the execution loop. When you speak, the text is split into sequential chain links, parsed, and passed through your custom middlewares:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;VoiceGIS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;voiceFeedback&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;voicegis&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;VoiceGIS&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;mapContainerId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;map&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Middleware 1: Analytics logging&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`User intent: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;intent&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Middleware 2: The map talks back! (Built-in TTS plugin)&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;voiceFeedback&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en-US&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because it uses &lt;code&gt;async/await&lt;/code&gt; middleware, you can even intercept commands to show confirmation modals before destructive actions, or block commands based on app state (e.g., Read-Only mode).&lt;/p&gt;

&lt;h2&gt;
  
  
  Handling Geospatial Context
&lt;/h2&gt;

&lt;p&gt;Extracting an intent (like &lt;code&gt;go_to&lt;/code&gt;) is easy. Extracting the &lt;em&gt;payload&lt;/em&gt; (like "Paris") and turning it into coordinates is hard.&lt;/p&gt;

&lt;p&gt;VoiceGIS uses an internal fuzzy geocoder that leverages the Nominatim API, but falls back to a local LRU cache and predefined aliases. It handles conversational cruft effortlessly:&lt;br&gt;
&lt;em&gt;"Can you please take me to the Eiffel Tower?"&lt;/em&gt; → Intent: &lt;code&gt;GO_TO&lt;/code&gt;, Payload: &lt;code&gt;[48.8584, 2.2945]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And because users inevitably make mistakes, every state-mutating command (like panning or zooming) automatically pushes a snapshot to the &lt;code&gt;CommandHistory&lt;/code&gt; stack. If the map flies off to the wrong city, the user just says &lt;strong&gt;"undo"&lt;/strong&gt; and the map snaps right back.&lt;/p&gt;
&lt;h2&gt;
  
  
  Try It Out
&lt;/h2&gt;

&lt;p&gt;You can drop this into any React, Vue, or Vanilla JS app in about 3 lines of code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;voicegis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check out the GitHub repo for complete example apps, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Next.js Dashboard integration&lt;/li&gt;
&lt;li&gt;An offline Electron Kiosk setup&lt;/li&gt;
&lt;li&gt;A field survey app&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd love to hear what you build with it! Are there any other intents or offline engines you'd like to see added?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>gis</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
