Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 128687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:40:31+00:00 2026-05-11T05:40:31+00:00

I was looking around the internet and couldn’t find a perfect algorithm for this

  • 0

I was looking around the internet and couldn’t find a perfect algorithm for this particular problem:

Our customer have a set of points and weight data along with each point as can be demonstrated by this image:

weighted points http://chakrit.net/files/stackoverflow/so_heightmap_points.png

Of which, we have a GIS program that could generate a ‘heightmap’ or a sort of terrain data from these points and their weight values but as we have near a thousand points of data and that these will change over time, we would like to create our own tools to auto-generate these heightmaps.

So far, I’ve tried to calculate the weight for each pixel from its distance to the closest data point with Sqrt((x1 - x2) ^ 2 + (y1 - y2) ^ 2) and applying weight and distance factor to the data point’s color to produce the resulting gradient color for that particular pixel:

heightmap result http://chakrit.net/files/stackoverflow/so_heightmap_result.png

You can see that there are still problems with certain configuration of data points and the algorithm sometimes produce a rather polygonal image when there is a lot of data points. The ideal result should looks more like an ellipsis and less like a polygon.

Here is one example image from wikipedia article on gradient ascent which demonstrates the result I want:

mountains http://chakrit.net/files/stackoverflow/so_gradient_descent.png

The gradient ascent algorithm is not of my interest. What I’m interested in; is the algorithm to calculate the original function in that picture in the first place, provided data points with weights.

I’ve not taken any class in topological maths, but I can do some calculus. I think I may be missing something and am rather lost at what should I type in that Google search box.

I need some pointers.

Thanks!

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:40:31+00:00Added an answer on May 11, 2026 at 5:40 am

    What you are looking for is Surface Interpolation.

    Some products exist to do this (here’s one)

    The resulting function/spline/other mathematical construct can then be interrogated at the required resolution to supply the height map.

    Your interpolation function

    Sqrt((x1 - x2) ^ 2 + (y1 - y2) ^ 2)  

    Is similar to Inverse Distance Weighted methods except you are applying an arbitrary filter and discarding many of the other data points.

    Most of these techniques rely on a reasonable number of samples and ‘terrain-like’ behaviour underpinning the values.

    I suggest using the weight as the height sample and trying the simple Shepard’s Method in the second link (do not filter any pixels to start with) by taking the proportion of a sample points contribution to the overall height value at an interpolation point you can blend the colours of the samples in those ratios to also colour the point. Use the intensity (roughly speaking the grayscale in simple RGB space) to display the height or add contour lines in black like the example image does.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 103k
  • Answers 103k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes you can. Add another one of these. routes.MapRoute( "Default",… May 11, 2026 at 8:22 pm
  • Editorial Team
    Editorial Team added an answer import os def findup(filename): drive, thisdir = os.path.splitdrive(os.getcwd()) while True:… May 11, 2026 at 8:22 pm
  • Editorial Team
    Editorial Team added an answer When using Windows Authentication, System.Web.HttpContext.Current.User.Identity.Name will give you the user's… May 11, 2026 at 8:22 pm

Related Questions

I was looking around the internet and couldn't find a perfect algorithm for this
all, me again with another noob Cocos2d iphone question. I've set my Director to
We are an all Unix shop (Solaris, Linux). This last product cycle I returned
I am looking for a better solution than what we currently have to deal
There have been similar questions but the answers weren't what I was looking for.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.