Skip to content

Instantly share code, notes, and snippets.

View aspose-com-gists's full-sized avatar

Aspose.com Gists aspose-com-gists

View GitHub Profile
# Convert Shapefile to KML in Python
# Read the full guide here: https://blog.aspose.com/gis/convert-shapefile-to-kml-in-python/
# Complete working example: Convert Shapefile to KML using Aspose.GIS for Python via .NET
import os
from aspose.gis import VectorLayer, KmlWriter, KmlOptions
def convert_shapefile_to_kml(input_shp: str, output_kml: str):
# Validate input file
# Convert Shapefile to JPG in Python
# Read the full guide here: https://blog.aspose.com/gis/convert-shapefile-to-jpg-in-python/
import aspose.gis as gis
from aspose.gis import GisDocument, ImageRenderer, ImageExportOptions, Color, Size, CoordinateSystem
# 1. Load the Shapefile
doc = GisDocument()
doc.open("data/roads.shp") # Replace with your Shapefile path
@aspose-com-gists
aspose-com-gists / write_text_on_jpg_adding_text_jpg.cs
Created May 25, 2026 11:42
Write Text on JPG Image in .NET–STEP-by-STEP Guide
// Write Text on JPG Image in .NET-STEP-by-STEP Guide
// Read the full guide here: https://blog.aspose.com/drawing/write-text-on-jpg-image-in-dotnetstep-by-step-guide/
using System;
using Aspose.Drawing;
using Aspose.Drawing.Imaging;
using Aspose.Drawing.Drawing2D;
using Aspose.Drawing.Fonts;
using Aspose.Drawing.Brushes;
using Aspose.Drawing.Colors;
@aspose-com-gists
aspose-com-gists / create_draw_on_bitmaps_bitmap_creation_drawing.cs
Last active May 22, 2026 07:11
How to Create and Draw on Bitmaps with Aspose.Drawing in .NET
// How to Create and Draw on Bitmaps with Aspose.Drawing in .NET
// Read the full guide here: https://blog.aspose.com/drawing/how-to-create-and-draw-on-bitmaps-with-asposedrawing-in-dotnet/
using System;
using Aspose.Drawing;
using Aspose.Drawing.Imaging;
using Aspose.Drawing.Imaging.ImageOptions;
using Aspose.Drawing.Drawing2D;
namespace BitmapDemo
@aspose-com-gists
aspose-com-gists / add_insert_draw_text_java_text_overlay.java
Created May 22, 2026 05:32
Add Insert or Draw Text on PNG JPEG TIFF Icon GIF Image Java
// Add Insert or Draw Text on PNG JPEG TIFF Icon GIF Image Java
// Read the full guide here: https://blog.aspose.com/slides/add-insert-or-draw-text-on-png-jpeg-tiff-icon-gif-image-java/
import com.aspose.slides.*;
import java.awt.*;
import java.awt.image.*;
public class TextOverlayExample {
public static void main(String[] args) throws Exception {
// Load source image (PNG, JPEG, TIFF, ICON, or GIF)
@aspose-com-gists
aspose-com-gists / geojson_topojson_conversion_net_geojson_topojson_conversion.cs
Created May 21, 2026 08:15
GEOJSON to Topojson Conversion in .NET: Sample Guide
// GEOJSON to Topojson Conversion in .NET: Sample Guide
// Read the full guide here: https://blog.aspose.com/gis/geojson-to-topojson-conversion-in-dotnet-sample-guide/
using System;
using System.Threading.Tasks;
using Aspose.GIS;
using Aspose.GIS.Geometries;
using Aspose.GIS.IO;
using Aspose.GIS.IO.GeoJson;
using Aspose.GIS.IO.TopoJson;
@aspose-com-gists
aspose-com-gists / export_attributes_of_gis_vector_layer_to_csv_compl.py
Last active May 14, 2026 04:23
Export Vector Layer to CSV using Python
# Complete working example for exporting a vector layer to CSV
# ---------------------------------------------------------
# Required imports
import aspose.gis as gis
from aspose.gis import FeatureAttribute, AttributeDataType, Drivers
from aspose.gis.geometries import Geometry
from aspose.gis.formats.csv import CsvOptions
from aspose.gis.geometries import Point, LineString
@aspose-com-gists
aspose-com-gists / asposegis_gpx_to_geojson_pipeline_complete_code_ex.py
Created May 8, 2026 12:39
GPX to GEOJSON Conversion Tutorial in Python
# -*- coding: utf-8 -*-
import sys
import json
from aspose.gis import GisFile, GisException
def convert_gpx_to_geojson(input_path: str, output_path: str) -> None:
try:
# Load GPX file
gpx = GisFile.open(input_path)
@aspose-com-gists
aspose-com-gists / gpx_to_csv_conversion_implementation_complete_code.py
Last active May 8, 2026 12:30
GPX to CSV Conversion Guide using Python
from aspose.gis import VectorLayer, ConversionOptions
from aspose.gis import Drivers
# Convert file format from GPX to CSV.
VectorLayer.convert(
"Data/sample.gpx",
Drivers.gpx,
"output/destination.csv",
Drivers.csv
)
@aspose-com-gists
aspose-com-gists / xbrl_instance_to_xlsx_conversion_complete_code_exa.py
Last active April 28, 2026 11:13
How to Perform XBRL to XLSX Conversion using Python
from aspose.finance.xbrl import *
import sys
def convert_xbrl_to_xlsx(input_path: str, output_path: str):
try:
# Initialize the XBRL document
xbrl_doc = XbrlDocument(input_path)
# Set conversion options
options = SaveOptions()