<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kumail Raza on Medium]]></title>
        <description><![CDATA[Stories by Kumail Raza on Medium]]></description>
        <link>https://medium.com/@kumail09?source=rss-877f834e3a6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g8OW8HUmbH7l_sJKbu20KA.jpeg</url>
            <title>Stories by Kumail Raza on Medium</title>
            <link>https://medium.com/@kumail09?source=rss-877f834e3a6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:17:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kumail09/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Renaissance Era for Software]]></title>
            <link>https://medium.com/@kumail09/the-renaissance-era-for-software-89b4c246b749?source=rss-877f834e3a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/89b4c246b749</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cursor]]></category>
            <dc:creator><![CDATA[Kumail Raza]]></dc:creator>
            <pubDate>Thu, 11 Sep 2025 10:29:13 GMT</pubDate>
            <atom:updated>2025-09-11T10:29:13.799Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O-AQSKSv_fonJMWfkZOa7Q.png" /></figure><p>I’m exhausted by the endless stream of LinkedIn “thought leadership” posts. You know the ones: a carefully crafted carousel declaring, “AI will take your job if you don’t learn it,” or “Innovate or perish,” or the timeless classic, “AI is just for boilerplate.” All delivered with a stock photo of a pensive person holding a latte. At this point, LinkedIn feels less like a professional network and more like a self-help conference where everyone’s keynote is the same PowerPoint.</p><p>We’re entering a “<strong>Renaissance for software”.</strong> Not a recession of creativity or a slow death of engineering, but the opposite: an era where the barriers to creation are crumbling.</p><p>The printing press of our time is AI; tools like Cursor, Copilot, and Claude are doing for code what Gutenberg did for books: making it cheap, fast, and accessible. Just like the Renaissance gave rise to polymaths who mastered multiple fields, software engineers now have the leverage to design, build, and ship entire systems at a pace that was unthinkable even five years ago.</p><p>Over the last two weeks, I’ve pushed 200 million tokens through Cursor, experimented with a dozen other AI coding tools, and tried to see if any of them could actually <em>do my job</em>. Spoiler: they can’t. Not because I’m special, but because software engineering is more than filling in lines of code.</p><p>And when you work in a field like WebGIS<strong>, </strong>where your daily grind is streaming 50,000 building footprints, chaining PostGIS queries, wrangling Deck.gl layers, and serving tiles at scale, AI coding assistants get stress-tested hard.</p><p>So here’s my honest take.</p><h4>Cursor’s Magic Is Tokens, Not “Thinking”</h4><p>Cursor doesn’t “understand” your codebase. It predicts text based on context windows (tokens). When I ask Cursor to write a simple Mapbox + Deck.gl rendering setup, it’s not reasoning through the documents, it’s guessing. Smartly, sure. But guessing.</p><p>Here’s why that matters:</p><ul><li>If your project is messy or poorly structured, Cursor loses track fast.</li><li>Its brilliance shows when your patterns are consistent (React hooks, REST endpoints, test scaffolding).</li><li>It struggles with custom APIs, non-standard projections, or geospatial edge cases because… well, it hasn’t “seen” your weird world before.</li></ul><p>Think of it as a supercharged autocomplete that works best when you make your project predictable.</p><h4>AI Is a Colleague, Not a Factory Worker</h4><p>Cursor is phenomenal for:</p><ul><li>Writing repetitive CRUD endpoints.</li><li>Translating PostGIS SQL to Python ORM.</li><li>Setting up types or tests in seconds.</li></ul><p>But I’ve also had it:</p><ul><li>Forget that tile servers cache differently.</li><li>Break Deck.gl layer configs.</li><li>Suggest “optimizations” that bottleneck performance on large datasets.</li></ul><p>It’s a junior dev who types at superhuman speed but knows nothing about your domain until you teach it. Even when you teach it, it tends to mess up in alot of places.</p><h4>WebGIS Is the Ultimate Stress Test</h4><p>Working in WebGIS means:</p><ul><li>Unique data challenges: massive raster files, vector tiles, spatial indexing.</li><li>Domain-specific libraries: MapLibre, TiTiler, pg_tileserv, Sentinel Hub APIs.</li><li>Lots of edge cases AI models never trained on.</li></ul><p>If you’re building software for agriculture, forestry, or environmental monitoring, AI coding assistants are a productivity boost, not a replacement. They accelerate the grunt work but fall apart without domain expertise.</p><h4>The Renaissance Mindset</h4><p>The Software Renaissance isn’t about survival. It’s about leverage.</p><ul><li>We’re no longer “just developers.” We’re AI orchestrators.</li><li>Our productivity is exploding not because AI replaces us, but because we’ve learned to frame problems.</li><li>This is a golden era for niche engineering fields: your unique knowledge is now worth 10x.</li></ul><p>The Software Renaissance has just begun. Now, the only question is: Are you still coding line by line, or are you directing the orchestra?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89b4c246b749" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Most Data Scientists Struggle with Crop Detection — The Remote Sensing Perspective]]></title>
            <link>https://medium.com/@kumail09/why-most-data-scientists-struggle-with-crop-detection-the-remote-sensing-perspective-62737b714b31?source=rss-877f834e3a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/62737b714b31</guid>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[agriculture]]></category>
            <category><![CDATA[remote-sensing]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Kumail Raza]]></dc:creator>
            <pubDate>Fri, 14 Mar 2025 19:47:30 GMT</pubDate>
            <atom:updated>2025-03-14T19:52:49.021Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Most Data Scientists Struggle with Crop Detection — The Remote Sensing Perspective</h3><p>Remote sensing in agriculture is often hailed as a game changer. However, many crop detection projects led primarily by data scientists end up underperforming. Why does this happen? especially when advanced machine learning models are involved? The issue is usually not the algorithms themselves, it’s the oversight of critical geospatial and remote sensing considerations. I am going to cover 5 main topics that are often overlooked by most data scientists. These issues are more relevant with modelling using satellite imagery but can overlap with drone and other methods of aerial photography.</p><h4>1. Misinterpreting Spectral Signatures and Vegetation Indices</h4><p>One of the first hurdles is understanding what the spectral data truly represent. Remote sensing imagery is not like typical RGB photos, each band (from blue to infrared) carries nuanced information. Classic mistake is to grab popular vegetation indexs like NDVI, EVI etc and assume they directly differentiate crop types. These indexes are useful for studying vegetation health or presence of fauna. They <strong>cannot</strong> magically distinguish corn from sugarcane or rice from wheat by themselves. I have seen companies substitute these indexes for “remote sensing expertise” not understanding the limitations.</p><p>Different crops can share similar NDVI ranges at various times, and stressed high-NDVI weeds could even be mistaken for a healthy crop.</p><p>Remote sensing specialists know to look beyond one index and examine full spectral signatures and using multiple indices or bands. For example, healthy vegetation typically reflects strongly in near-infrared and has a characteristic “red edge” slope. However, <strong>many crops exhibit overlapping spectral features</strong>, especially during certain growth stages​. Without domain knowledge, a model might misclassify crops simply because their spectral signatures are closer.</p><h4><strong>2. Neglecting Seasonal Changes and Growth Cycles</strong></h4><p>Ignoring the agricultural calendar can doom a project. Crops are living things that change dramatically over weeks and months. This sounds obvious, but it’s often glossed over in data driven approaches. A common oversight is treating crop classification as if it were static land cover mapping. You <strong>cannot </strong>use a single<strong> </strong>imagery to determine the crop type. A corn field in early June might look like a soybean field in July.</p><p>A multi-temporal analysis using time-series data is neccessary to observe how a field’s signature changes throughout the season. It’s also crucial to know local planting schedules e.g a rice paddy might have two growing seasons in tropical regions versus one in temperate regions. Data scientists who partner with agronomists or use crop calendars can calibrate their models to recognize these patterns. Any robust crop detection approach must be as time-aware as a GIS/remote sensing specialist would design it.</p><h4>3. Over-Reliance on Machine Learning Models Without Field Calibration</h4><p>Machine learning can identify patterns in remote sensing data, but it doesn’t inherently know what those patterns mean on the ground. A recurring mistake is to throw imagery and labels into a model <strong>without sufficient field calibration.</strong></p><p>Simply put alot of times the model’s output is not aligned with reality via ground truth data. Data scientists sometimes assume that if the accuracy metrics look good on a validation split, the model is “ready for production”.</p><p>You need to regularly ground truth your classifications. Go walk the fields, collect samples, or at least work with local experts who can verify what the satellite is seeing. In fact, best practice crop mapping programs, like the USDA’s Cropland Data Layer, rely on thousands of field survey points and farmer reports every year to train and calibrate their models.</p><p>This also requires understanding that <strong>calibration should be done every year. </strong>Why? Because conditions change year to year, new crop varieties, different weather influencing growth, crop rotations, etc. An over reliance on an uncalibrated model can lead to drift. So this leads to another insight that when working with a dataset that spans over multiple years, weather and local context is very crucial to factor into your analysis.</p><p>Overfitting is also a danger here. A model might perform with 95% accuracy in Region A and then flop in Region B because it latched onto region specific quirks. To avoid this, one needs diverse training data and frequent calibration with ground truth from each target region or season.</p><p>In practical terms, this means integrating field data collection into the project timeline. Do not treat ground truthing as an afterthought, it’s part of the model development loop. The goal is to continuously anchor the model’s predictions to what’s actually happening on the farm.</p><p>By tempering the “AI knows best” mindset with some humility and field reality checks, projects can dramatically improve their reliability. Remember, a crop classification model is only as good as the data it’s trained on. That data <strong>should reflect the real world</strong>, not just the quirks of your training set.</p><h4>4. Ignoring Atmospheric and Soil Influences on Imagery</h4><p>This one is overlooked even by most GIS/RS specialists and therefore makes it one of my favourite problems to highlight.</p><p>Satellite Imagery does <strong>not </strong>come in a vaccuum. Literally, it doesnt. It comes through Earth’s atmosphere and off of various ground backgrounds. This can heavily distort the signal if not addressed. Haze, dust, humidity, and the angle of sunlight can all alter the measured reflectance​.</p><p>A classic example to understand this is that a field might appear less “green” on a hazy day, leading a naive analysis to think the crop is unhealthy or a different type.</p><p><strong>Atmospheric correction</strong> is a standard preprocessing step in remote sensing. You need to convert raw satellite data (Top-Of-Atmosphere reflectance) to a surface reflectance that represents the actual ground reflectivity by removing atmospheric effects. A data scientist might feed raw images into a model, and the model ends up learning “haze vs no-haze” differences instead of crop differences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*eMa48qHDVivJ0XJhalteiw.png" /><figcaption>Comparison of how different an image can look between TOA and SR. Image is taken from this very informatinve blog by DescartesLabs. Read more: <a href="https://blog.descarteslabs.com/a-look-into-the-fundamentals-of-remote-sensing">https://blog.descarteslabs.com/a-look-into-the-fundamentals-of-remote-sensing</a></figcaption></figure><p>Similarly, the soil background<strong> </strong>can trip up analyses if ignored. When crops are sparse, immature, or planted in rows with bare soil in between, the sensor is actually seeing a mix of plant and soil reflectance​. Dark, wet soil will make a field’s overall reflectance lower and bright, dry soil will bump it up. Without accounting for this, a model might conclude differences in crop type where it’s really differences in soil color or moisture. For instance, two fields of the same crop could display different NDVI values if one has a lot of exposed soil and the other is fully leaf-covered. <strong>The spectral mixture problem</strong> is well documented and well researched. You can explore it here: <a href="https://doi.org/10.3390/rs11161932">https://doi.org/10.3390/rs11161932</a> . A data scientist without this background might be puzzled why their model confuses a thin canopy of one crop with a healthy dense canopy of another.</p><p>Furthermore, soil differences across regions (e.g., red clay soil vs. grey sandy soil) mean that the same crop can have different composite spectral signatures in each region. Ignoring this can reduce a model’s transferability.</p><h4>5. Struggles with Mixed Cropping and Intercropping</h4><p>Not every field is a monoculture. In many parts of the world, like my own country, farmers practice mixed cropping. This presents a nightmare scenario for a classification approach that assumes “one pixel, one crop”. If your satellite image has a 10m or 30m pixel size, that pixel could easily be a blend of two crops (say maize and beans grown together).</p><p>It’s important to set realistic expectations. Even with the “fanciest” ML model, accurately identifying every component of a mixed-crop field from space is extremely difficult especially if you are using low resolution imagery. Data scientists who are unaware of these ground realities might over-promise results and under deliver. Again the best practice? Apply local agriculture knowledge and acknowledge the limitation.</p><p><strong>Last Few Words</strong></p><p>In the end, successful agriculture modelling is a team sport. It requires the precision of data science, the contextual awareness of remote sensing, and often the practical insights of farmers and agronomists on the ground. There are even more complexities in remote sensing beyond what I have covered here, such as multi-angle observations, BRDF corrections, and challenges specific to drone imagery like geometric distortions and inconsistent lighting.</p><p>If it feels overwhelming at first its encouraging to remember that there are many models like Prithvi (<a href="https://huggingface.co/ibm-nasa-geospatial/Prithvi-EO-2.0-300M">https://huggingface.co/ibm-nasa-geospatial/Prithvi-EO-2.0-300M</a>) which have undergone solid development and extensive validation. Instead of reinventing the wheel its best to explore existing solutions thoroughly.</p><p>I’m always open to discussions and suggestions, so feel free to share your thoughts or experiences!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62737b714b31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating satellite imagery into a WebGIS platform]]></title>
            <link>https://medium.com/@kumail09/integrating-satellite-imagery-into-a-webgis-platform-7c2e103ee7ba?source=rss-877f834e3a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c2e103ee7ba</guid>
            <dc:creator><![CDATA[Kumail Raza]]></dc:creator>
            <pubDate>Mon, 24 Feb 2025 21:47:19 GMT</pubDate>
            <atom:updated>2025-02-24T21:49:27.899Z</atom:updated>
            <content:encoded><![CDATA[<p>The integration of satellite imagery into WebGIS platforms is an essential component of modern geospatial applications. With advances in remote sensing and cloud computing, it is now possible to visualize, analyze, and interpret satellite-derived information in real time. This article breaks down into a few essential steps which have some important considerations.</p><ol><li>Figuring out the right Data Source:</li></ol><p>Identifying the right satellite data source is a critical first step. Services such as Sentinel-2, part of the European Space Agency’s Copernicus program, provide multispectral imagery for vegetation analysis, land-use classification, and overall environmental monitoring. The Landsat program, jointly managed by USGS and NASA, offers a historical archive of multispectral imagery that has enabled decades-long studies of urban expansion and climate change. In addition to these open-access platforms, commercial providers like Maxar and Planet Labs cater to high-resolution and high-frequency imagery needs, with Maxar offering very detailed datasets and Planet Labs updating large portions of the globe on a near-daily basis. Careful evaluation of your project goals, spatial resolution requirements, temporal frequency, and budget will help in selecting the most appropriate data source and API.</p><p>2. Processing and Preparing Raster Datasets for WebGIS:</p><p>Even after choosing a suitable data source, satellite raster files often need a series of preprocessing steps to function smoothly in a WebGIS application. Many datasets require georeferencing and projection adjustments to align correctly with standardized coordinate systems. Atmospheric corrections may be necessary if the imagery suffers from haze or other distortions. Cloud masking removes unwanted cloud cover and shadows, especially important if you need clear views of the ground surface. Following these initial cleanup steps, large raster files typically benefit from compression and tiling. Tools like GDAL can break the data into manageable segments and apply efficient encoding, speeding up the loading of imagery in a browser-based interface. This approach helps when you need to display large areas at multiple zoom levels without overloading your network or the user’s device.</p><p>A key choice here is the data format you plan to serve to the WebGIS frontend. When you need high-detail images at multiple zoom levels, a tiling scheme using XYZ or WMTS is typically preferred. Alternatively, if you want on-demand, dynamic rendering, Web Map Services (WMS) or Web Map Tile Services (WMTS) provide flexible ways of streaming imagery. The decision depends on the interactive experience you intend to offer users and the performance considerations of your application environment.</p><p>3. Serving and Managing Satellite Imagery:</p><p>After preparing your data, the next task is to manage how the satellite imagery is served to client applications. Many developers rely on prebuilt server solutions like GeoServer or MapServer, which implement established standards set by the Open Geospatial Consortium. These servers can host raster data locally or in the cloud, and they offer straightforward integration with popular JavaScript libraries that power WebGIS interfaces. For more specialized needs, however, a custom tile server can provide tighter control over caching strategies, on-the-fly image processing, and performance optimizations. Frameworks in Python, such as Flask combined with libraries like rio-tiler, help you build bespoke solutions that tailor image retrieval and transformation to your exact requirements. This approach becomes particularly valuable when working with large or frequently updated datasets that demand efficient rendering.</p><p>4. WebGIS Frontend Integration</p><p>Once the data is served, the final step is creating an engaging and functional user interface that visualizes the satellite imagery within a WebGIS context. Several JavaScript libraries facilitate this. Leaflet.js is known for its simplicity, making it a good starting point for projects that do not require heavy 3D or complex vector overlays. Mapbox GL JS offers sophisticated styling and better handling of large-scale vector data while also supporting raster layers. ESRI’s ArcGIS API for JavaScript integrates smoothly with enterprise-level GIS environments and brings extensive analytical tools to browser-based applications. Cesium.js excels in 3D visualization, allowing you to display terrain, volumetric data, and time-dynamic scenes that show changes in the atmosphere or the Earth’s surface. Your choice here depends on your project’s complexity, performance targets, and the kind of user experiences you want to deliver.</p><p>Selecting the right tools in advance can save you significant time down the line. Before jumping straight into coding, take the time to understand the underlying logic behind the implementation. If it feels overwhelming at first, experimenting with different frameworks will help you get more comfortable over time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c2e103ee7ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Draw Polygons on Mobile using React Native Maps]]></title>
            <link>https://medium.com/@kumail09/drawing-polygons-using-react-native-maps-e9ce23a34d72?source=rss-877f834e3a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9ce23a34d72</guid>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[drawing]]></category>
            <category><![CDATA[google-maps-api]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Kumail Raza]]></dc:creator>
            <pubDate>Mon, 06 Mar 2023 19:50:49 GMT</pubDate>
            <atom:updated>2024-09-22T15:34:41.320Z</atom:updated>
            <content:encoded><![CDATA[<p>Google Maps JavaScript API is a powerful tool that allows you to customize maps with your own content and imagery for display on web pages and mobile devices. Today we will be looking into the polygon drawing and editing functionality using this SDK for a React Native app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*alQlr1wKkhck9AvhT-Swcw.png" /><figcaption>Drawing Polygons on React Native Maps</figcaption></figure><p>First, to get started, you need to install the Google Maps JavaScript API by following the official documentation provided by Google. The link to the documentation is here: <a href="https://developers.google.com/maps/documentation/javascript/overview">https://developers.google.com/maps/documentation/javascript/overview</a>.</p><p>For development, we will be using React Native Cli with Android Studio. Now that we have set up the project, we need to import the MapView component from the react-native-maps library. We also need to import Marker, Polyline, and Polygon components from the same library to use them in the code.</p><pre>import MapView, { PROVIDER_GOOGLE, Marker, Polyline, Polygon } from &#39;react-native-maps&#39;;</pre><pre>&lt;MapView<br>  provider={PROVIDER_GOOGLE}<br>  ref={map =&gt; (this._map = map)}<br>  style={styles.map}<br>  showsUserLocation={true}<br>  showsCompass={true}<br>  showsMyLocationButton={true}<br>  zoomControlEnabled={true}<br>  onPress={this.handleOnPress}<br>  mapType={&#39;hybrid&#39;}<br>  region={{<br>    latitude: this.state.latitude,<br>    longitude: this.state.longitude,<br>    latitudeDelta: this.state.latitudeDelta,<br>    longitudeDelta: this.state.longitudeDelta,<br>  }}<br>/&gt;</pre><p>Here, the onPress function is used to add a marker to the map. Every time the map is pressed, a Marker will be added to the coordinates using the event. Now let&#39;s create an array to store the markers and an array to store the polygon.</p><pre>state = { markerArray: [], polygonCoords: [] }</pre><p>We need to add the marker array to the map:</p><pre>{// Markers Drawing<br>  this.state.markerArray?.map((markerCoords, index) =&gt;<br>    return (<br>      &lt;Marker<br>        coordinate={markerCoords}<br>        key={index}<br>        tappable={false}&gt;<br>        &lt;View&gt;<br>          &lt;StyledMarker color=&quot;#fff&quot; /&gt;<br>        &lt;/View&gt;<br>      &lt;/Marker&gt;<br>    );<br>  }</pre><p>Here, a custom marker icon has been created that is styled to make it look better:</p><pre>const StyledMarker = ({ size = 16, color = &#39;#000&#39; }) =&gt; {<br>  const outerRadius = size / 2;<br>  const innerRadius = size / 4;<br>  return (<br>    &lt;Svg width={size} height={size}&gt;<br>      &lt;Circle cx={outerRadius} cy={outerRadius} r={outerRadius} fill={color} /&gt;<br>      &lt;Circle cx={outerRadius} cy={outerRadius} r={innerRadius} fill=&quot;#000&quot; /&gt;<br>    &lt;/Svg&gt;<br>  );<br>};</pre><p>This is what it looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*5i9MxLX7YSjXGtY-kKxU7Q.gif" /></figure><p>Now, let’s add lines joining the points and a dotted line to join the start and end point. To do this we need to add an event to the first marker.<br>Lets update our code for markers like this:</p><pre>{<br> // Markers Drawing<br> this.state.markerArray?.map((markerCoords, index) =&gt; {<br> if (index &gt; 1) {<br>   return (<br>     &lt;Marker<br>         coordinate={markerCoords}<br>         key={index}<br>         tappable={false}&gt;<br>         &lt;View&gt;<br>         &lt;StyledMarker color=&quot;#fff&quot; /&gt;<br>         &lt;/View&gt;<br>     &lt;/Marker&gt;<br>     );<br>   } else {<br>   return (<br>   &lt;Marker<br>       coordinate={markerCoords}<br>       key={index}<br>       tappable={false}<br>       onPress={this.completePolyOnPress}&gt;<br>       &lt;View&gt;<br>         &lt;StyledMarker color=&quot;#fff&quot; /&gt;<br>       &lt;/View&gt;<br>   &lt;/Marker&gt;<br>   );<br>}})}</pre><p>Here you can see we are adding an event to the first marker to complete Polygon on press.<br>We empty the markers and save it to a Polygon Coordinates array.</p><pre>completePolyOnPress = () =&gt; {<br>   this.setState({polygonCoords: this.state.markerArray});<br>   this.setState({markerArray: []});<br>}</pre><p>Lets add a polygon component to the map.</p><pre>{<br>  // Drawn Polygon<br>  this.state.polygonCoords.length &gt; 2 ? (<br>    &lt;Polygon<br>      coordinates={this.state.polygonCoords}<br>      strokeWidth={3}<br>      strokeColor={&#39;#007493&#39;}<br>      fillColor={&#39;rgba(0, 201, 255, 0.5)&#39;}<br>    /&gt;<br>  ) : (<br>    &lt;&gt;&lt;/&gt;<br>  )<br>}</pre><p>Finally, when the first point is clicked, we will close and finish the polygon</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*TKa1cW_iRqIpmhKpRNBh4g.gif" /></figure><p>As a GIS Engineer and Web Developer, I have been using the Google Maps JavaScript API for a variety of applications. In this tutorial, we explored how to draw and edit polygons on a map using the API in a React Native app.</p><p>If you found this article helpful, please give it a follow to stay up to date with the latest tutorials and tips on developing your Geospatial web and mobile applications. I value your feedback and would love to hear your thoughts and comments on this article.</p><p>Let’s continue to learn and grow together as we leverage the power of GIS and web development to build innovative and impactful applications. Thank you for taking the time to read this article, and I look forward to connecting with you in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9ce23a34d72" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>