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

  • SEARCH
  • Home
  • 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 6113855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:54:24+00:00 2026-05-23T14:54:24+00:00

Would it be possible if someone could help me parse this json result. I

  • 0

Would it be possible if someone could help me parse this json result. I have retrieved the result as a string

{"query":{"latitude":39.9889,"longitude":-82.8118},"timestamp":1310252291.861,"address":{"geometry":{"coordinates":[-82.81168367358264,39.9887910986731],"type":"Point"},"properties":{"address":"284 Macdougal Ln","distance":"0.02","postcode":"43004","city":"Columbus","county":"Franklin","province":"OH","country":"US"},"type":"Feature"}}
  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-05-23T14:54:25+00:00Added an answer on May 23, 2026 at 2:54 pm

    Jackson. Simple and intuitive to use. For me the best available. Start out with Simple Data Binding, it will throw everything it finds in Maps and Lists.

    Like this:

    ObjectMapper mapper = new ObjectMapper();
    Map<String,Object> yourData = mapper.readValue(new File("yourdata.json"), Map.class);
    

    That’s all that’s needed.

    A good and quick introduction can be found here

    And a full working example with your actual data:

    import java.io.IOException;
    import java.util.Map;
    import org.codehaus.jackson.map.ObjectMapper;
    
    public class Main {
    
        public static void main(String[] args) throws IOException {
            ObjectMapper mapper = new ObjectMapper();
            Map<?,?> rootAsMap = mapper.readValue(
                    "{\"query\":{\"latitude\":39.9889,\"longitude\":-82.8118},\"timestamp\":1310252291.861,\"address\":{\"geometry\":{\"coordinates\":[-82.81168367358264,39.9887910986731],\"type\":\"Point\"},\"properties\":{\"address\":\"284 Macdougal Ln\",\"distance\":\"0.02\",\"postcode\":\"43004\",\"city\":\"Columbus\",\"county\":\"Franklin\",\"province\":\"OH\",\"country\":\"US\"},\"type\":\"Feature\"}}".getBytes(),
                    Map.class);
            System.out.println(rootAsMap);
            Map query = (Map) rootAsMap.get("query");
            Map address = (Map) rootAsMap.get("address");
            Map addressProperties = (Map) address.get("properties");
            String county = (String) addressProperties.get("county");
            System.out.println("County is " + county);
        }
    
    }
    

    Now, this whole Map juggling also illustrates Bozho’s point pretty well, using full binding (by creating a Java class that reflects the content of the JSON data) will work better in the end.

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

Sidebar

Related Questions

I was wondering if someone could help me to get this method converted to
I was wondering if someone could help with the following problem. I have a
Could someone please advice why i have a memory leak in this code? I
I wonder whether someone could help me please. I have put together a form
I have 2 questions that I was hoping someone could help me with. Is
Would it be possible to add a new operator to the String class that
Hello is it possible if someone could tell me the easiest way to create
Possible Duplicate: Evaluate C# string with math operators So lets say I have a
Possible Duplicate: Need help solving Project Euler problem 200 Similar to this question Project
hoping someone can help me out with this. I'm trying to figure out whether

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.